blob: f5eea7a169421840a9ff9cb21b414e21f2436f14 [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
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +0530989If one of the secondary emails associated with the user performing the operation was used as the
990committer email in the current patch set, the same email will be used as the committer email in the
991new patch set; otherwise, the user's preferred email will be used.
992
Aaron Gable9b413072017-08-24 13:15:21 -0700993.Request
994----
995 POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0
996 Content-Type: application/json; charset=UTF-8
997
998 {
999 "subject": "Merge dev_branch into master",
1000 "merge": {
David Pursehousef4fb1042018-03-18 23:03:46 +09001001 "source": "refs/changes/34/1234/1"
Aaron Gable9b413072017-08-24 13:15:21 -07001002 }
1003 }
1004----
1005
1006As response a link:#change-info[ChangeInfo] entity with current revision is
1007returned that describes the resulting change.
1008
1009.Response
1010----
1011 HTTP/1.1 200 OK
1012 Content-Disposition: attachment
1013 Content-Type: application/json; charset=UTF-8
1014
1015 )]}'
1016 {
1017 "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc",
1018 "project": "test",
1019 "branch": "master",
1020 "hashtags": [],
1021 "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc",
1022 "subject": "Merge dev_branch into master",
1023 "status": "NEW",
1024 "created": "2016-09-23 18:08:53.238000000",
1025 "updated": "2016-09-23 18:09:25.934000000",
1026 "submit_type": "MERGE_IF_NECESSARY",
1027 "mergeable": true,
1028 "insertions": 5,
1029 "deletions": 0,
1030 "_number": 72,
1031 "owner": {
1032 "_account_id": 1000000
1033 },
1034 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822"
1035 }
1036----
1037
1038[[set-message]]
1039=== Set Commit Message
1040--
1041'PUT /changes/link:#change-id[\{change-id\}]/message'
1042--
1043
1044Creates a new patch set with a new commit message.
1045
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05301046If one of the secondary emails associated with the user performing the operation was used as the
1047committer email in the current patch set, the same email will be used as the committer email in the
1048new patch set; otherwise, the user's preferred email will be used.
1049
Aaron Gable9b413072017-08-24 13:15:21 -07001050The new commit message must be provided in the request body inside a
Han-Wen Nienhuys098580a2019-07-24 20:17:41 +02001051link:#commit-message-input[CommitMessageInput] entity. If a Change-Id
1052footer is specified, it must match the current Change-Id footer. If
1053the Change-Id footer is absent, the current Change-Id is added to the
1054message.
Aaron Gable9b413072017-08-24 13:15:21 -07001055
1056.Request
1057----
1058 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0
1059 Content-Type: application/json; charset=UTF-8
1060
1061 {
1062 "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n"
1063 }
1064----
1065
1066.Notifications
1067
1068An email will be sent using the "newpatchset" template.
1069
1070[options="header",cols="1,1"]
1071|=============================
1072|WIP State |Default
1073|Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers
1074|Work in progress|owner
1075|=============================
1076
Edwin Kempin64006bb2013-02-22 08:17:04 +01001077[[get-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001078=== Get Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001079--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001080'GET /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001081--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001082
Edwin Kempin64006bb2013-02-22 08:17:04 +01001083Retrieves the topic of a change.
1084
1085.Request
1086----
1087 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
1088----
1089
1090.Response
1091----
1092 HTTP/1.1 200 OK
1093 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001094 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +01001095
1096 )]}'
1097 "Documentation"
1098----
1099
1100If the change does not have a topic an empty string is returned.
1101
1102[[set-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001103=== Set Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001104--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001105'PUT /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001106--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001107
Edwin Kempin64006bb2013-02-22 08:17:04 +01001108Sets the topic of a change.
1109
1110The new topic must be provided in the request body inside a
Patrick Hiesel4aa14562018-06-19 15:07:50 +02001111link:#topic-input[TopicInput] entity. Any leading or trailing whitespace
1112in the topic name will be removed.
Edwin Kempin64006bb2013-02-22 08:17:04 +01001113
1114.Request
1115----
1116 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001117 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +01001118
1119 {
1120 "topic": "Documentation"
1121 }
1122----
1123
1124As response the new topic is returned.
1125
1126.Response
1127----
1128 HTTP/1.1 200 OK
1129 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001130 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +01001131
1132 )]}'
1133 "Documentation"
1134----
1135
1136If the topic was deleted the response is "`204 No Content`".
1137
1138[[delete-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001139=== Delete Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001140--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001141'DELETE /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001142--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001143
Edwin Kempin64006bb2013-02-22 08:17:04 +01001144Deletes the topic of a change.
1145
Edwin Kempin64006bb2013-02-22 08:17:04 +01001146.Request
1147----
1148 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
1149----
1150
1151.Response
1152----
1153 HTTP/1.1 204 No Content
1154----
1155
Patrick Hieselbb84fd72017-08-23 11:11:22 +02001156[[get-pure-revert]]
1157=== Get Pure Revert
1158--
1159'GET /changes/link:#change-id[\{change-id\}]/pure_revert'
1160--
1161
1162Check if the given change is a pure revert of the change it references in `revertOf`.
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02001163Optionally, the query parameter `o` can be passed in to specify a commit (SHA-1 in
Patrick Hieselbb84fd72017-08-23 11:11:22 +0200116440 digit hex representation) to check against. It takes precedence over `revertOf`.
1165If the change has no reference in `revertOf`, the parameter is mandatory.
1166
1167As response a link:#pure-revert-info[PureRevertInfo] entity is returned.
1168
1169.Request
1170----
1171 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/pure_revert?o=247bccf56ae47634650bcc08b8aa784c3580ccas HTTP/1.0
1172----
1173
1174.Response
1175----
1176 HTTP/1.1 200 OK
1177 Content-Disposition: attachment
1178 Content-Type: application/json; charset=UTF-8
1179
1180 )]}'
1181 {
1182 "is_pure_revert" : false
1183 }
1184----
1185
Edwin Kempined5364b2013-02-22 10:39:33 +01001186[[abandon-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001187=== Abandon Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001188--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001189'POST /changes/link:#change-id[\{change-id\}]/abandon'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001190--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001191
Edwin Kempined5364b2013-02-22 10:39:33 +01001192Abandons a change.
1193
1194The request body does not need to include a link:#abandon-input[
1195AbandonInput] entity if no review comment is added.
1196
Edwin Kempinc9219002023-09-08 08:07:21 +00001197Abandoning a change also removes all users from the link:user-attention-set.html[attention set].
Gal Paikinc326de42020-06-16 18:49:00 +03001198
Edwin Kempined5364b2013-02-22 10:39:33 +01001199.Request
1200----
1201 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0
1202----
1203
1204As response a link:#change-info[ChangeInfo] entity is returned that
1205describes the abandoned change.
1206
1207.Response
1208----
1209 HTTP/1.1 200 OK
1210 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001211 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001212
1213 )]}'
1214 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001215 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1216 "project": "myProject",
1217 "branch": "master",
1218 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1219 "subject": "Implementing Feature X",
1220 "status": "ABANDONED",
1221 "created": "2013-02-01 09:59:32.126000000",
1222 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001223 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001224 "insertions": 3,
1225 "deletions": 310,
Edwin Kempined5364b2013-02-22 10:39:33 +01001226 "_number": 3965,
1227 "owner": {
1228 "name": "John Doe"
1229 }
1230 }
1231----
1232
1233If the change cannot be abandoned because the change state doesn't
1234allow abandoning of the change, the response is "`409 Conflict`" and
1235the error message is contained in the response body.
1236
1237.Response
1238----
1239 HTTP/1.1 409 Conflict
1240 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001241 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001242
1243 change is merged
1244----
1245
Logan Hankse43b68e2017-05-23 13:16:22 -07001246.Notifications
1247
1248An email will be sent using the "abandon" template. The notify handling is ALL.
1249Notifications are suppressed on WIP changes that have never started review.
1250
Logan Hanks87607412017-05-30 13:49:04 -07001251[options="header",cols="1,2"]
Logan Hankse43b68e2017-05-23 13:16:22 -07001252|=============================
Logan Hanks87607412017-05-30 13:49:04 -07001253|WIP State |notify=ALL
Logan Hankse43b68e2017-05-23 13:16:22 -07001254|Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1255|Work in progress|not sent
1256|Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1257|=============================
1258
Edwin Kempined5364b2013-02-22 10:39:33 +01001259[[restore-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001260=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001261--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001262'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001263--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001264
Edwin Kempined5364b2013-02-22 10:39:33 +01001265Restores a change.
1266
1267The request body does not need to include a link:#restore-input[
1268RestoreInput] entity if no review comment is added.
1269
1270.Request
1271----
1272 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
1273----
1274
1275As response a link:#change-info[ChangeInfo] entity is returned that
1276describes the restored change.
1277
1278.Response
1279----
1280 HTTP/1.1 200 OK
1281 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001282 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001283
1284 )]}'
1285 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001286 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1287 "project": "myProject",
1288 "branch": "master",
1289 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1290 "subject": "Implementing Feature X",
1291 "status": "NEW",
1292 "created": "2013-02-01 09:59:32.126000000",
1293 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001294 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001295 "insertions": 2,
1296 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +01001297 "_number": 3965,
1298 "owner": {
1299 "name": "John Doe"
1300 }
1301 }
1302----
1303
1304If the change cannot be restored because the change state doesn't
1305allow restoring the change, the response is "`409 Conflict`" and
1306the error message is contained in the response body.
1307
1308.Response
1309----
1310 HTTP/1.1 409 Conflict
1311 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001312 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001313
1314 change is new
1315----
1316
Edwin Kempincdae63b2013-03-15 15:06:59 +01001317[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001318=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001319--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001320'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001321--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001322
1323Rebases a change.
1324
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05301325If one of the secondary emails associated with the user performing the operation was used as the
1326committer email in the current patch set, the same email will be used as the committer email in the
1327new patch set; otherwise, the user's preferred email will be used.
1328
Zalan Blenessy874aed72015-01-12 13:26:18 +01001329Optionally, the parent revision can be changed to another patch set through the
1330link:#rebase-input[RebaseInput] entity.
1331
Edwin Kempincdae63b2013-03-15 15:06:59 +01001332.Request
1333----
1334 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01001335 Content-Type: application/json;charset=UTF-8
1336
1337 {
1338 "base" : "1234",
1339 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01001340----
1341
1342As response a link:#change-info[ChangeInfo] entity is returned that
1343describes the rebased change. Information about the current patch set
1344is included.
1345
1346.Response
1347----
1348 HTTP/1.1 200 OK
1349 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001350 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001351
1352 )]}'
1353 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01001354 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1355 "project": "myProject",
1356 "branch": "master",
1357 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1358 "subject": "Implement Feature X",
1359 "status": "NEW",
1360 "created": "2013-02-01 09:59:32.126000000",
1361 "updated": "2013-02-21 11:16:36.775000000",
1362 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001363 "insertions": 33,
1364 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +01001365 "_number": 4799,
1366 "owner": {
1367 "name": "John Doe"
1368 },
1369 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
1370 "revisions": {
1371 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09001372 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001373 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01001374 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001375 "fetch": {
1376 "http": {
1377 "url": "http://gerrit:8080/myProject",
1378 "ref": "refs/changes/99/4799/2"
1379 }
1380 },
1381 "commit": {
1382 "parents": [
1383 {
1384 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
1385 "subject": "Implement Feature A"
1386 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00001387 ],
1388 "author": {
1389 "name": "John Doe",
1390 "email": "john.doe@example.com",
1391 "date": "2013-05-07 15:21:27.000000000",
1392 "tz": 120
1393 },
1394 "committer": {
1395 "name": "Gerrit Code Review",
1396 "email": "gerrit-server@example.com",
1397 "date": "2013-05-07 15:35:43.000000000",
1398 "tz": 120
1399 },
1400 "subject": "Implement Feature X",
1401 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01001402 }
1403 }
1404 }
1405----
1406
1407If the change cannot be rebased, e.g. due to conflicts, the response is
1408"`409 Conflict`" and the error message is contained in the response
1409body.
1410
1411.Response
1412----
1413 HTTP/1.1 409 Conflict
1414 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001415 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001416
1417 The change could not be rebased due to a path conflict during merge.
1418----
1419
Edwin Kempin8b2ff7f2023-03-24 12:14:44 +01001420Rebasing a change is allowed for the change owner, users with the
1421link:access-control.html#category_rebase[Rebase] permission and users
1422with the link:access-control.html#category_submit[Submit] permission.
1423
1424In addition, the rebaser or the original uploader, if rebasing is done
1425on behalf of the uploader (see `rebase_on_behalf_of_uploader` option in
1426link:#rebase-input[RebaseInput]), needs to have all permissions that
1427are required to create the new patch set:
1428
1429* the link:access-control.html#category_push[Push] permission
1430* the link:access-control.html#category_add_patch_set[Add Patch Set]
1431 permission (only if the user is not the change owner)
1432* the link:access-control.html#category_forge_author[Forge Author]
1433 permission (only if the commit author is forged)
1434* the link:access-control.html#category_forge_server[Forge Server]
1435 permission (only if the commit author is the server identity)
1436
1437The same permissions were required for the upload of the original patch
1438set. This means if the rebase is done on behalf of the uploader these
1439permission checks should just pass, unless the uploader lost
1440permissions after the upload of the original patch set. In this case
1441rebasing on behalf of the uploader is not possible and a normal rebase
1442(on behalf of the rebaser) must be done, which means that the rebaser
1443becomes the uploader and takes over the change. If self approvals are
1444disallowed, this means that the rebaser can no longer approve the
1445change (as approvals of the uploader are ignored).
1446
Nitzan Gur-Furman4655d8b2022-12-16 08:46:18 +01001447[[rebase-chain]]
1448=== Rebase Chain
1449--
1450'POST /changes/link:#change-id[\{change-id\}]/rebase:chain'
1451--
1452
1453Rebases an ancestry chain of changes.
1454
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05301455If one of the secondary emails associated with the user performing the operation was used as the
1456committer email in the current patch set, the same email will be used as the committer email in the
1457new patch set; otherwise, the user's preferred email will be used.
1458
Nitzan Gur-Furman4655d8b2022-12-16 08:46:18 +01001459The operated change is treated as the chain tip. All unsubmitted ancestors are rebased.
1460
1461Requires a linear ancestry relation (single parenting throughout the chain).
1462
1463Optionally, the parent revision (of the oldest ancestor to be rebased) can be changed to another
1464change, revision or branch through the link:#rebase-input[RebaseInput] entity.
1465
1466If the chain is outdated, i.e., there's a change that depends on an old revision of its parent, the
1467result is the same as individually rebasing all outdated changes on top of their parent's latest
1468revision before running the rebase chain action.
1469
1470.Request
1471----
1472 POST /changes/myProject~master~I08a021fb07b83fe845140a2c11508b3bdd93b48f/rebase:chain HTTP/1.0
1473 Content-Type: application/json;charset=UTF-8
1474
1475 {
1476 "base" : "1234",
1477 }
1478----
1479
1480As response a link:#rebase-chain-info[RebaseChainInfo] entity is returned that
1481describes the rebased changes. Information about the current patch sets
1482are included.
1483
1484.Response
1485----
1486 HTTP/1.1 200 OK
1487 Content-Disposition: attachment
1488 Content-Type: application/json; charset=UTF-8
1489
1490 )]}'
1491 {
1492 "rebased_changes": [
1493 {
1494 "id": "myProject~master~I0e534de9d7f0d6f35b71f7d726acf835b2110c66",
1495 "project": "myProject",
1496 "branch": "master",
1497 "hashtags": [
1498
1499 ],
1500 "change_id": "I0e534de9d7f0d6f35b71f7d726acf835b2110c66",
1501 "subject": "456",
1502 "status": "NEW",
1503 "created": "2022-11-21 20: 51: 31.000000000",
1504 "updated": "2022-11-21 20: 56: 49.000000000",
1505 "submit_type": "MERGE_IF_NECESSARY",
1506 "insertions": 0,
1507 "deletions": 0,
1508 "total_comment_count": 0,
1509 "unresolved_comment_count": 0,
1510 "has_review_started": true,
1511 "meta_rev_id": "a2a6692213f546e1045ecf4647439fac8d6d8faa",
1512 "_number": 21,
1513 "owner": {
1514 "_account_id": 1000000
1515 },
1516 "current_revision": "c3b2ba222d42a56e05c90f88d4509a124620517d",
1517 "revisions": {
1518 "c3b2ba222d42a56e05c90f88d4509a124620517d": {
1519 "kind": "NO_CHANGE",
1520 "_number": 2,
1521 "created": "2022-11-21 20: 56: 49.000000000",
1522 "uploader": {
1523 "_account_id": 1000000
1524 },
1525 "ref": "refs/changes/21/21/2",
1526 "fetch": {
1527
1528 },
1529 "commit": {
1530 "parents": [
1531 {
1532 "commit": "7803f427dd7c4a2441466e4d740a1850dcee1af4",
1533 "subject": "123"
1534 }
1535 ],
1536 "author": {
1537 "name": "Nitzan Gur-Furman",
1538 "email": "nitzan@google.com",
1539 "date": "2022-11-21 20: 49: 39.000000000",
1540 "tz": 60
1541 },
1542 "committer": {
1543 "name": "Administrator",
1544 "email": "admin@example.com",
1545 "date": "2022-11-21 20: 56: 49.000000000",
1546 "tz": 60
1547 },
1548 "subject": "456",
1549 "message": "456\n"
1550 },
1551 "description": "Rebase"
1552 }
1553 },
1554 "requirements": [
1555
1556 ],
1557 "submit_records": [
1558 {
1559 "rule_name": "gerrit~DefaultSubmitRule",
1560 "status": "NOT_READY",
1561 "labels": [
1562 {
1563 "label": "Code-Review",
1564 "status": "NEED"
1565 }
1566 ]
1567 }
1568 ]
1569 },
1570 {
1571 "id": "myProject~master~I08a021fb07b83fe845140a2c11508b3bdd93b48f",
1572 "project": "myProject",
1573 "branch": "master",
1574 "hashtags": [
1575
1576 ],
1577 "change_id": "I08a021fb07b83fe845140a2c11508b3bdd93b48f",
1578 "subject": "789",
1579 "status": "NEW",
1580 "created": "2022-11-21 20: 51: 31.000000000",
1581 "updated": "2022-11-21 20: 56: 49.000000000",
1582 "submit_type": "MERGE_IF_NECESSARY",
1583 "insertions": 0,
1584 "deletions": 0,
1585 "total_comment_count": 0,
1586 "unresolved_comment_count": 0,
1587 "has_review_started": true,
1588 "meta_rev_id": "3bfb843fea471f96e16b9199c3a30fff0285bc45",
1589 "_number": 22,
1590 "owner": {
1591 "_account_id": 1000000
1592 },
1593 "current_revision": "77eb17a9501a5c21963bc6af56085e60f281acbb",
1594 "revisions": {
1595 "77eb17a9501a5c21963bc6af56085e60f281acbb": {
1596 "kind": "NO_CHANGE",
1597 "_number": 2,
1598 "created": "2022-11-21 20: 56: 49.000000000",
1599 "uploader": {
1600 "_account_id": 1000000
1601 },
1602 "ref": "refs/changes/22/22/2",
1603 "fetch": {
1604
1605 },
1606 "commit": {
1607 "parents": [
1608 {
1609 "commit": "c3b2ba222d42a56e05c90f88d4509a124620517d",
1610 "subject": "456"
1611 }
1612 ],
1613 "author": {
1614 "name": "Nitzan Gur-Furman",
1615 "email": "nitzan@google.com",
1616 "date": "2022-11-21 20: 51: 07.000000000",
1617 "tz": 60
1618 },
1619 "committer": {
1620 "name": "Administrator",
1621 "email": "admin@example.com",
1622 "date": "2022-11-21 20: 56: 49.000000000",
1623 "tz": 60
1624 },
1625 "subject": "789",
1626 "message": "789\n"
1627 },
1628 "description": "Rebase"
1629 }
1630 },
1631 "requirements": [
1632
1633 ],
1634 "submit_records": [
1635 {
1636 "rule_name": "gerrit~DefaultSubmitRule",
1637 "status": "NOT_READY",
1638 "labels": [
1639 {
1640 "label": "Code-Review",
1641 "status": "NEED"
1642 }
1643 ]
1644 }
1645 ]
1646 }
1647 ],
1648 }
1649----
1650
1651If the change cannot be rebased, e.g. due to conflicts, the response is
1652"`409 Conflict`" and the error message is contained in the response
1653body.
1654
1655.Response
1656----
1657 HTTP/1.1 409 Conflict
1658 Content-Disposition: attachment
1659 Content-Type: text/plain; charset=UTF-8
1660
1661 Change I0e534de9d7f0d6f35b71f7d726acf835b2110c66 could not be rebased due to a conflict during
1662 merge.
1663
1664 merge conflict(s):
1665 a.txt
1666----
1667
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301668[[move-change]]
1669=== Move Change
1670--
1671'POST /changes/link:#change-id[\{change-id\}]/move'
1672--
1673
1674Move a change.
1675
1676The destination branch must be provided in the request body inside a
1677link:#move-input[MoveInput] entity.
Marija Savtchoukcee6a8f2020-12-03 12:58:04 +00001678Only veto votes that are blocking the change from submission are moved to
1679the destination branch by default.
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301680
1681.Request
1682----
1683 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0
1684 Content-Type: application/json; charset=UTF-8
1685
1686 {
1687 "destination_branch" : "release-branch"
1688 }
1689
1690----
1691
1692As response a link:#change-info[ChangeInfo] entity is returned that
1693describes the moved change.
1694
1695.Response
1696----
1697 HTTP/1.1 200 OK
1698 Content-Disposition: attachment
1699 Content-Type: application/json; charset=UTF-8
1700
1701 )]}'
1702 {
1703 "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940",
1704 "project": "myProject",
1705 "branch": "release-branch",
1706 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1707 "subject": "Implementing Feature X",
1708 "status": "NEW",
1709 "created": "2013-02-01 09:59:32.126000000",
1710 "updated": "2013-02-21 11:16:36.775000000",
1711 "mergeable": true,
1712 "insertions": 2,
1713 "deletions": 13,
1714 "_number": 3965,
1715 "owner": {
1716 "name": "John Doe"
1717 }
1718 }
1719----
1720
Changcheng Xiao6dc90422017-08-09 10:21:58 +02001721Note that this endpoint will not update the change's parents, which is
1722different from the link:#cherry-pick[cherry-pick] endpoint.
1723
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301724If the change cannot be moved because the change state doesn't
1725allow moving the change, the response is "`409 Conflict`" and
1726the error message is contained in the response body.
1727
1728.Response
1729----
1730 HTTP/1.1 409 Conflict
1731 Content-Disposition: attachment
1732 Content-Type: text/plain; charset=UTF-8
1733
1734 change is merged
1735----
1736
1737If the change cannot be moved because the user doesn't have
1738abandon permission on the change or upload permission on the destination,
1739the response is "`409 Conflict`" and the error message is contained in the
1740response body.
1741
1742.Response
1743----
1744 HTTP/1.1 409 Conflict
1745 Content-Disposition: attachment
1746 Content-Type: text/plain; charset=UTF-8
1747
1748 move not permitted
1749----
1750
Edwin Kempind2ec4152013-02-22 12:17:19 +01001751[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001752=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001753--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001754'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001755--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001756
Edwin Kempind2ec4152013-02-22 12:17:19 +01001757Reverts a change.
1758
Gal Paikin006d52b2019-12-19 11:22:09 +01001759The subject of the newly created change will be
1760'Revert "<subject-of-reverted-change>"'. If the subject of the change reverted is
1761above 63 characters, it will be cut down to 59 characters with "..." in the end.
1762
Edwin Kempind2ec4152013-02-22 12:17:19 +01001763The request body does not need to include a link:#revert-input[
1764RevertInput] entity if no review comment is added.
1765
1766.Request
1767----
Michael Zhou10270492016-03-24 22:35:40 -04001768 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0
Edwin Kempind2ec4152013-02-22 12:17:19 +01001769----
1770
1771As response a link:#change-info[ChangeInfo] entity is returned that
1772describes the reverting change.
1773
1774.Response
1775----
1776 HTTP/1.1 200 OK
1777 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001778 Content-Type: application/json; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001779
1780 )]}'
1781 {
Edwin Kempind2ec4152013-02-22 12:17:19 +01001782 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1783 "project": "myProject",
1784 "branch": "master",
1785 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1786 "subject": "Revert \"Implementing Feature X\"",
1787 "status": "NEW",
1788 "created": "2013-02-01 09:59:32.126000000",
1789 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempind2ec4152013-02-22 12:17:19 +01001790 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001791 "insertions": 6,
1792 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +01001793 "_number": 3965,
1794 "owner": {
1795 "name": "John Doe"
1796 }
1797 }
1798----
1799
Gal Paikin6c9ed952020-01-22 10:36:35 +01001800If the user doesn't have revert permission on the change or upload permission on
1801the destination branch, the response is "`403 Forbidden`", and the error message is
1802contained in the response body.
1803
Edwin Kempind2ec4152013-02-22 12:17:19 +01001804If the change cannot be reverted because the change state doesn't
Gal Paikin6c9ed952020-01-22 10:36:35 +01001805allow reverting the change the response is "`409 Conflict`", and the error
1806message is contained in the response body.
Edwin Kempind2ec4152013-02-22 12:17:19 +01001807
1808.Response
1809----
1810 HTTP/1.1 409 Conflict
1811 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001812 Content-Type: text/plain; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001813
1814 change is new
1815----
1816
Gal Paikinb81f56c2019-10-16 14:39:24 +02001817[[revert-submission]]
1818=== Revert Submission
1819--
1820'POST /changes/link:#change-id[\{change-id\}]/revert_submission'
1821--
1822
1823Creates open revert changes for all of the changes of a certain submission.
1824
Gal Paikin006d52b2019-12-19 11:22:09 +01001825The subject of each revert change will be 'Revert "<subject-of-reverted-change"'.
Gal Paikin100bf602019-12-23 14:50:41 +01001826If the subject is above 60 characters, the subject will be cut to 56 characters
1827with "..." in the end. However, whenever reverting the submission of a revert
1828submission, the subject will be shortened from
1829'Revert "Revert "<subject-of-reverted-change""' to
1830'Revert^2 "<subject-of-reverted-change"'. Also, for every future revert submission,
1831the only difference in the subject will be the number of the revert (instead of
1832Revert^2 the subject will change to Revert^3 and so on).
1833There are no guarantees about the subjects if the users change the default subjects.
Gal Paikinaffd0242019-12-18 18:10:08 +01001834
Gal Paikinb81f56c2019-10-16 14:39:24 +02001835Details for the revert can be specified in the request body inside a link:#revert-input[
1836RevertInput] The topic of all created revert changes will be
1837`revert-{submission_id}-{random_string_of_size_10}`.
1838
1839The changes will not be rebased on onto the destination branch so the users may still
1840have to manually rebase them to resolve conflicts and make them submittable.
1841
Gal Paikin653a8522019-11-25 11:40:10 +01001842However, the changes that have the same project and branch will be rebased on top
1843of each other. E.g, the first revert change will have the original change as a
1844parent, and the second revert change will have the first revert change as a
1845parent.
1846
1847There is one special case that involves merge commits; if a user has multiple
1848changes in the same project and branch, but not in the same change series, those
1849changes can still get submitted together if they have the same topic and
1850link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] in
1851gerrit.config is set to true. In the case, Gerrit may create merge commits on
1852submit (depending on the link:config-project-config.html#submit-type[submit types]
1853of the project).
1854The first parent for the reverts will be the most recent merge commit that was
1855created by Gerrit to merge the different change series into the target branch.
1856
Gal Paikinb81f56c2019-10-16 14:39:24 +02001857.Request
1858----
1859 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert_submission HTTP/1.0
1860----
1861
1862As response link:#revert-submission-info[RevertSubmissionInfo] entity
1863is returned. That entity describes the revert changes.
1864
1865.Response
1866----
1867 HTTP/1.1 200 OK
1868 Content-Disposition: attachment
1869 Content-Type: application/json; charset=UTF-8
1870
1871 )]}'
1872 "revert_changes":
1873 [
1874 {
1875 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1876 "project": "myProject",
1877 "branch": "master",
1878 "topic": "revert--1571043962462-3640749-ABCEEZGHIJ",
1879 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1880 "subject": "Revert \"Implementing Feature X\"",
1881 "status": "NEW",
1882 "created": "2013-02-01 09:59:32.126000000",
1883 "updated": "2013-02-21 11:16:36.775000000",
1884 "mergeable": true,
1885 "insertions": 6,
1886 "deletions": 4,
1887 "_number": 3965,
1888 "owner": {
1889 "name": "John Doe"
1890 }
1891 },
1892 {
1893 "id": "anyProject~master~1eee2c9d8f352483781e772f35dc586a69ff5646",
1894 "project": "anyProject",
1895 "branch": "master",
1896 "topic": "revert--1571043962462-3640749-ABCEEZGHIJ",
1897 "change_id": "I1eee2c9d8f352483781e772f35dc586a69ff5646",
1898 "subject": "Revert \"Implementing Feature Y\"",
1899 "status": "NEW",
1900 "created": "2013-02-04 09:59:33.126000000",
1901 "updated": "2013-02-21 11:16:37.775000000",
1902 "mergeable": true,
1903 "insertions": 62,
1904 "deletions": 11,
1905 "_number": 3966,
1906 "owner": {
1907 "name": "Jane Doe"
1908 }
1909 }
1910 ]
1911----
1912
Gal Paikin6c9ed952020-01-22 10:36:35 +01001913If the user doesn't have revert permission on the change or upload permission on
1914the destination, the response is "`403 Forbidden`", and the error message is
1915contained in the response body.
1916
1917If the change cannot be reverted because the change state doesn't
1918allow reverting the change the response is "`409 Conflict`", and the error
1919message is contained in the response body.
Gal Paikinb81f56c2019-10-16 14:39:24 +02001920
1921.Response
1922----
1923 HTTP/1.1 409 Conflict
1924 Content-Disposition: attachment
1925 Content-Type: text/plain; charset=UTF-8
1926
1927 change is new
1928----
1929
Edwin Kempin0eddba02013-02-22 15:30:12 +01001930[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001931=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001932--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001933'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001934--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001935
Edwin Kempin0eddba02013-02-22 15:30:12 +01001936Submits a change.
1937
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05301938If the submission results in a new patch set (due to a rebase or cherry-pick merge method), the
1939committer email will remain the same as the one used in the previous commit, provided that one of
1940the secondary emails associated with the user performing the operation was used as the committer
1941email in the previous commit. Otherwise, the user's preferred email will be used.
1942
Edwin Kempin0eddba02013-02-22 15:30:12 +01001943The request body only needs to include a link:#submit-input[
David Pursehousea8f48f82016-03-10 15:27:47 +09001944SubmitInput] entity if submitting on behalf of another user.
Edwin Kempin0eddba02013-02-22 15:30:12 +01001945
Edwin Kempinc9219002023-09-08 08:07:21 +00001946Submitting a change also removes all users from the link:user-attention-set.html[attention set].
Gal Paikinc326de42020-06-16 18:49:00 +03001947
Edwin Kempin0eddba02013-02-22 15:30:12 +01001948.Request
1949----
1950 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001951 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001952
1953 {
David Pursehousea8f48f82016-03-10 15:27:47 +09001954 "on_behalf_of": 1001439
Edwin Kempin0eddba02013-02-22 15:30:12 +01001955 }
1956----
1957
1958As response a link:#change-info[ChangeInfo] entity is returned that
1959describes the submitted/merged change.
1960
Gal Paikine2849a82021-04-19 13:41:10 +02001961Submission may submit multiple changes, but we still only return one ChangeInfo
1962object. To query for all submitted changes, please use the submission_id that is
1963part of the response.
1964
1965Changes that will also be submitted:
19661. All changes of the same topic if
1967link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1968configuration is set to true.
19692. All dependent changes.
19703. The closure of the above (e.g if a dependent change has a topic, all changes
1971of *that* topic will also be submitted).
1972
Edwin Kempin0eddba02013-02-22 15:30:12 +01001973.Response
1974----
1975 HTTP/1.1 200 OK
1976 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001977 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001978
1979 )]}'
1980 {
Edwin Kempin0eddba02013-02-22 15:30:12 +01001981 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1982 "project": "myProject",
1983 "branch": "master",
1984 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1985 "subject": "Implementing Feature X",
1986 "status": "MERGED",
1987 "created": "2013-02-01 09:59:32.126000000",
1988 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001989 "submitted": "2013-02-21 11:16:36.615000000",
Edwin Kempin0eddba02013-02-22 15:30:12 +01001990 "_number": 3965,
1991 "owner": {
1992 "name": "John Doe"
1993 }
1994 }
1995----
1996
1997If the change cannot be submitted because the submit rule doesn't allow
1998submitting the change, the response is "`409 Conflict`" and the error
1999message is contained in the response body.
2000
2001.Response
2002----
2003 HTTP/1.1 409 Conflict
2004 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002005 Content-Type: text/plain; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01002006
2007 blocked by Verified
2008----
2009
David Pursehouse025c1af2015-11-20 17:02:50 +09002010[[submitted-together]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002011=== Changes Submitted Together
Stefan Bellera7ad6612015-06-26 10:05:43 -07002012--
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002013'GET /changes/link:#change-id[\{change-id\}]/submitted_together?o=NON_VISIBLE_CHANGES'
Stefan Bellera7ad6612015-06-26 10:05:43 -07002014--
2015
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002016Computes list of all changes which are submitted when
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002017link:#submit-change[Submit] is called for this change,
Stefan Beller460f3542015-07-20 14:10:41 -07002018including the current change itself.
2019
Stefan Bellera7ad6612015-06-26 10:05:43 -07002020The list consists of:
2021
2022* The given change.
2023* If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
Gal Paikine7a208d2021-11-30 12:08:27 +01002024 is enabled OR if the `o=TOPIC_CLOSURE` query parameter is passed, include all
2025 open changes with the same topic.
Stefan Bellera7ad6612015-06-26 10:05:43 -07002026* For each change whose submit type is not CHERRY_PICK, include unmerged
2027 ancestors targeting the same branch.
2028
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002029As a special case, the list is empty if this change would be
2030submitted by itself (without other changes).
2031
2032.Request
2033----
2034 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0
2035 Content-Type: application/json; charset=UTF-8
2036----
2037
2038As a response a link:#submitted-together-info[SubmittedTogetherInfo]
2039entity is returned that describes what would happen if the change were
2040submitted. This response contains a list of changes and a count of
2041changes that are not visible to the caller that are part of the set of
2042changes to be merged.
2043
2044The listed changes use the same format as in
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002045link:#list-changes[Query Changes] with the
2046link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`],
Patrick Hiesel6fbbdaa2018-04-05 15:10:13 +02002047link:#current-revision[`CURRENT_REVISION`],and
Jonathan Niedercb51d742016-09-23 11:37:57 -07002048link:#submittable[`SUBMITTABLE`] options set.
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002049
Shawn Pearce8080c3d2016-09-19 19:15:04 -07002050Standard link:#query-options[formatting options] can be specified
2051with the `o` parameter, as well as the `submitted_together` specific
Gal Paikine7a208d2021-11-30 12:08:27 +01002052options `NON_VISIBLE_CHANGES` and `TOPIC_CLOSURE`.
Shawn Pearce8080c3d2016-09-19 19:15:04 -07002053
Stefan Bellera7ad6612015-06-26 10:05:43 -07002054.Response
2055----
2056 HTTP/1.1 200 OK
2057 Content-Disposition: attachment
2058 Content-Type: application/json; charset=UTF-8
2059
2060)]}'
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002061{
2062 "changes": [
2063 {
2064 "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
2065 "project": "gerrit",
2066 "branch": "master",
2067 "hashtags": [],
2068 "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
2069 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
2070 "status": "NEW",
2071 "created": "2015-05-01 15:39:57.979000000",
2072 "updated": "2015-05-20 19:25:21.592000000",
2073 "mergeable": true,
2074 "insertions": 303,
2075 "deletions": 210,
2076 "_number": 1779,
2077 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07002078 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002079 },
2080 "labels": {
2081 "Code-Review": {
2082 "approved": {
2083 "_account_id": 1000000
2084 },
2085 "all": [
2086 {
2087 "value": 2,
2088 "date": "2015-05-20 19:25:21.592000000",
2089 "_account_id": 1000000
2090 }
2091 ],
2092 "values": {
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01002093 "-2": "This shall not be submitted",
2094 "-1": "I would prefer this is not submitted as is",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002095 " 0": "No score",
2096 "+1": "Looks good to me, but someone else must approve",
2097 "+2": "Looks good to me, approved"
2098 },
2099 "default_value": 0
2100 },
2101 "Verified": {
2102 "approved": {
2103 "_account_id": 1000000
2104 },
2105 "all": [
2106 {
2107 "value": 1,
2108 "date": "2015-05-20 19:25:21.592000000",
2109 "_account_id": 1000000
2110 }
2111 ],
2112 "values": {
2113 "-1": "Fails",
2114 " 0": "No score",
2115 "+1": "Verified"
2116 },
2117 "default_value": 0
2118 }
2119 },
2120 "permitted_labels": {
2121 "Code-Review": [
2122 "-2",
2123 "-1",
2124 " 0",
2125 "+1",
2126 "+2"
2127 ],
2128 "Verified": [
2129 "-1",
2130 " 0",
2131 "+1"
2132 ]
2133 },
2134 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08002135 {
2136 "_account_id": 1000000
2137 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002138 ],
2139 "reviewers": {
2140 "REVIEWER": [
2141 {
2142 "_account_id": 1000000
2143 }
2144 ]
2145 },
2146 "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379",
2147 "revisions": {
2148 "9adb9f4c7b40eeee0646e235de818d09164d7379": {
David Pursehouse4de41112016-06-28 09:24:08 +09002149 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002150 "_number": 1,
2151 "created": "2015-05-01 15:39:57.979000000",
2152 "uploader": {
2153 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07002154 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002155 "ref": "refs/changes/79/1779/1",
2156 "fetch": {},
Stefan Bellera7ad6612015-06-26 10:05:43 -07002157 }
2158 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07002159 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002160 {
2161 "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22",
2162 "project": "gerrit",
2163 "branch": "master",
2164 "hashtags": [],
2165 "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22",
2166 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
2167 "status": "NEW",
2168 "created": "2015-05-01 15:39:57.979000000",
2169 "updated": "2015-05-20 19:25:21.546000000",
2170 "mergeable": true,
2171 "insertions": 15,
2172 "deletions": 6,
2173 "_number": 1780,
2174 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07002175 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002176 },
2177 "labels": {
2178 "Code-Review": {
2179 "approved": {
2180 "_account_id": 1000000
2181 },
2182 "all": [
2183 {
2184 "value": 2,
2185 "date": "2015-05-20 19:25:21.546000000",
2186 "_account_id": 1000000
2187 }
2188 ],
2189 "values": {
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01002190 "-2": "This shall not be submitted",
2191 "-1": "I would prefer this is not submitted as is",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002192 " 0": "No score",
2193 "+1": "Looks good to me, but someone else must approve",
2194 "+2": "Looks good to me, approved"
2195 },
2196 "default_value": 0
2197 },
2198 "Verified": {
2199 "approved": {
2200 "_account_id": 1000000
2201 },
2202 "all": [
2203 {
2204 "value": 1,
2205 "date": "2015-05-20 19:25:21.546000000",
2206 "_account_id": 1000000
2207 }
2208 ],
2209 "values": {
2210 "-1": "Fails",
2211 " 0": "No score",
2212 "+1": "Verified"
2213 },
2214 "default_value": 0
2215 }
2216 },
2217 "permitted_labels": {
2218 "Code-Review": [
2219 "-2",
2220 "-1",
2221 " 0",
2222 "+1",
2223 "+2"
2224 ],
2225 "Verified": [
2226 "-1",
2227 " 0",
2228 "+1"
2229 ]
2230 },
2231 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08002232 {
2233 "_account_id": 1000000
2234 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002235 ],
2236 "reviewers": {
2237 "REVIEWER": [
2238 {
2239 "_account_id": 1000000
2240 }
2241 ]
2242 },
2243 "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4",
2244 "revisions": {
2245 "1bd7c12a38854a2c6de426feec28800623f492c4": {
David Pursehouse4de41112016-06-28 09:24:08 +09002246 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002247 "_number": 1,
2248 "created": "2015-05-01 15:39:57.979000000",
2249 "uploader": {
2250 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07002251 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002252 "ref": "refs/changes/80/1780/1",
2253 "fetch": {},
Stefan Bellera7ad6612015-06-26 10:05:43 -07002254 }
2255 }
2256 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002257 ],
2258 "non_visible_changes": 0
2259}
Stefan Bellera7ad6612015-06-26 10:05:43 -07002260----
2261
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002262If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then
2263instead of a link:#submitted-together-info[SubmittedTogetherInfo]
2264entity, the response is a list of changes, or a 403 response with a
2265message if the set of changes to be submitted with this change
2266includes changes the caller cannot read.
2267
Stefan Bellera7ad6612015-06-26 10:05:43 -07002268
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02002269[[delete-change]]
2270=== Delete Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002271--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002272'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002273--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002274
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02002275Deletes a change.
2276
Paladox none580ae0e2017-02-12 18:15:48 +00002277New or abandoned changes can be deleted by their owner if the user is granted
2278the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission,
2279otherwise only by administrators.
2280
David Ostrovsky0d69c232013-09-10 23:10:23 +02002281.Request
2282----
2283 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002284 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02002285----
2286
2287.Response
2288----
2289 HTTP/1.1 204 No Content
2290----
2291
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03002292[[apply-patch]]
2293=== Create patch-set from patch
2294--
2295'POST /changes/link:#change-id[\{change-id\}]/patch:apply'
2296--
2297
2298Creates a new patch set on a destination change from the provided patch.
2299
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05302300If one of the secondary emails associated with the user performing the operation was used as the
2301committer email in the current patch set, the same email will be used as the committer email in the
2302new patch set; otherwise, the user's preferred email will be used.
2303
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03002304The patch must be provided in the request body, inside a
2305link:#applypatchpatchset-input[ApplyPatchPatchSetInput] entity.
2306
2307If a base commit is given, the patch is applied on top of it. Otherwise, the
Nitzan Gur-Furman0f0b2d82023-02-22 15:31:23 +01002308patch is applied on top of the target change's original parent.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03002309
2310Applying the patch will fail if the destination change is closed, or in case of any conflicts.
2311
2312.Request
2313----
2314 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/patch:apply HTTP/1.0
2315 Content-Type: application/json; charset=UTF-8
2316
2317 {
2318 "patch": {
2319 "patch": "new file mode 100644\n--- /dev/null\n+++ b/a_new_file.txt\n@@ -0,0 +1,2 @@ \
2320+Patch compatible `git diff` output \
2321+For example: `link:#get-patch[<gerrit patch>] | base64 -d | sed -z 's/\n/\\n/g'`"
2322 }
2323 }
2324----
2325
2326As response a link:#change-info[ChangeInfo] entity is returned that
2327describes the destination change after applying the patch.
2328
2329.Response
2330----
2331 HTTP/1.1 200 OK
2332 Content-Disposition: attachment
2333 Content-Type: application/json; charset=UTF-8
2334
2335 )]}'
2336 {
2337 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
2338 "project": "myProject",
2339 "branch": "release-branch",
2340 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
2341 "subject": "Original change subject",
2342 "status": "NEW",
2343 "created": "2013-02-01 09:59:32.126000000",
2344 "updated": "2013-02-21 11:16:36.775000000",
2345 "mergeable": true,
2346 "insertions": 12,
2347 "deletions": 11,
2348 "_number": 3965,
2349 "owner": {
2350 "name": "John Doe"
2351 },
2352 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c"
2353 }
2354----
2355
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002356[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002357=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002358--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002359'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002360--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002361
2362Retrieves the branches and tags in which a change is included. As result
2363an link:#included-in-info[IncludedInInfo] entity is returned.
2364
2365.Request
2366----
2367 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
2368----
2369
2370.Response
2371----
2372 HTTP/1.1 200 OK
2373 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002374 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002375
2376 )]}'
2377 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002378 "branches": [
2379 "master"
2380 ],
2381 "tags": []
2382 }
2383----
2384
David Pursehouse4e38b972014-05-30 10:36:40 +09002385[[index-change]]
2386=== Index Change
2387--
2388'POST /changes/link:#change-id[\{change-id\}]/index'
2389--
2390
2391Adds or updates the change in the secondary index.
2392
2393.Request
2394----
2395 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
2396----
2397
2398.Response
2399----
2400 HTTP/1.1 204 No Content
2401----
2402
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002403[[list-change-comments]]
2404=== List Change Comments
2405--
2406'GET /changes/link:#change-id[\{change-id\}]/comments'
2407--
2408
2409Lists the published comments of all revisions of the change.
2410
2411Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2412entries. The entries in the map are sorted by file path, and the
2413comments for each path are sorted by patch set number. Each comment has
2414the `patch_set` and `author` fields set.
2415
Youssef Elghareeb68e87b62021-01-11 13:20:03 +01002416If the `enable-context` request parameter is set to true, the comment entries
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02002417will contain a list of link:#context-line[ContextLine] containing the lines of
2418the source file where the comment was written.
2419
Youssef Elghareeb87b74502021-02-05 18:53:05 +01002420The `context-padding` request parameter can be used to specify an extra number
2421of context lines to be added before and after the comment range. This parameter
2422only works if `enable-context` is set to true.
2423
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002424.Request
2425----
2426 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
2427----
2428
2429.Response
2430----
2431 HTTP/1.1 200 OK
2432 Content-Disposition: attachment
2433 Content-Type: application/json; charset=UTF-8
2434
2435 )]}'
2436 {
2437 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2438 {
2439 "patch_set": 1,
2440 "id": "TvcXrmjM",
2441 "line": 23,
2442 "message": "[nit] trailing whitespace",
2443 "updated": "2013-02-26 15:40:43.986000000"
2444 "author": {
2445 "_account_id": 1000096,
2446 "name": "John Doe",
2447 "email": "john.doe@example.com"
2448 }
2449 },
2450 {
2451 "patch_set": 2,
2452 "id": "TveXwFiA",
2453 "line": 49,
2454 "in_reply_to": "TfYX-Iuo",
2455 "message": "Done",
2456 "updated": "2013-02-26 15:40:45.328000000"
2457 "author": {
2458 "_account_id": 1000097,
2459 "name": "Jane Roe",
2460 "email": "jane.roe@example.com"
2461 }
2462 }
2463 ]
2464 }
2465----
2466
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002467[[list-change-robot-comments]]
2468=== List Change Robot Comments
2469--
2470'GET /changes/link:#change-id[\{change-id\}]/robotcomments'
2471--
2472
2473Lists the robot comments of all revisions of the change.
2474
2475Return a map that maps the file path to a list of
2476link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
2477map are sorted by file path.
2478
2479.Request
2480----
2481 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0
2482----
2483
2484.Response
2485----
2486 HTTP/1.1 200 OK
2487 Content-Disposition: attachment
2488 Content-Type: application/json; charset=UTF-8
2489
2490 )]}'
2491 {
2492 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2493 {
2494 "id": "TvcXrmjM",
2495 "line": 23,
2496 "message": "unused import",
2497 "updated": "2016-02-26 15:40:43.986000000",
2498 "author": {
2499 "_account_id": 1000110,
2500 "name": "Code Analyzer",
2501 "email": "code.analyzer@example.com"
2502 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09002503 "robot_id": "importChecker",
2504 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002505 },
2506 {
2507 "id": "TveXwFiA",
2508 "line": 49,
2509 "message": "wrong indention",
2510 "updated": "2016-02-26 15:40:45.328000000",
2511 "author": {
2512 "_account_id": 1000110,
2513 "name": "Code Analyzer",
2514 "email": "code.analyzer@example.com"
2515 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09002516 "robot_id": "styleChecker",
2517 "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b"
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002518 }
2519 ]
2520 }
2521----
2522
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002523[[list-change-drafts]]
2524=== List Change Drafts
2525--
2526'GET /changes/link:#change-id[\{change-id\}]/drafts'
2527--
2528
2529Lists the draft comments of all revisions of the change that belong to
2530the calling user.
2531
2532Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2533entries. The entries in the map are sorted by file path, and the
2534comments for each path are sorted by patch set number. Each comment has
2535the `patch_set` field set, and no `author`.
2536
Youssef Elghareeb59580cb2021-03-17 15:02:49 +01002537The `enable-context` and `context-padding` request parameters can be used to
2538request comment context. See link:#list-change-comments[List Change Comments]
2539for more details.
2540
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002541.Request
2542----
2543 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0
2544----
2545
2546.Response
2547----
2548 HTTP/1.1 200 OK
2549 Content-Disposition: attachment
2550 Content-Type: application/json; charset=UTF-8
2551
2552 )]}'
2553 {
2554 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2555 {
2556 "patch_set": 1,
2557 "id": "TvcXrmjM",
2558 "line": 23,
2559 "message": "[nit] trailing whitespace",
2560 "updated": "2013-02-26 15:40:43.986000000"
2561 },
2562 {
2563 "patch_set": 2,
2564 "id": "TveXwFiA",
2565 "line": 49,
2566 "in_reply_to": "TfYX-Iuo",
2567 "message": "Done",
2568 "updated": "2013-02-26 15:40:45.328000000"
2569 }
2570 ]
2571 }
2572----
2573
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002574[[check-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002575=== Check Change
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002576--
2577'GET /changes/link:#change-id[\{change-id\}]/check'
2578--
2579
2580Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05002581link:#change-info[ChangeInfo] entity with the `problems` field set to a
2582list of link:#problem-info[ProblemInfo] entities.
2583
2584Depending on the type of problem, some fields not marked optional may be
2585missing from the result. At least `id`, `project`, `branch`, and
2586`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002587
2588.Request
2589----
2590 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2591----
2592
2593.Response
2594----
2595 HTTP/1.1 200 OK
2596 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002597 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002598
2599 )]}'
2600 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05002601 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2602 "project": "myProject",
2603 "branch": "master",
2604 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2605 "subject": "Implementing Feature X",
2606 "status": "NEW",
2607 "created": "2013-02-01 09:59:32.126000000",
2608 "updated": "2013-02-21 11:16:36.775000000",
2609 "mergeable": true,
2610 "insertions": 34,
2611 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05002612 "_number": 3965,
2613 "owner": {
2614 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002615 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05002616 "problems": [
2617 {
2618 "message": "Current patch set 1 not found"
2619 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002620 ]
2621 }
2622----
2623
Dave Borowitz3be39d02014-12-03 17:57:38 -08002624[[fix-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002625=== Fix Change
Dave Borowitz3be39d02014-12-03 17:57:38 -08002626--
2627'POST /changes/link:#change-id[\{change-id\}]/check'
2628--
2629
2630Performs consistency checks on the change as with link:#check-change[GET
2631/check], and additionally fixes any problems that can be fixed
2632automatically. The returned field values reflect any fixes.
2633
Dave Borowitzbad53ee2015-06-11 10:10:18 -04002634Some fixes have options controlling their behavior, which can be set in the
2635link:#fix-input[FixInput] entity body.
2636
Dave Borowitz3be39d02014-12-03 17:57:38 -08002637Only the change owner, a project owner, or an administrator may fix changes.
2638
2639.Request
2640----
2641 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2642----
2643
2644.Response
2645----
2646 HTTP/1.1 200 OK
2647 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002648 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08002649
2650 )]}'
2651 {
2652 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2653 "project": "myProject",
2654 "branch": "master",
2655 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2656 "subject": "Implementing Feature X",
2657 "status": "MERGED",
2658 "created": "2013-02-01 09:59:32.126000000",
2659 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08002660 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08002661 "mergeable": true,
2662 "insertions": 34,
2663 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08002664 "_number": 3965,
2665 "owner": {
2666 "name": "John Doe"
2667 },
2668 "problems": [
2669 {
2670 "message": "Current patch set 2 not found"
2671 },
2672 {
2673 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
2674 "status": FIXED,
2675 "outcome": "Marked change as merged"
2676 }
2677 ]
2678 }
2679----
2680
Alan Tokaev392cfca2017-04-28 11:11:31 +02002681[[set-work-in-pogress]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002682=== Set Work-In-Progress
Alan Tokaev392cfca2017-04-28 11:11:31 +02002683--
2684'POST /changes/link:#change-id[\{change-id\}]/wip'
2685--
2686
David Ostrovsky44242452018-06-09 20:25:13 +02002687Marks the change as not ready for review yet. Changes may only be marked not
2688ready by the owner, project owners or site administrators.
Alan Tokaev392cfca2017-04-28 11:11:31 +02002689
2690The request body does not need to include a
2691link:#work-in-progress-input[WorkInProgressInput] entity if no review comment
2692is added. Actions that create a new patch set in a WIP change default to
2693notifying *OWNER* instead of *ALL*.
2694
Gal Paikinc326de42020-06-16 18:49:00 +03002695Marking a change work in progress also removes all users from the
Edwin Kempinc9219002023-09-08 08:07:21 +00002696link:user-attention-set.html[attention set].
Gal Paikinc326de42020-06-16 18:49:00 +03002697
Alan Tokaev392cfca2017-04-28 11:11:31 +02002698.Request
2699----
2700 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0
2701 Content-Type: application/json; charset=UTF-8
2702
2703 {
2704 "message": "Refactoring needs to be done before we can proceed here."
2705 }
2706----
2707
2708.Response
2709----
2710 HTTP/1.1 200 OK
2711----
2712
2713[[set-ready-for-review]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002714=== Set Ready-For-Review
Alan Tokaev392cfca2017-04-28 11:11:31 +02002715--
2716'POST /changes/link:#change-id[\{change-id\}]/ready'
2717--
2718
David Ostrovsky44242452018-06-09 20:25:13 +02002719Marks the change as ready for review (set WIP property to false). Changes may
2720only be marked ready by the owner, project owners or site administrators.
Alan Tokaev392cfca2017-04-28 11:11:31 +02002721
2722Activates notifications of reviewer. The request body does not need
2723to include a link:#work-in-progress-input[WorkInProgressInput] entity
2724if no review comment is added.
2725
Gal Paikinc326de42020-06-16 18:49:00 +03002726Marking a change ready for review also adds all of the reviewers of the change
Edwin Kempinc9219002023-09-08 08:07:21 +00002727to the link:user-attention-set.html[attention set].
Gal Paikinc326de42020-06-16 18:49:00 +03002728
Alan Tokaev392cfca2017-04-28 11:11:31 +02002729.Request
2730----
2731 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0
2732 Content-Type: application/json;charset=UTF-8
2733
2734 {
2735 "message": "Refactoring is done."
2736 }
2737
2738----
2739
2740.Response
2741----
2742 HTTP/1.1 200 OK
2743----
2744
David Pursehouse7c5c3a52017-04-10 11:37:23 +09002745[[mark-private]]
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002746=== Mark Private
2747--
Edwin Kempin364a86b2017-04-27 12:34:00 +02002748'POST /changes/link:#change-id[\{change-id\}]/private'
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002749--
2750
Patrick Hiesel707e61a2019-02-13 18:28:48 +01002751Marks the change to be private. Only open changes can be marked private.
2752Changes may only be marked private by the owner or site administrators.
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002753
Edwin Kempin364a86b2017-04-27 12:34:00 +02002754A message can be specified in the request body inside a
2755link:#private-input[PrivateInput] entity.
2756
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002757.Request
2758----
Edwin Kempin364a86b2017-04-27 12:34:00 +02002759 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2760 Content-Type: application/json; charset=UTF-8
2761
2762 {
2763 "message": "After this security fix has been released we can make it public now."
2764 }
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002765----
2766
2767.Response
2768----
2769 HTTP/1.1 201 Created
2770----
2771
2772If the change was already private the response is "`200 OK`".
2773
2774[[unmark-private]]
2775=== Unmark Private
2776--
2777'DELETE /changes/link:#change-id[\{change-id\}]/private'
2778--
2779
2780Marks the change to be non-private. Note users can only unmark own private
2781changes.
2782
2783.Request
2784----
2785 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2786----
2787
2788.Response
2789----
2790 HTTP/1.1 204 No Content
2791----
2792
2793If the change was already not private, the response is "`409 Conflict`".
2794
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02002795A message can be specified in the request body inside a
2796link:#private-input[PrivateInput] entity. Historically, this method allowed
2797a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01002798link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02002799In this case, use a POST request instead:
Edwin Kempin364a86b2017-04-27 12:34:00 +02002800
2801.Request
2802----
2803 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0
2804 Content-Type: application/json; charset=UTF-8
2805
2806 {
2807 "message": "This is a security fix that must not be public."
2808 }
2809----
2810
David Pursehouse7c79b682017-08-25 13:18:32 +09002811[[get-hashtags]]
2812=== Get Hashtags
2813--
2814'GET /changes/link:#change-id[\{change-id\}]/hashtags'
2815--
2816
2817Gets the hashtags associated with a change.
2818
David Pursehouse7c79b682017-08-25 13:18:32 +09002819.Request
2820----
2821 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2822----
2823
2824As response the change's hashtags are returned as a list of strings.
2825
2826.Response
2827----
2828 HTTP/1.1 200 OK
2829 Content-Disposition: attachment
2830 Content-Type: application/json; charset=UTF-8
2831
2832 )]}'
2833 [
2834 "hashtag1",
2835 "hashtag2"
2836 ]
2837----
2838
2839[[set-hashtags]]
2840=== Set Hashtags
2841--
2842'POST /changes/link:#change-id[\{change-id\}]/hashtags'
2843--
2844
2845Adds and/or removes hashtags from a change.
2846
David Pursehouse7c79b682017-08-25 13:18:32 +09002847The hashtags to add or remove must be provided in the request body inside a
2848link:#hashtags-input[HashtagsInput] entity.
2849
2850.Request
2851----
2852 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2853 Content-Type: application/json; charset=UTF-8
2854
2855 {
2856 "add" : [
2857 "hashtag3"
2858 ],
2859 "remove" : [
2860 "hashtag2"
2861 ]
2862 }
2863----
2864
2865As response the change's hashtags are returned as a list of strings.
2866
2867.Response
2868----
2869 HTTP/1.1 200 OK
2870 Content-Disposition: attachment
2871 Content-Type: application/json; charset=UTF-8
2872
2873 )]}'
2874 [
2875 "hashtag1",
2876 "hashtag3"
2877 ]
2878----
2879
Chris Poucetf5e68292023-04-03 16:21:39 +02002880[[get-custom-keyed-values]]
2881=== Get Custom Keyed Values
2882--
Brian Egizic130e662023-08-14 21:58:17 +00002883'GET /changes/link:#change-id[\{change-id\}]/custom_keyed_values'
Chris Poucetf5e68292023-04-03 16:21:39 +02002884--
2885
2886Gets the custom keyed values associated with a change.
2887
2888.Request
2889----
Brian Egizic130e662023-08-14 21:58:17 +00002890 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/custom_keyed_values HTTP/1.0
Chris Poucetf5e68292023-04-03 16:21:39 +02002891----
2892
2893As response the change's custom keyed values are returned as a map of strings.
2894
2895.Response
2896----
2897 HTTP/1.1 200 OK
2898 Content-Disposition: attachment
2899 Content-Type: application/json; charset=UTF-8
2900
2901 )]}'
2902 {
2903 "key1": "value1",
2904 "key2": "value2"
2905 }
2906----
2907
2908[[set-custom-keyed-values]]
2909=== Set Custom Keyed Values
2910--
Brian Egizic130e662023-08-14 21:58:17 +00002911'POST /changes/link:#change-id[\{change-id\}]/custom_keyed_values'
Chris Poucetf5e68292023-04-03 16:21:39 +02002912--
2913
2914Adds and/or removes custom keyed values from a change.
2915
2916The custom keyed values to add or remove must be provided in the request body
2917inside a link:#custom-keyed-values-input[CustomKeyedValuesInput] entity.
2918
Chris Poucet5cfec342023-08-22 08:56:39 +02002919Note that custom keyed values are expected to be small in both key and value.
2920A typical use-case would be storing the ID to some external system, in which
2921case the key would be something unique to that system and the value would be
2922the ID.
2923
Chris Poucetf5e68292023-04-03 16:21:39 +02002924.Request
2925----
Brian Egizic130e662023-08-14 21:58:17 +00002926 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/custom_keyed_values HTTP/1.0
Chris Poucetf5e68292023-04-03 16:21:39 +02002927 Content-Type: application/json; charset=UTF-8
2928
2929 {
2930 "add" : {
2931 "key1": "value1"
2932 },
2933 "remove" : [
2934 "key2"
2935 ]
2936 }
2937----
2938
2939As response the change's custom keyed values are returned as a map of strings to strings.
2940
2941.Response
2942----
2943 HTTP/1.1 200 OK
2944 Content-Disposition: attachment
2945 Content-Type: application/json; charset=UTF-8
2946
2947 )]}'
2948 {
2949 "key1": "value1",
2950 "key3": "value3"
2951 }
2952----
2953
2954
Changcheng Xiao7fb73292018-04-25 11:43:19 +02002955[[list-change-messages]]
2956=== List Change Messages
2957--
2958'GET /changes/link:#change-id[\{change-id\}]/messages'
2959--
2960
2961Lists all the messages of a change including link:#detailed-accounts[detailed account information].
2962
2963.Request
2964----
2965 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages
2966----
2967
2968As response a list of link:#change-message-info[ChangeMessageInfo] entities is returned.
2969
2970.Response
2971----
2972 HTTP/1.1 200 OK
2973 Content-Disposition: attachment
2974 Content-Type: application/json; charset=UTF-8
2975
2976 )]}'
2977 [
2978 {
2979 "id": "YH-egE",
2980 "author": {
2981 "_account_id": 1000096,
2982 "name": "John Doe",
2983 "email": "john.doe@example.com",
2984 "username": "jdoe"
2985 },
2986 "date": "2013-03-23 21:34:02.419000000",
2987 "message": "Patch Set 1:\n\nThis is the first message.",
2988 "_revision_number": 1
2989 },
2990 {
2991 "id": "WEEdhU",
2992 "author": {
2993 "_account_id": 1000097,
2994 "name": "Jane Roe",
2995 "email": "jane.roe@example.com",
2996 "username": "jroe"
2997 },
2998 "date": "2013-03-23 21:36:52.332000000",
2999 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
3000 "_revision_number": 1
3001 }
3002 ]
3003----
David Pursehousec32050d2017-08-25 16:27:47 +09003004
Changcheng Xiaod61590f2018-04-30 10:59:14 +02003005[[get-change-message]]
3006=== Get Change Message
3007
3008Retrieves a change message including link:#detailed-accounts[detailed account information].
3009
3010--
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07003011'GET /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]'
Changcheng Xiaod61590f2018-04-30 10:59:14 +02003012--
3013
3014As response a link:#change-message-info[ChangeMessageInfo] entity is returned.
3015
3016.Response
3017----
3018 HTTP/1.1 200 OK
3019 Content-Disposition: attachment
3020 Content-Type: application/json; charset=UTF-8
3021
3022 )]}'
3023 {
3024 "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780",
3025 "author": {
3026 "_account_id": 1000096,
3027 "name": "John Doe",
3028 "email": "john.doe@example.com",
3029 "username": "jdoe"
3030 },
3031 "date": "2013-03-23 21:34:02.419000000",
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02003032 "message": "a change message",
3033 "_revision_number": 1
3034 }
3035----
3036
3037[[delete-change-message]]
3038=== Delete Change Message
3039--
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07003040'DELETE /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]' +
3041'POST /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]/delete'
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02003042--
3043
3044Deletes a change message by replacing the change message with a new message,
3045which contains the name of the user who deleted the change message and the
3046reason why it was deleted. The reason can be provided in the request body as a
3047link:#delete-change-message-input[DeleteChangeMessageInput] entity.
3048
3049Note that only users with the
3050link:access-control.html#capability_administrateServer[Administrate Server]
3051global capability are permitted to delete a change message.
3052
3053To delete a change message, send a DELETE request:
3054
3055.Request
3056----
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07003057 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780 HTTP/1.0
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02003058----
3059
3060To provide a reason for the deletion, use a POST request:
3061
3062.Request
3063----
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07003064 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780/delete HTTP/1.0
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02003065 Content-Type: application/json; charset=UTF-8
3066
3067 {
3068 "reason": "spam"
3069 }
3070----
3071
3072As response a link:#change-message-info[ChangeMessageInfo] entity is returned that
3073describes the updated change message.
3074
3075.Response
3076----
3077 HTTP/1.1 200 OK
3078 Content-Disposition: attachment
3079 Content-Type: application/json; charset=UTF-8
3080
3081 )]}'
3082 {
3083 "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780",
3084 "author": {
3085 "_account_id": 1000096,
3086 "name": "John Doe",
3087 "email": "john.doe@example.com",
3088 "username": "jdoe"
3089 },
3090 "date": "2013-03-23 21:34:02.419000000",
3091 "message": "Change message removed by: Administrator\nReason: spam",
Changcheng Xiaod61590f2018-04-30 10:59:14 +02003092 "_revision_number": 1
3093 }
3094----
Gustaf Lundhe8647c62017-04-28 06:51:26 +02003095
Youssef Elghareebd5986932021-10-15 11:45:23 +02003096[[check-submit-requirement]]
3097=== Check Submit Requirement
3098--
3099'POST /changes/link:#change-id[\{change-id\}]/check.submit_requirement'
3100--
3101
3102Tests a submit requirement and returns the result as a
Youssef Elghareeb1a24df62022-06-24 17:52:28 +02003103link:#submit-requirement-result-info[SubmitRequirementResultInfo].
3104
3105The submit requirement can be specified in one of the following ways:
3106
3107 * In the request body as a link:#submit-requirement-input[SubmitRequirementInput].
3108 * By passing the two request parameters `sr-name` and
3109 `refs-config-change-id`. The submit requirement will then be loaded from
3110 the project config pointed to by the latest patchset of this change ID.
3111 The `sr-name` should point to an existing submit-requirement and the
3112 `refs-config-change-id` must be a valid change identifier for a change in the
3113 refs/meta/config branch, otherwise the request would fail with
3114 `400 Bad Request`.
Youssef Elghareebd5986932021-10-15 11:45:23 +02003115
3116Note that this endpoint does not modify the change resource.
3117
3118.Request
3119----
3120 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check.submit_requirement HTTP/1.0
3121 Content-Type: application/json; charset=UTF-8
3122
3123 {
3124 "name": "Code-Review",
3125 "submittability_expression": "label:Code-Review=+2"
3126 }
3127----
3128
3129As response a link:#submit-requirement-result-info[SubmitRequirementResultInfo]
3130entity is returned that describes the submit requirement result.
3131
3132.Response
3133----
3134 HTTP/1.1 200 OK
3135 Content-Disposition: attachment
3136 Content-Type: application/json; charset=UTF-8
3137
3138 )]}'
3139 {
3140 "name": "Code-Review",
3141 "status": "SATISFIED",
3142 "submittability_expression_result": {
3143 "expression": "label:Code-Review=+2",
3144 "fulfilled": true,
3145 "passingAtoms": [
3146 "label:Code-Review=+2"
3147 ]
3148 },
3149 "is_legacy": false
3150 }
3151----
3152
David Ostrovsky1a49f622014-07-29 00:40:02 +02003153[[edit-endpoints]]
3154== Change Edit Endpoints
3155
David Ostrovsky1a49f622014-07-29 00:40:02 +02003156[[get-edit-detail]]
3157=== Get Change Edit Details
3158--
3159'GET /changes/link:#change-id[\{change-id\}]/edit
3160--
3161
Nitzan Gur-Furmancbf9a8f2023-03-08 13:21:18 +01003162Retrieves the details of the change edit done by the caller to the given change.
David Ostrovsky1a49f622014-07-29 00:40:02 +02003163
3164.Request
3165----
3166 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
3167----
3168
3169As response an link:#edit-info[EditInfo] entity is returned that
3170describes the change edit, or "`204 No Content`" when change edit doesn't
3171exist for this change. Change edits are stored on special branches and there
3172can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02003173When request parameter `list` is provided the response also includes the file
3174list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02003175against this base revision. When request parameter `download-commands` is
3176provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02003177
3178.Response
3179----
3180 HTTP/1.1 200 OK
3181 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003182 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02003183
3184 )]}'
3185 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01003186 "commit": {
3187 "parents": [
David Ostrovsky1a49f622014-07-29 00:40:02 +02003188 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01003189 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
David Ostrovsky1a49f622014-07-29 00:40:02 +02003190 }
3191 ],
Edwin Kempine813c5a2019-03-13 09:51:12 +01003192 "author": {
3193 "name": "Shawn O. Pearce",
3194 "email": "sop@google.com",
3195 "date": "2012-04-24 18:08:08.000000000",
3196 "tz": -420
David Ostrovsky1a49f622014-07-29 00:40:02 +02003197 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01003198 "committer": {
3199 "name": "Shawn O. Pearce",
3200 "email": "sop@google.com",
3201 "date": "2012-04-24 18:08:08.000000000",
3202 "tz": -420
David Ostrovsky1a49f622014-07-29 00:40:02 +02003203 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01003204 "subject": "Use an EventBus to manage star icons",
3205 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
David Ostrovsky1a49f622014-07-29 00:40:02 +02003206 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01003207 "base_patch_set_number": 1,
3208 "base_revision": "c35558e0925e6985c91f3a16921537d5e572b7a3",
3209 "ref": "refs/users/01/1000001/edit-76482/1"
David Ostrovsky1a49f622014-07-29 00:40:02 +02003210 }
3211----
David Pursehouse4e38b972014-05-30 10:36:40 +09003212
David Ostrovskya5ab8292014-08-01 02:11:39 +02003213[[put-edit-file]]
3214=== Change file content in Change Edit
3215--
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05303216'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
David Ostrovskya5ab8292014-08-01 02:11:39 +02003217--
3218
3219Put content of a file to a change edit.
3220
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05303221If one of the secondary emails associated with the user performing the operation was used as the
3222committer email in the latest patch set, the same email will be used as the committer email in the
3223new change edit commit; otherwise, the user's preferred email will be used.
3224
David Ostrovskya5ab8292014-08-01 02:11:39 +02003225.Request
3226----
3227 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3228----
3229
Paladox none28920b42020-02-22 19:28:21 +00003230To upload a file as binary data in the request body:
3231
3232.Request
3233----
3234 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3235 Content-Type: application/json; charset=UTF-8
3236
3237 {
jtrinh4ca10412022-10-04 10:05:34 -07003238 "binary_content": "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==",
3239 "file_mode": 100755
Paladox none28920b42020-02-22 19:28:21 +00003240 }
3241----
3242
3243Note that it must be base-64 encoded data uri.
3244
jtrinh4ca10412022-10-04 10:05:34 -07003245The "file_mode" field is optional, and if provided must be in octal format. The field
3246indicates whether the file is executable or not and has a value of either 100755
3247(executable) or 100644 (not executable). If it's unset, this indicates no change
3248has been made. New files default to not being executable if this parameter is not
3249provided
3250
David Ostrovskya5ab8292014-08-01 02:11:39 +02003251When change edit doesn't exist for this change yet it is created. When file
3252content isn't provided, it is wiped out for that file. As response
3253"`204 No Content`" is returned.
3254
3255.Response
3256----
3257 HTTP/1.1 204 No Content
3258----
3259
Gal Paikin68d217b2019-10-07 21:01:22 +02003260When the change edit is a no-op, for example when providing the same file
3261content that the file already has, '409 no changes were made' is returned.
3262
3263.Response
3264----
3265 HTTP/1.1 409 no changes were made
3266----
3267
David Ostrovsky138edb42014-08-15 21:31:43 +02003268[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01003269=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02003270--
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05303271'POST /changes/link:#change-id[\{change-id\}]/edit'
David Ostrovsky138edb42014-08-15 21:31:43 +02003272--
3273
David Ostrovskya00c9532015-01-21 00:17:49 +01003274Creates empty change edit, restores file content or renames files in change
3275edit. The request body needs to include a
3276link:#change-edit-input[ChangeEditInput] entity when a file within change
3277edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02003278
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05303279If one of the secondary emails associated with the user performing the operation was used as the
3280committer email in the latest patch set, the same email will be used as the committer email in the
3281new change edit commit; otherwise, the user's preferred email will be used.
3282
David Ostrovsky138edb42014-08-15 21:31:43 +02003283.Request
3284----
3285 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003286 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02003287
3288 {
David Ostrovskybd12e172014-08-21 23:08:15 +02003289 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02003290 }
3291----
3292
David Ostrovskya00c9532015-01-21 00:17:49 +01003293or for rename:
3294
3295.Request
3296----
3297 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
3298 Content-Type: application/json; charset=UTF-8
3299
3300 {
3301 "old_path": "foo",
3302 "new_path": "bar"
3303 }
3304----
3305
David Ostrovsky138edb42014-08-15 21:31:43 +02003306When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01003307and restore flag are provided in request body, this file is restored. When
3308old and new file names are provided, the file is renamed. As response
3309"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02003310
3311.Response
3312----
3313 HTTP/1.1 204 No Content
3314----
3315
David Ostrovskyc967e152014-10-24 17:36:16 +02003316[[put-change-edit-message]]
3317=== Change commit message in Change Edit
3318--
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05303319'PUT /changes/link:#change-id[\{change-id\}]/edit:message'
David Ostrovskyc967e152014-10-24 17:36:16 +02003320--
3321
3322Modify commit message. The request body needs to include a
3323link:#change-edit-message-input[ChangeEditMessageInput]
3324entity.
3325
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05303326If one of the secondary emails associated with the user performing the operation was used as the
3327committer email in the latest patch set, the same email will be used as the committer email in the
3328new change edit commit; otherwise, the user's preferred email will be used.
3329
David Ostrovskyc967e152014-10-24 17:36:16 +02003330.Request
3331----
3332 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003333 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02003334
3335 {
3336 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
3337 }
3338----
3339
3340If a change edit doesn't exist for this change yet, it is created. As
3341response "`204 No Content`" is returned.
3342
3343.Response
3344----
3345 HTTP/1.1 204 No Content
3346----
3347
David Ostrovsky2830c292014-08-01 02:24:31 +02003348[[delete-edit-file]]
3349=== Delete file in Change Edit
3350--
3351'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
3352--
3353
3354Deletes a file from a change edit. This deletes the file from the repository
3355completely. This is not the same as reverting or restoring a file to its
3356previous contents.
3357
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05303358If one of the secondary emails associated with the user performing the operation was used as the
3359committer email in the latest patch set, the same email will be used as the committer email in the
3360new change edit commit; otherwise, the user's preferred email will be used.
3361
David Ostrovsky2830c292014-08-01 02:24:31 +02003362.Request
3363----
3364 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3365----
3366
3367When change edit doesn't exist for this change yet it is created.
3368
3369.Response
3370----
3371 HTTP/1.1 204 No Content
3372----
3373
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003374[[get-edit-file]]
3375=== Retrieve file content from Change Edit
3376--
3377'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
3378--
3379
3380Retrieves content of a file from a change edit.
3381
3382.Request
3383----
3384 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3385----
3386
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05003387The content of the file is returned as text encoded inside base64.
3388The Content-Type header will always be `text/plain` reflecting the
3389outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
3390can be examined to find the server detected content type of the file.
3391
3392When the specified file was deleted in the change edit
3393"`204 No Content`" is returned.
3394
3395If only the content type is required, callers should use HEAD to
3396avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003397
Michael Zhou551ad0c2016-04-26 01:21:42 -04003398If the `base` parameter is set to true, the returned content is from the
3399revision that the edit is based on.
3400
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003401.Response
3402----
3403 HTTP/1.1 200 OK
3404 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003405 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003406 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05003407 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003408
3409 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
3410----
3411
David Ostrovskyd0078672015-02-06 21:51:04 +01003412Alternatively, if the only value of the Accept request header is
3413`application/json` the content is returned as JSON string and
3414`X-FYI-Content-Encoding` is set to `json`.
3415
David Ostrovsky9ea9c112015-01-25 00:12:38 +01003416[[get-edit-meta-data]]
3417=== Retrieve meta data of a file from Change Edit
3418--
3419'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
3420--
3421
3422Retrieves meta data of a file from a change edit. Currently only
3423web links are returned.
3424
3425.Request
3426----
3427 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
3428----
3429
3430This REST endpoint retrieves additional information for a file in a
3431change edit. As result an link:#edit-file-info[EditFileInfo] entity is
3432returned.
3433
3434.Response
3435----
3436 HTTP/1.1 200 OK
3437 Content-Disposition: attachment
3438 Content-Type: application/json; charset=UTF-8
3439
3440 )]}'
3441 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01003442 "web_links": [
David Ostrovsky9ea9c112015-01-25 00:12:38 +01003443 {
3444 "show_on_side_by_side_diff_view": true,
3445 "name": "side-by-side preview diff",
3446 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
3447 "url": "#/x/xdocs/c/42/1..0/README.md",
3448 "target": "_self"
3449 },
3450 {
3451 "show_on_unified_diff_view": true,
3452 "name": "unified preview diff",
3453 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
3454 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
3455 "target": "_self"
3456 }
3457 ]}
3458----
3459
David Ostrovsky3d2c0702014-10-28 23:44:27 +01003460[[get-edit-message]]
3461=== Retrieve commit message from Change Edit or current patch set of the change
3462--
3463'GET /changes/link:#change-id[\{change-id\}]/edit:message
3464--
3465
David Ostrovsky25ad15e2014-12-15 21:18:59 +01003466Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01003467
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02003468If the `base` parameter is set to true, the returned message is from the
3469revision that the edit is based on.
3470
David Ostrovsky3d2c0702014-10-28 23:44:27 +01003471.Request
3472----
3473 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
3474----
3475
3476The commit message is returned as base64 encoded string.
3477
3478.Response
3479----
3480 HTTP/1.1 200 OK
3481
3482 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
3483M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
3484----
3485
David Ostrovskyd0078672015-02-06 21:51:04 +01003486Alternatively, if the only value of the Accept request header is
3487`application/json` the commit message is returned as JSON string:
3488
3489.Response
3490----
3491 HTTP/1.1 200 OK
3492
3493)]}'
3494"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
3495----
3496
3497
David Ostrovskye9988f92014-08-01 09:56:34 +02003498[[publish-edit]]
3499=== Publish Change Edit
3500--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003501'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02003502--
3503
3504Promotes change edit to a regular patch set.
3505
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02003506Options can be provided in the request body as a
3507link:#publish-change-edit-input[PublishChangeEditInput] entity.
3508
David Ostrovskye9988f92014-08-01 09:56:34 +02003509.Request
3510----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003511 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02003512 Content-Type: application/json; charset=UTF-8
3513
3514 {
3515 "notify": "NONE"
3516 }
David Ostrovskye9988f92014-08-01 09:56:34 +02003517----
3518
3519As response "`204 No Content`" is returned.
3520
3521.Response
3522----
3523 HTTP/1.1 204 No Content
3524----
3525
David Ostrovsky46999d22014-08-16 02:19:13 +02003526[[rebase-edit]]
3527=== Rebase Change Edit
3528--
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05303529'POST /changes/link:#change-id[\{change-id\}]/edit:rebase'
David Ostrovsky46999d22014-08-16 02:19:13 +02003530--
3531
3532Rebases change edit on top of latest patch set.
3533
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05303534If one of the secondary emails associated with the user performing the operation was used as the
3535committer email in the latest patch set, the same email will be used as the committer email in the
3536new change edit commit; otherwise, the user's preferred email will be used.
3537
David Ostrovsky46999d22014-08-16 02:19:13 +02003538.Request
3539----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003540 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02003541----
3542
3543When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09003544"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02003545based on top of the latest patch set, the response
3546"`409 Conflict`" is returned.
3547
3548.Response
3549----
3550 HTTP/1.1 204 No Content
3551----
3552
David Ostrovsky8e75f502014-08-10 00:36:31 +02003553[[delete-edit]]
3554=== Delete Change Edit
3555--
3556'DELETE /changes/link:#change-id[\{change-id\}]/edit'
3557--
3558
3559Deletes change edit.
3560
3561.Request
3562----
3563 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
3564----
3565
3566As response "`204 No Content`" is returned.
3567
3568.Response
3569----
3570 HTTP/1.1 204 No Content
3571----
3572
Edwin Kempin9a9f1c02017-01-02 15:10:49 +01003573
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003574[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003575== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003576
3577[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003578=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003579--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003580'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003581--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003582
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003583Lists the reviewers of a change.
3584
3585As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
3586
3587.Request
3588----
3589 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0
3590----
3591
3592.Response
3593----
3594 HTTP/1.1 200 OK
3595 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003596 Content-Type: application/json; charset=UTF-8
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003597
3598 )]}'
3599 [
3600 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003601 "approvals": {
3602 "Verified": "+1",
3603 "Code-Review": "+2"
3604 },
3605 "_account_id": 1000096,
3606 "name": "John Doe",
3607 "email": "john.doe@example.com"
3608 },
3609 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003610 "approvals": {
3611 "Verified": " 0",
3612 "Code-Review": "-1"
3613 },
3614 "_account_id": 1000097,
3615 "name": "Jane Roe",
3616 "email": "jane.roe@example.com"
3617 }
3618 ]
3619----
3620
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003621[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003622=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003623--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003624'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003625--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003626
3627Suggest the reviewers for a given query `q` and result limit `n`. If result
3628limit is not passed, then the default 10 is used.
3629
Edwin Kempin2639eaa2019-08-27 09:47:27 +02003630This REST endpoint only suggests accounts that
3631
3632* are active
3633* can see the change
3634* are visible to the calling user
3635* are not already reviewer on the change
3636* don't own the change
Edwin Kempinad55dde2021-09-28 11:30:55 +02003637* are not service users (unless
3638 link:config.html#suggest.skipServiceUsers[skipServiceUsers] is set to `false`)
Edwin Kempin2639eaa2019-08-27 09:47:27 +02003639
Edwin Kempinec02a552019-08-27 09:30:15 +02003640Groups can be excluded from the results by specifying the 'exclude-groups'
3641request parameter:
3642
3643--
3644'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5&exclude-groups'
3645--
Patrick Hieselc79ae0e2017-06-28 14:50:53 +02003646
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003647As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
3648
3649.Request
3650----
3651 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J 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
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003659
3660 )]}'
3661 [
3662 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003663 "account": {
3664 "_account_id": 1000097,
3665 "name": "Jane Roe",
3666 "email": "jane.roe@example.com"
Logan Hanksab3c81e2016-07-20 15:42:52 -07003667 },
3668 "count": 1
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003669 },
3670 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003671 "group": {
3672 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
3673 "name": "Joiner"
Logan Hanksab3c81e2016-07-20 15:42:52 -07003674 },
3675 "count": 5
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003676 }
3677 ]
3678----
3679
Edwin Kempin0ca3f722019-08-27 09:43:31 +02003680To suggest CCs `reviewer-state=CC` can be specified as additional URL
3681parameter. This includes existing reviewers in the result, but excludes
3682existing CCs.
3683
3684--
3685'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&reviewer-state=CC'
3686--
3687
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003688[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003689=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003690--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003691'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 -08003692--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003693
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003694Retrieves a reviewer of a change.
3695
3696As response a link:#reviewer-info[ReviewerInfo] entity is returned that
3697describes the reviewer.
3698
3699.Request
3700----
3701 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
3702----
3703
3704.Response
3705----
3706 HTTP/1.1 200 OK
3707 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003708 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003709
3710 )]}'
3711 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003712 "approvals": {
3713 "Verified": "+1",
3714 "Code-Review": "+2"
3715 },
3716 "_account_id": 1000096,
3717 "name": "John Doe",
3718 "email": "john.doe@example.com"
3719 }
3720----
3721
Edwin Kempin392328e2013-02-25 12:50:03 +01003722[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003723=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003724--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003725'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003726--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003727
Edwin Kempin392328e2013-02-25 12:50:03 +01003728Adds one user or all members of one group as reviewer to the change.
3729
3730The reviewer to be added to the change must be provided in the request
3731body as a link:#reviewer-input[ReviewerInput] entity.
3732
Edwin Kempinf9f19412019-08-28 09:28:51 +02003733Users can be moved from reviewer to CC and vice versa. This means if a
3734user is added as CC that is already a reviewer on the change, the
3735reviewer state of that user is updated to CC. If a user that is already
3736a CC on the change is added as reviewer, the reviewer state of that
3737user is updated to reviewer.
3738
Gal Paikinc326de42020-06-16 18:49:00 +03003739Adding a new reviewer also adds that reviewer to the attention set, unless
3740the change is work in progress.
3741Also, moving a reviewer to CC removes that user from the attention set.
3742
Edwin Kempin392328e2013-02-25 12:50:03 +01003743.Request
3744----
3745 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003746 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003747
3748 {
3749 "reviewer": "john.doe@example.com"
3750 }
3751----
3752
Gal Paikin721a40b2021-04-15 09:30:00 +02003753As response an link:#reviewer-result[ReviewerResult] entity is
Edwin Kempin392328e2013-02-25 12:50:03 +01003754returned that describes the newly added reviewers.
3755
3756.Response
3757----
3758 HTTP/1.1 200 OK
3759 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003760 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003761
3762 )]}'
3763 {
Aaron Gable8c650212017-04-25 12:03:37 -07003764 "input": "john.doe@example.com",
Edwin Kempin392328e2013-02-25 12:50:03 +01003765 "reviewers": [
3766 {
Aaron Gable8c650212017-04-25 12:03:37 -07003767 "_account_id": 1000096,
3768 "name": "John Doe",
3769 "email": "john.doe@example.com"
Edwin Kempin392328e2013-02-25 12:50:03 +01003770 "approvals": {
3771 "Verified": " 0",
3772 "Code-Review": " 0"
3773 },
Edwin Kempin392328e2013-02-25 12:50:03 +01003774 }
3775 ]
3776 }
3777----
3778
3779If a group is specified, adding the group members as reviewers is an
3780atomic operation. This means if an error is returned, none of the
3781members are added as reviewer.
3782
3783If a group with many members is added as reviewer a confirmation may be
3784required.
3785
Edwin Kempinf9f19412019-08-28 09:28:51 +02003786If a group is added as CC and members of this group are already
3787reviewers on the change, these members stay reviewers on the change
3788(they are not downgraded to CC). However if a group is added as
3789reviewer, all group members become reviewer of the change, even if they
3790have been added as CC before.
3791
Edwin Kempin392328e2013-02-25 12:50:03 +01003792.Request
3793----
3794 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003795 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003796
3797 {
3798 "reviewer": "MyProjectVerifiers"
3799 }
3800----
3801
3802.Response
3803----
3804 HTTP/1.1 200 OK
3805 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003806 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003807
3808 )]}'
3809 {
Logan Hanks23e70282016-07-06 14:31:56 -07003810 "input": "MyProjectVerifiers",
Edwin Kempin392328e2013-02-25 12:50:03 +01003811 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
3812 "confirm": true
3813 }
3814----
3815
3816To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01003817`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01003818
3819.Request
3820----
3821 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003822 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003823
3824 {
Logan Hanks23e70282016-07-06 14:31:56 -07003825 "input": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01003826 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01003827 }
3828----
3829
Patrick Hiesel11873ef2017-03-17 17:36:05 +01003830If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set
3831for the project, reviewers and CCs are not required to have a Gerrit account. If you POST
3832an email address of a reviewer or CC then, they will be added to the change even if they
3833don't have a Gerrit account.
3834
3835If this option is disabled, the request would fail with `400 Bad Request` if the email
3836address can't be resolved to an active Gerrit account.
3837
3838Note that the name is optional so both "un.registered@reviewer.com" and
3839"John Doe <un.registered@reviewer.com>" are valid inputs.
3840
3841Reviewers without Gerrit accounts can only be added on changes visible to anonymous users.
3842
3843.Request
3844----
3845 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
3846 Content-Type: application/json; charset=UTF-8
3847
3848 {
3849 "reviewer": "John Doe <un.registered@reviewer.com>"
3850 }
3851----
3852
3853.Response
3854----
3855 HTTP/1.1 200 OK
3856 Content-Disposition: attachment
3857 Content-Type: application/json; charset=UTF-8
3858
3859 )]}'
3860 {
3861 "input": "John Doe <un.registered@reviewer.com>"
3862 }
3863----
3864
Logan Hanksf03040e2017-05-03 09:40:56 -07003865.Notifications
3866
3867An email will be sent using the "newchange" template.
3868
3869[options="header",cols="1,1,1"]
3870|=============================
3871|WIP State |Default|notify=ALL
3872|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
3873|Work in progress|not sent|owner, reviewers, CCs
3874|=============================
3875
Edwin Kempin53301072013-02-25 12:57:07 +01003876[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003877=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003878--
Edwin Kempin407fca32016-08-29 12:01:00 +02003879'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' +
3880'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 -08003881--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003882
Edwin Kempin53301072013-02-25 12:57:07 +01003883Deletes a reviewer from a change.
Gal Paikinc326de42020-06-16 18:49:00 +03003884Deleting a reviewer also removes that user from the attention set.
Edwin Kempin53301072013-02-25 12:57:07 +01003885
3886.Request
3887----
3888 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
Edwin Kempin407fca32016-08-29 12:01:00 +02003889 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3890----
3891
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003892Options can be provided in the request body as a
3893link:#delete-reviewer-input[DeleteReviewerInput] entity.
3894Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01003895link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003896In this case, use a POST request instead:
Edwin Kempin407fca32016-08-29 12:01:00 +02003897
3898.Request
3899----
3900 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3901 Content-Type: application/json; charset=UTF-8
3902
3903 {
3904 "notify": "NONE"
3905 }
Edwin Kempin53301072013-02-25 12:57:07 +01003906----
3907
3908.Response
3909----
3910 HTTP/1.1 204 No Content
3911----
3912
Logan Hanks87607412017-05-30 13:49:04 -07003913.Notifications
3914
3915An email will be sent using the "deleteReviewer" template. If deleting the
3916reviewer resulted in one or more approvals being removed, then the deleted
3917reviewer will also receive a notification (unless notify=NONE).
3918
3919[options="header",cols="1,5"]
3920|=============================
3921|WIP State |Default Recipients
3922|Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers
3923|Work in progress|notify=NONE: deleted reviewer (if voted)
3924|=============================
3925
David Ostrovskybeb0b842014-12-13 00:24:29 +01003926[[list-votes]]
3927=== List Votes
3928--
3929'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
3930--
3931
3932Lists the votes for a specific reviewer of the change.
3933
3934.Request
3935----
Edwin Kempin314f10a2016-07-11 11:39:05 +02003936 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0
David Ostrovskybeb0b842014-12-13 00:24:29 +01003937----
3938
3939As result a map is returned that maps the label name to the label value.
3940The entries in the map are sorted by label name.
3941
3942.Response
3943----
3944 HTTP/1.1 200 OK
3945 Content-Disposition: attachment
3946 Content-Type: application/json;charset=UTF-8
3947
3948 )]}'
3949 {
3950 "Code-Review": -1,
3951 "Verified": 1
3952 "Work-In-Progress": 1,
3953 }
3954----
3955
3956[[delete-vote]]
3957=== Delete Vote
3958--
Edwin Kempin5488dc12016-08-29 11:13:31 +02003959'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 +02003960'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 +01003961--
3962
3963Deletes a single vote from a change. Note, that even when the last vote of
3964a reviewer is removed the reviewer itself is still listed on the change.
3965
Gal Paikin6ce56dc2021-03-29 12:28:43 +02003966If another user removed a user's vote, the user with the deleted vote will be
3967added to the attention set.
3968
Dmitrii Filippov3e0bbb72023-02-22 12:57:00 +01003969The request returns:
3970 * '204 No Content' if the vote is deleted successfully;
3971 * '404 Not Found' when the vote to be deleted is zero or not present.
3972
David Ostrovskybeb0b842014-12-13 00:24:29 +01003973.Request
3974----
3975 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003976 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3977----
3978
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003979Options can be provided in the request body as a
3980link:#delete-vote-input[DeleteVoteInput] entity.
3981Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01003982link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003983In this case, use a POST request instead:
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003984
3985.Request
3986----
3987 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3988 Content-Type: application/json; charset=UTF-8
3989
3990 {
3991 "notify": "NONE"
3992 }
David Ostrovskybeb0b842014-12-13 00:24:29 +01003993----
3994
3995.Response
3996----
3997 HTTP/1.1 204 No Content
3998----
3999
Logan Hanksa1e68dc2017-06-29 15:13:27 -07004000
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004001[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004002== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004003
Shawn Pearce728ba882013-07-08 23:13:08 -07004004[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004005=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004006--
Shawn Pearce728ba882013-07-08 23:13:08 -07004007'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004008--
Shawn Pearce728ba882013-07-08 23:13:08 -07004009
4010Retrieves a parsed commit of a revision.
4011
4012.Request
4013----
4014 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
4015----
4016
4017As response a link:#commit-info[CommitInfo] entity is returned that
4018describes the revision.
4019
4020.Response
4021----
4022 HTTP/1.1 200 OK
4023 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004024 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07004025
4026 )]}'
4027 {
Edwin Kempinc8237402015-07-15 18:27:55 +02004028 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07004029 "parents": [
4030 {
4031 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
4032 "subject": "Migrate contributor agreements to All-Projects."
4033 }
4034 ],
4035 "author": {
4036 "name": "Shawn O. Pearce",
4037 "email": "sop@google.com",
4038 "date": "2012-04-24 18:08:08.000000000",
4039 "tz": -420
4040 },
4041 "committer": {
4042 "name": "Shawn O. Pearce",
4043 "email": "sop@google.com",
4044 "date": "2012-04-24 18:08:08.000000000",
4045 "tz": -420
4046 },
4047 "subject": "Use an EventBus to manage star icons",
4048 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
4049 }
4050----
4051
Sven Selbergd26bd542014-11-21 16:28:10 +01004052Adding query parameter `links` (for example `/changes/.../commit?links`)
4053returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07004054
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08004055[[get-description]]
4056=== Get Description
4057--
4058'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
4059--
4060
4061Retrieves the description of a patch set.
4062
4063.Request
4064----
4065 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
4066----
4067
4068.Response
4069----
4070 HTTP/1.1 200 OK
4071 Content-Disposition: attachment
4072 Content-Type: application/json; charset=UTF-8
4073
4074 )]}'
4075 "Added Documentation"
4076----
4077
4078If the patch set does not have a description an empty string is returned.
4079
4080[[set-description]]
4081=== Set Description
4082--
4083'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
4084--
4085
4086Sets the description of a patch set.
4087
4088The new description must be provided in the request body inside a
4089link:#description-input[DescriptionInput] entity.
4090
4091.Request
4092----
4093 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
4094 Content-Type: application/json; charset=UTF-8
4095
4096 {
4097 "description": "Added Documentation"
4098 }
4099----
4100
4101As response the new description is returned.
4102
4103.Response
4104----
4105 HTTP/1.1 200 OK
4106 Content-Disposition: attachment
4107 Content-Type: application/json; charset=UTF-8
4108
4109 )]}'
4110 "Added Documentation"
4111----
4112
Edwin Kempin0f229442016-09-09 13:06:12 +02004113[[get-merge-list]]
4114=== Get Merge List
4115--
4116'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist'
4117--
4118
4119Returns the list of commits that are being integrated into a target
4120branch by a merge commit. By default the first parent is assumed to be
4121uninteresting. By using the `parent` option another parent can be set
4122as uninteresting (parents are 1-based).
4123
4124The list of commits is returned as a list of
4125link:#commit-info[CommitInfo] entities. Web links are only included if
4126the `links` option was set.
4127
4128.Request
4129----
4130 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0
4131----
4132
4133.Response
4134----
4135HTTP/1.1 200 OK
4136 Content-Disposition: attachment
4137 Content-Type: application/json; charset=UTF-8
4138
4139 )]}'
4140 [
4141 {
4142 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
4143 "parents": [
4144 {
4145 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
4146 "subject": "Migrate contributor agreements to All-Projects."
4147 }
4148 ],
4149 "author": {
4150 "name": "Shawn O. Pearce",
4151 "email": "sop@google.com",
4152 "date": "2012-04-24 18:08:08.000000000",
4153 "tz": -420
4154 },
4155 "committer": {
4156 "name": "Shawn O. Pearce",
4157 "email": "sop@google.com",
4158 "date": "2012-04-24 18:08:08.000000000",
4159 "tz": -420
4160 },
4161 "subject": "Use an EventBus to manage star icons",
4162 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
4163 }
4164 ]
4165----
4166
Stefan Bellerc7259662015-02-12 17:23:05 -08004167[[get-revision-actions]]
4168=== Get Revision Actions
4169--
4170'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
4171--
4172
4173Retrieves revision link:#action-info[actions] of the revision of a change.
4174
4175.Request
4176----
4177 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
4178----
4179
4180.Response
4181----
4182 HTTP/1.1 200 OK
4183 Content-Disposition: attachment
4184 Content-Type: application/json; charset=UTF-8
4185
4186 )]}'
4187
4188{
4189 "submit": {
4190 "method": "POST",
4191 "label": "Submit",
4192 "title": "Submit patch set 1 into master",
4193 "enabled": true
4194 },
4195 "cherrypick": {
4196 "method": "POST",
4197 "label": "Cherry Pick",
4198 "title": "Cherry pick change to a different branch",
4199 "enabled": true
4200 }
4201}
4202----
4203
Han-Wen Nienhuys86db7672021-08-10 12:45:58 +02004204The response is a flat map of possible revision REST endpoint names
4205mapped to their link:#action-info[ActionInfo].
Stefan Bellerc7259662015-02-12 17:23:05 -08004206
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004207[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004208=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004209--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004210'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004211--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004212
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004213Retrieves a review of a revision.
4214
4215.Request
4216----
4217 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
4218----
4219
4220As response a link:#change-info[ChangeInfo] entity with
4221link:#detailed-labels[detailed labels] and link:#detailed-accounts[
4222detailed accounts] is returned that describes the review of the
4223revision. The revision for which the review is retrieved is contained
4224in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05004225set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004226revision of the change. Please note that the returned labels are always
4227for the current patch set.
4228
4229.Response
4230----
4231 HTTP/1.1 200 OK
4232 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004233 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004234
4235 )]}'
4236 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004237 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
4238 "project": "myProject",
4239 "branch": "master",
4240 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
4241 "subject": "Implementing Feature X",
4242 "status": "NEW",
4243 "created": "2013-02-01 09:59:32.126000000",
4244 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004245 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004246 "insertions": 34,
4247 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004248 "_number": 3965,
4249 "owner": {
4250 "_account_id": 1000096,
4251 "name": "John Doe",
4252 "email": "john.doe@example.com"
4253 },
4254 "labels": {
4255 "Verified": {
4256 "all": [
4257 {
4258 "value": 0,
4259 "_account_id": 1000096,
4260 "name": "John Doe",
4261 "email": "john.doe@example.com"
4262 },
4263 {
4264 "value": 0,
4265 "_account_id": 1000097,
4266 "name": "Jane Roe",
4267 "email": "jane.roe@example.com"
4268 }
4269 ],
4270 "values": {
4271 "-1": "Fails",
4272 " 0": "No score",
4273 "+1": "Verified"
4274 }
4275 },
4276 "Code-Review": {
4277 "all": [
4278 {
4279 "value": -1,
4280 "_account_id": 1000096,
4281 "name": "John Doe",
4282 "email": "john.doe@example.com"
4283 },
4284 {
4285 "value": 1,
4286 "_account_id": 1000097,
4287 "name": "Jane Roe",
4288 "email": "jane.roe@example.com"
4289 }
4290 ]
4291 "values": {
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01004292 "-2": "This shall not be submitted",
4293 "-1": "I would prefer this is not submitted as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004294 " 0": "No score",
4295 "+1": "Looks good to me, but someone else must approve",
4296 "+2": "Looks good to me, approved"
4297 }
4298 }
4299 },
4300 "permitted_labels": {
4301 "Verified": [
4302 "-1",
4303 " 0",
4304 "+1"
4305 ],
4306 "Code-Review": [
4307 "-2",
4308 "-1",
4309 " 0",
4310 "+1",
4311 "+2"
4312 ]
4313 },
4314 "removable_reviewers": [
4315 {
4316 "_account_id": 1000096,
4317 "name": "John Doe",
4318 "email": "john.doe@example.com"
4319 },
4320 {
4321 "_account_id": 1000097,
4322 "name": "Jane Roe",
4323 "email": "jane.roe@example.com"
4324 }
4325 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08004326 "reviewers": {
4327 "REVIEWER": [
4328 {
4329 "_account_id": 1000096,
4330 "name": "John Doe",
4331 "email": "john.doe@example.com"
4332 },
4333 {
4334 "_account_id": 1000097,
4335 "name": "Jane Roe",
4336 "email": "jane.roe@example.com"
4337 }
4338 ]
4339 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004340 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
4341 "revisions": {
4342 "674ac754f91e64a0efb8087e59a176484bd534d1": {
David Pursehouse4de41112016-06-28 09:24:08 +09004343 "kind": "REWORK",
4344 "_number": 2,
4345 "ref": "refs/changes/65/3965/2",
4346 "fetch": {
4347 "http": {
4348 "url": "http://gerrit/myProject",
4349 "ref": "refs/changes/65/3965/2"
4350 }
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004351 }
4352 }
4353 }
4354 }
4355----
4356
David Pursehouse669f2512014-07-18 11:41:42 +09004357[[get-related-changes]]
4358=== Get Related Changes
4359--
4360'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
4361--
4362
4363Retrieves related changes of a revision. Related changes are changes that either
4364depend on, or are dependencies of the revision.
4365
Joerg Zieren75e95382022-07-08 11:30:35 +02004366Additional fields can be obtained by adding `o` parameters. Since these may slow
4367down processing they are disabled by default. Currently a single parameter is
4368supported:
4369
4370[[get-related-changes-submittable]]
4371--
4372* `SUBMITTABLE`: Compute the `submittable` field in the returned
4373 link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities.
4374--
4375
David Pursehouse669f2512014-07-18 11:41:42 +09004376.Request
4377----
4378 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
4379----
4380
4381As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
4382describing the related changes.
4383
4384.Response
4385----
4386 HTTP/1.1 200 OK
4387 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004388 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09004389
4390 )]}'
4391 {
4392 "changes": [
4393 {
Patrick Hieselcab63512017-07-28 10:25:42 +02004394 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09004395 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
4396 "commit": {
4397 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
4398 "parents": [
4399 {
4400 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
4401 }
4402 ],
4403 "author": {
4404 "name": "David Ostrovsky",
4405 "email": "david@ostrovsky.org",
4406 "date": "2014-07-12 15:04:24.000000000",
4407 "tz": 120
4408 },
4409 "subject": "Remove Solr"
4410 },
4411 "_change_number": 58478,
4412 "_revision_number": 2,
4413 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07004414 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09004415 },
4416 {
Patrick Hieselcab63512017-07-28 10:25:42 +02004417 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09004418 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
4419 "commit": {
4420 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
4421 "parents": [
4422 {
4423 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
4424 }
4425 ],
4426 "author": {
4427 "name": "David Pursehouse",
4428 "email": "david.pursehouse@sonymobile.com",
4429 "date": "2014-06-24 02:01:28.000000000",
4430 "tz": 540
4431 },
4432 "subject": "Add support for secondary index with Elasticsearch"
4433 },
4434 "_change_number": 58081,
4435 "_revision_number": 10,
4436 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07004437 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09004438 }
4439 ]
4440 }
4441----
4442
4443
Edwin Kempin67498de2013-02-25 16:15:34 +01004444[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004445=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004446--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004447'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004448--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004449
Logan Hanksf03040e2017-05-03 09:40:56 -07004450Sets a review on a revision, optionally also publishing draft comments, setting
Logan Hanks53c36012017-06-30 13:47:54 -07004451labels, adding reviewers or CCs, and modifying the work in progress property.
Edwin Kempin67498de2013-02-25 16:15:34 +01004452
4453The review must be provided in the request body as a
4454link:#review-input[ReviewInput] entity.
4455
Youssef Elghareeb12add162019-12-18 18:43:23 +01004456If the labels are set, the user sending the request will automatically be
4457added as a reviewer, otherwise (if they only commented) they are added to
4458the CC list.
4459
Edwin Kempinc9219002023-09-08 08:07:21 +00004460Posting a review usually updates the link:user-attention-set.html[attention
4461set].
Gal Paikinc326de42020-06-16 18:49:00 +03004462
Aaron Gable8c650212017-04-25 12:03:37 -07004463A review cannot be set on a change edit. Trying to post a review for a
4464change edit fails with `409 Conflict`.
4465
Logan Hanksf03040e2017-05-03 09:40:56 -07004466Here is an example of using this method to set labels:
Aaron Gable8c650212017-04-25 12:03:37 -07004467
Edwin Kempin67498de2013-02-25 16:15:34 +01004468.Request
4469----
4470 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004471 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01004472
4473 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01004474 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01004475 "message": "Some nits need to be fixed.",
4476 "labels": {
4477 "Code-Review": -1
4478 },
4479 "comments": {
4480 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4481 {
4482 "line": 23,
4483 "message": "[nit] trailing whitespace"
4484 },
4485 {
4486 "line": 49,
4487 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09004488 },
4489 {
4490 "range": {
4491 "start_line": 50,
4492 "start_character": 0,
4493 "end_line": 55,
4494 "end_character": 20
4495 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09004496 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01004497 }
4498 ]
4499 }
4500 }
4501----
4502
Aaron Gable843b0c12017-04-21 08:25:27 -07004503As response a link:#review-result[ReviewResult] entity is returned that
Aaron Gable8c650212017-04-25 12:03:37 -07004504describes the applied labels and any added reviewers (e.g. yourself,
4505if you set a label but weren't previously a reviewer on this CL).
Edwin Kempin67498de2013-02-25 16:15:34 +01004506
4507.Response
4508----
4509 HTTP/1.1 200 OK
4510 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004511 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01004512
4513 )]}'
4514 {
4515 "labels": {
4516 "Code-Review": -1
4517 }
4518 }
4519----
4520
Aaron Gable8c650212017-04-25 12:03:37 -07004521It is also possible to add one or more reviewers or CCs
Logan Hanksf03040e2017-05-03 09:40:56 -07004522to a change simultaneously with a review:
Logan Hanks5f1c7592016-07-06 14:39:33 -07004523
4524.Request
4525----
4526 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
4527 Content-Type: application/json; charset=UTF-8
4528
4529 {
Aaron Gable8c650212017-04-25 12:03:37 -07004530 "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 -07004531 "reviewers": [
4532 {
4533 "reviewer": "jane.roe@example.com"
4534 },
4535 {
Aaron Gable8c650212017-04-25 12:03:37 -07004536 "reviewer": "john.doe@example.com",
4537 "state": "CC"
4538 }
4539 {
4540 "reviewer": "MyProjectVerifiers",
Logan Hanks5f1c7592016-07-06 14:39:33 -07004541 }
4542 ]
4543 }
4544----
4545
4546Each element of the `reviewers` list is an instance of
4547link:#reviewer-input[ReviewerInput]. The corresponding result of
Aaron Gable8c650212017-04-25 12:03:37 -07004548adding each reviewer will be returned in a map of inputs to
Gal Paikin721a40b2021-04-15 09:30:00 +02004549link:#reviewer-result[ReviewerResult]s.
Logan Hanks5f1c7592016-07-06 14:39:33 -07004550
4551.Response
4552----
4553 HTTP/1.1 200 OK
4554 Content-Disposition: attachment
4555 Content-Type: application/json; charset=UTF-8
4556
4557 )]}'
4558 {
Aaron Gable8c650212017-04-25 12:03:37 -07004559 "reviewers": {
4560 "jane.roe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07004561 "input": "jane.roe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07004562 "reviewers": [
4563 {
4564 "_account_id": 1000097,
4565 "name": "Jane Roe",
4566 "email": "jane.roe@example.com"
4567 "approvals": {
4568 "Verified": " 0",
4569 "Code-Review": " 0"
4570 },
4571 },
4572 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07004573 },
Aaron Gable8c650212017-04-25 12:03:37 -07004574 "john.doe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07004575 "input": "john.doe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07004576 "ccs": [
4577 {
4578 "_account_id": 1000096,
4579 "name": "John Doe",
4580 "email": "john.doe@example.com"
4581 "approvals": {
4582 "Verified": " 0",
4583 "Code-Review": " 0"
4584 },
4585 }
4586 ]
4587 },
4588 "MyProjectVerifiers": {
4589 "input": "MyProjectVerifiers",
4590 "reviewers": [
4591 {
4592 "_account_id": 1000098,
4593 "name": "Alice Ansel",
4594 "email": "alice.ansel@example.com"
4595 "approvals": {
4596 "Verified": " 0",
4597 "Code-Review": " 0"
4598 },
4599 },
4600 {
4601 "_account_id": 1000099,
4602 "name": "Bob Bollard",
4603 "email": "bob.bollard@example.com"
4604 "approvals": {
4605 "Verified": " 0",
4606 "Code-Review": " 0"
4607 },
4608 },
4609 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07004610 }
Aaron Gable8c650212017-04-25 12:03:37 -07004611 }
Logan Hanks5f1c7592016-07-06 14:39:33 -07004612 }
4613----
4614
Logan Hankse2aacef2016-07-22 15:54:52 -07004615If there are any errors returned for reviewers, the entire review request will
Aaron Gable8c650212017-04-25 12:03:37 -07004616be rejected with `400 Bad Request`. None of the entries will have the
4617`reviewers` or `ccs` field set, and those which specifically failed will have
4618the `errors` field set containing details of why they failed.
Logan Hankse2aacef2016-07-22 15:54:52 -07004619
4620.Error Response
4621----
4622 HTTP/1.1 400 Bad Request
4623 Content-Disposition: attachment
4624 Content-Type: application/json; charset=UTF-8
4625
4626 )]}'
4627 {
4628 "reviewers": {
Aaron Gable8c650212017-04-25 12:03:37 -07004629 "jane.roe@example.com": {
4630 "input": "jane.roe@example.com",
4631 "error": "Account of jane.roe@example.com is inactive."
4632 },
4633 "john.doe@example.com": {
4634 "input": "john.doe@example.com"
4635 },
Logan Hankse2aacef2016-07-22 15:54:52 -07004636 "MyProjectVerifiers": {
4637 "input": "MyProjectVerifiers",
4638 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
4639 "confirm": true
4640 }
4641 }
4642 }
4643----
4644
Dave Borowitzd2e41452017-10-26 08:06:23 -04004645[[set-review-notifications]]
Logan Hanksfc055962017-06-12 14:20:53 -07004646.Notifications
4647
4648An email will be sent using the "comment" template.
4649
4650If the top-level notify property is null or not set, then notification behavior
4651depends on whether the change is WIP, whether it has started review, and whether
4652the tag property is null.
4653
4654NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*.
4655Use the notify property of the top-level link:#review-input[ReviewInput] instead.
4656
4657For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS
4658watchers*.
4659
Logan Hanksea3e3b72017-06-12 14:21:47 -07004660[options="header",cols="2,1,1,2,2"]
Logan Hanksfc055962017-06-12 14:20:53 -07004661|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07004662|WIP State |Review Started|Tag Given|Default |notify=ALL
4663|Ready for review|N/A |N/A |everyone|everyone
4664|Work in progress|no |no |not sent|everyone
4665|Work in progress|no |yes |owner |everyone
4666|Work in progress|yes |no |everyone|everyone
4667|Work in progress|yes |yes |owner |everyone
4668
Logan Hanksfc055962017-06-12 14:20:53 -07004669|=============================
4670
4671If reviewers are added, then a second email will be sent using the "newchange"
4672template. The notification logic for this email is the same as for
4673link:#add-reviewer[Add Reviewer].
4674
Logan Hanksea3e3b72017-06-12 14:21:47 -07004675[options="header",cols="1,1,1"]
Logan Hanksfc055962017-06-12 14:20:53 -07004676|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07004677|WIP State |Default |notify=ALL
4678|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
4679|Work in progress|not sent |owner, reviewers, CCs
Logan Hanksfc055962017-06-12 14:20:53 -07004680|=============================
4681
4682
Edwin Kempincdae63b2013-03-15 15:06:59 +01004683[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004684=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004685--
Edwin Kempincdae63b2013-03-15 15:06:59 +01004686'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004687--
Edwin Kempincdae63b2013-03-15 15:06:59 +01004688
4689Rebases a revision.
4690
Zalan Blenessy874aed72015-01-12 13:26:18 +01004691Optionally, the parent revision can be changed to another patch set through the
4692link:#rebase-input[RebaseInput] entity.
4693
Edwin Kempincdae63b2013-03-15 15:06:59 +01004694.Request
4695----
4696 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01004697 Content-Type: application/json;charset=UTF-8
4698
4699 {
4700 "base" : "1234",
4701 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01004702----
4703
4704As response a link:#change-info[ChangeInfo] entity is returned that
4705describes the rebased change. Information about the current patch set
4706is included.
4707
4708.Response
4709----
4710 HTTP/1.1 200 OK
4711 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004712 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01004713
4714 )]}'
4715 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01004716 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
4717 "project": "myProject",
4718 "branch": "master",
4719 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
4720 "subject": "Implement Feature X",
4721 "status": "NEW",
4722 "created": "2013-02-01 09:59:32.126000000",
4723 "updated": "2013-02-21 11:16:36.775000000",
4724 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004725 "insertions": 21,
4726 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01004727 "_number": 4799,
4728 "owner": {
4729 "name": "John Doe"
4730 },
4731 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
4732 "revisions": {
4733 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09004734 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01004735 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01004736 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01004737 "fetch": {
4738 "http": {
4739 "url": "http://gerrit:8080/myProject",
4740 "ref": "refs/changes/99/4799/2"
4741 }
4742 },
4743 "commit": {
4744 "parents": [
4745 {
4746 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
4747 "subject": "Implement Feature A"
4748 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00004749 ],
4750 "author": {
4751 "name": "John Doe",
4752 "email": "john.doe@example.com",
4753 "date": "2013-05-07 15:21:27.000000000",
4754 "tz": 120
4755 },
4756 "committer": {
4757 "name": "Gerrit Code Review",
4758 "email": "gerrit-server@example.com",
4759 "date": "2013-05-07 15:35:43.000000000",
4760 "tz": 120
4761 },
4762 "subject": "Implement Feature X",
4763 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01004764 }
4765 }
4766 }
4767----
4768
4769If the revision cannot be rebased, e.g. due to conflicts, the response is
4770"`409 Conflict`" and the error message is contained in the response
4771body.
4772
4773.Response
4774----
4775 HTTP/1.1 409 Conflict
4776 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004777 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01004778
4779 The change could not be rebased due to a path conflict during merge.
4780----
4781
Edwin Kempin14b58112013-02-26 16:30:19 +01004782[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004783=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004784--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004785'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004786--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004787
Edwin Kempin14b58112013-02-26 16:30:19 +01004788Submits a revision.
Edwin Kempinc9219002023-09-08 08:07:21 +00004789Submitting a change also removes all users from the link:user-attention-set.html[attention set].
Edwin Kempin14b58112013-02-26 16:30:19 +01004790
Edwin Kempin14b58112013-02-26 16:30:19 +01004791.Request
4792----
4793 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
Edwin Kempin14b58112013-02-26 16:30:19 +01004794----
4795
Gal Paikin3d6cdec2021-04-19 13:32:13 +02004796As response a link:#change-info[ChangeInfo] entity is returned that
4797describes the submitted/merged change.
4798
Gal Paikine2849a82021-04-19 13:41:10 +02004799Submission may submit multiple changes, but we still only return one ChangeInfo
4800object. To query for all submitted changes, please use the submission_id that is
4801part of the response.
4802
4803Changes that will also be submitted:
48041. All changes of the same topic if
4805link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
4806configuration is set to true.
48072. All dependent changes.
48083. The closure of the above (e.g if a dependent change has a topic, all changes
4809of *that* topic will also be submitted).
4810
Gal Paikin3d6cdec2021-04-19 13:32:13 +02004811.Response
4812----
4813 HTTP/1.1 200 OK
4814 Content-Disposition: attachment
4815 Content-Type: application/json; charset=UTF-8
4816
4817 )]}'
4818 {
4819 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
4820 "project": "myProject",
4821 "branch": "master",
4822 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
4823 "subject": "Implementing Feature X",
4824 "status": "MERGED",
4825 "created": "2013-02-01 09:59:32.126000000",
4826 "updated": "2013-02-21 11:16:36.775000000",
4827 "submitted": "2013-02-21 11:16:36.615000000",
4828 "_number": 3965,
4829 "owner": {
4830 "name": "John Doe"
4831 }
4832 }
4833----
4834
Edwin Kempin14b58112013-02-26 16:30:19 +01004835If the revision cannot be submitted, e.g. because the submit rule
4836doesn't allow submitting the revision or the revision is not the
4837current revision, the response is "`409 Conflict`" and the error
4838message is contained in the response body.
4839
4840.Response
4841----
4842 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004843 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01004844
4845 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
4846----
4847
Edwin Kempin257d70f2013-03-28 14:31:14 +01004848[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004849=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004850--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004851'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004852--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004853
4854Gets the formatted patch for one revision.
4855
4856.Request
4857----
4858 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
4859----
4860
Shawn Pearce98361f72013-05-10 16:27:36 -07004861The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01004862
4863.Response
4864----
4865 HTTP/1.1 200 OK
4866 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004867 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07004868 X-FYI-Content-Encoding: base64
4869 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01004870
Shawn Pearce98361f72013-05-10 16:27:36 -07004871 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01004872----
4873
David Ostrovsky973f38b2013-08-22 00:24:51 -07004874Adding query parameter `zip` (for example `/changes/.../patch?zip`)
4875returns the patch as a single file inside of a ZIP archive. Clients
4876can expand the ZIP to obtain the plain text patch, avoiding the
4877need for a base64 decoding step. This option implies `download`.
4878
4879Query parameter `download` (e.g. `/changes/.../patch?download`)
4880will suggest the browser save the patch as `commitsha1.diff.base64`,
4881for later processing by command line tools.
4882
Kasper Nilsson81448072016-10-17 15:04:33 -07004883If the `path` parameter is set, the returned content is a diff of the single
4884file that the path refers to.
4885
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004886[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004887=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004888--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004889'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004890--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004891
4892Gets the method the server will use to submit (merge) the change and
4893an indicator if the change is currently mergeable.
4894
4895.Request
4896----
4897 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
4898----
4899
Saša Živkov499873f2014-05-05 13:34:18 +02004900As response a link:#mergeable-info[MergeableInfo] entity is returned.
4901
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004902.Response
4903----
4904 HTTP/1.1 200 OK
4905 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004906 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004907
4908 )]}'
4909 {
4910 submit_type: "MERGE_IF_NECESSARY",
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004911 strategy: "recursive",
4912 mergeable: true
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004913 }
4914----
4915
Saša Živkov697cab22014-04-29 16:46:50 +02004916If the `other-branches` parameter is specified, the mergeability will also be
Zhen Chen6729b632016-11-11 17:32:32 -08004917checked for all other branches which are listed in the
4918link:config-project-config.html#branchOrder-section[branchOrder] section in the
4919project.config file.
Saša Živkov697cab22014-04-29 16:46:50 +02004920
4921.Request
4922----
4923 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
4924----
4925
4926The response will then contain a list of all other branches where this changes
4927could merge cleanly.
4928
4929.Response
4930----
4931 HTTP/1.1 200 OK
4932 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004933 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02004934
4935 )]}'
4936 {
4937 submit_type: "MERGE_IF_NECESSARY",
4938 mergeable: true,
4939 mergeable_into: [
4940 "refs/heads/stable-2.7",
4941 "refs/heads/stable-2.8",
4942 ]
4943 }
4944----
4945
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004946[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004947=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004948--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004949'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004950--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004951
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004952Gets the method the server will use to submit (merge) the change.
4953
4954.Request
4955----
4956 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
4957----
4958
4959.Response
4960----
4961 HTTP/1.1 200 OK
4962 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004963 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004964
4965 )]}'
4966 "MERGE_IF_NECESSARY"
4967----
4968
4969[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004970=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004971--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004972'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004973--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004974
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004975Tests the submit_type Prolog rule in the project, or the one given.
4976
4977Request body may be either the Prolog code as `text/plain` or a
4978link:#rule-input[RuleInput] object. The query parameter `filters`
4979may be set to `SKIP` to bypass parent project filters while testing
4980a project-specific rule.
4981
4982.Request
4983----
4984 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse4d7f9912020-06-18 13:02:56 +09004985 Content-Type: text/plain; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004986
4987 submit_type(cherry_pick).
4988----
4989
4990.Response
4991----
4992 HTTP/1.1 200 OK
4993 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004994 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004995
4996 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07004997 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004998----
4999
5000[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005001=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005002--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005003'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005004--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005005
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005006Tests the submit_rule Prolog rule in the project, or the one given.
5007
5008Request body may be either the Prolog code as `text/plain` or a
5009link:#rule-input[RuleInput] object. The query parameter `filters`
5010may be set to `SKIP` to bypass parent project filters while testing
5011a project-specific rule.
5012
5013.Request
5014----
Shawn Pearcea3cce712014-03-21 08:16:11 -07005015 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse4d7f9912020-06-18 13:02:56 +09005016 Content-Type: text/plain; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005017
5018 submit_rule(submit(R)) :-
5019 R = label('Any-Label-Name', reject(_)).
5020----
5021
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02005022The response is a link:#submit-record[SubmitRecord] describing the
5023permutations that satisfy the tested submit rule.
5024
David Pursehouse87a3fb02019-10-29 16:01:27 +09005025If the submit rule was a no-op, the response is "`204 No Content`".
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005026
5027.Response
5028----
5029 HTTP/1.1 200 OK
5030 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005031 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005032
5033 )]}'
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02005034 {
5035 "status": "NOT_READY",
5036 "reject": {
5037 "Any-Label-Name": {}
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005038 }
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02005039 }
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005040----
5041
Shawn Pearceb42e3032015-04-02 10:28:10 -07005042When testing with the `curl` command line client the
5043`--data-binary @rules.pl` flag should be used to ensure
5044all LFs are included in the Prolog code:
5045
5046----
5047 curl -X POST \
5048 -H 'Content-Type: text/plain; charset=UTF-8' \
5049 --data-binary @rules.pl \
5050 http://.../test.submit_rule
5051----
5052
Edwin Kempincb6724a2013-02-26 16:58:51 +01005053[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07005054=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005055--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005056'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005057--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005058
Edwin Kempin3ca57192013-02-27 07:44:01 +01005059Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01005060user.
5061
Dave Borowitz23fec2b2015-04-28 17:40:07 -07005062Returns a map of file paths to lists of link:#comment-info[CommentInfo]
5063entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005064
5065.Request
5066----
5067 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
5068----
5069
5070.Response
5071----
5072 HTTP/1.1 200 OK
5073 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005074 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01005075
5076 )]}'
5077 {
5078 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5079 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01005080 "id": "TvcXrmjM",
5081 "line": 23,
5082 "message": "[nit] trailing whitespace",
5083 "updated": "2013-02-26 15:40:43.986000000"
5084 },
5085 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01005086 "id": "TveXwFiA",
5087 "line": 49,
5088 "in_reply_to": "TfYX-Iuo",
5089 "message": "Done",
5090 "updated": "2013-02-26 15:40:45.328000000"
5091 }
5092 ]
5093 }
5094----
5095
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005096[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005097=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005098--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005099'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005100--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005101
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005102Creates a draft comment on a revision.
5103
5104The new draft comment must be provided in the request body inside a
5105link:#comment-input[CommentInput] entity.
5106
5107.Request
5108----
5109 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005110 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005111
5112 {
5113 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5114 "line": 23,
5115 "message": "[nit] trailing whitespace"
5116 }
5117----
5118
5119As response a link:#comment-info[CommentInfo] entity is returned that
5120describes the draft comment.
5121
5122.Response
5123----
5124 HTTP/1.1 200 OK
5125 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005126 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005127
5128 )]}'
5129 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005130 "id": "TvcXrmjM",
5131 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5132 "line": 23,
5133 "message": "[nit] trailing whitespace",
5134 "updated": "2013-02-26 15:40:43.986000000"
5135 }
5136----
5137
Edwin Kempin3ca57192013-02-27 07:44:01 +01005138[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005139=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005140--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005141'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 -08005142--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005143
Edwin Kempin3ca57192013-02-27 07:44:01 +01005144Retrieves a draft comment of a revision that belongs to the calling
5145user.
5146
5147.Request
5148----
5149 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
5150----
5151
5152As response a link:#comment-info[CommentInfo] entity is returned that
5153describes the draft comment.
5154
5155.Response
5156----
5157 HTTP/1.1 200 OK
5158 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005159 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01005160
5161 )]}'
5162 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01005163 "id": "TvcXrmjM",
5164 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5165 "line": 23,
5166 "message": "[nit] trailing whitespace",
5167 "updated": "2013-02-26 15:40:43.986000000"
5168 }
5169----
5170
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005171[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005172=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005173--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005174'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 -08005175--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005176
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005177Updates a draft comment on a revision.
5178
5179The new draft comment must be provided in the request body inside a
5180link:#comment-input[CommentInput] entity.
5181
5182.Request
5183----
5184 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005185 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005186
5187 {
5188 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5189 "line": 23,
5190 "message": "[nit] trailing whitespace"
5191 }
5192----
5193
5194As response a link:#comment-info[CommentInfo] entity is returned that
5195describes the draft comment.
5196
5197.Response
5198----
5199 HTTP/1.1 200 OK
5200 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005201 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005202
5203 )]}'
5204 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005205 "id": "TvcXrmjM",
5206 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5207 "line": 23,
5208 "message": "[nit] trailing whitespace",
5209 "updated": "2013-02-26 15:40:43.986000000"
5210 }
5211----
5212
5213[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005214=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005215--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005216'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 -08005217--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005218
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005219Deletes a draft comment from a revision.
5220
5221.Request
5222----
5223 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
5224----
5225
5226.Response
5227----
5228 HTTP/1.1 204 No Content
5229----
5230
John Spurlock5e402f02013-03-24 11:35:04 -04005231[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07005232=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005233--
John Spurlock5e402f02013-03-24 11:35:04 -04005234'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005235--
John Spurlock5e402f02013-03-24 11:35:04 -04005236
5237Lists the published comments of a revision.
5238
5239As result a map is returned that maps the file path to a list of
5240link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07005241sorted by file path and only include file (or inline) comments. Use
5242the link:#get-change-detail[Get Change Detail] endpoint to retrieve
5243the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04005244
5245.Request
5246----
5247 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
5248----
5249
5250.Response
5251----
5252 HTTP/1.1 200 OK
5253 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005254 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04005255
5256 )]}'
5257 {
5258 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5259 {
John Spurlock5e402f02013-03-24 11:35:04 -04005260 "id": "TvcXrmjM",
5261 "line": 23,
5262 "message": "[nit] trailing whitespace",
5263 "updated": "2013-02-26 15:40:43.986000000",
5264 "author": {
5265 "_account_id": 1000096,
5266 "name": "John Doe",
5267 "email": "john.doe@example.com"
5268 }
5269 },
5270 {
John Spurlock5e402f02013-03-24 11:35:04 -04005271 "id": "TveXwFiA",
5272 "line": 49,
5273 "in_reply_to": "TfYX-Iuo",
5274 "message": "Done",
5275 "updated": "2013-02-26 15:40:45.328000000",
5276 "author": {
5277 "_account_id": 1000097,
5278 "name": "Jane Roe",
5279 "email": "jane.roe@example.com"
5280 }
5281 }
5282 ]
5283 }
5284----
5285
5286[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005287=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005288--
John Spurlock5e402f02013-03-24 11:35:04 -04005289'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 -08005290--
John Spurlock5e402f02013-03-24 11:35:04 -04005291
5292Retrieves a published comment of a revision.
5293
5294.Request
5295----
5296 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
5297----
5298
5299As response a link:#comment-info[CommentInfo] entity is returned that
5300describes the published comment.
5301
5302.Response
5303----
5304 HTTP/1.1 200 OK
5305 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005306 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04005307
5308 )]}'
5309 {
John Spurlock5e402f02013-03-24 11:35:04 -04005310 "id": "TvcXrmjM",
5311 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5312 "line": 23,
5313 "message": "[nit] trailing whitespace",
5314 "updated": "2013-02-26 15:40:43.986000000",
5315 "author": {
5316 "_account_id": 1000096,
5317 "name": "John Doe",
5318 "email": "john.doe@example.com"
5319 }
5320 }
5321----
5322
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005323[[delete-comment]]
5324=== Delete Comment
5325--
5326'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' +
5327'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete'
5328--
5329
5330Deletes a published comment of a revision. Instead of deleting the
5331whole comment, this endpoint just replaces the comment's message
5332with a new message, which contains the name of the user who deletes
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005333the comment and the reason why it's deleted.
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005334
Gal Paikin8d027232021-12-09 12:39:19 +01005335This endpoint also marks the comment as resolved since deleted comments are not
5336actionable.
5337
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005338Note that only users with the
5339link:access-control.html#capability_administrateServer[Administrate Server]
5340global capability are permitted to delete a comment.
5341
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005342Deletion reason can be provided in the request body as a
5343link:#delete-comment-input[DeleteCommentInput] entity.
5344Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01005345link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005346In this case, use a POST request instead:
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005347
5348.Request
5349----
5350 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0
5351 Content-Type: application/json; charset=UTF-8
5352
5353 {
5354 "reason": "contains confidential information"
5355 }
5356----
5357
5358As response a link:#comment-info[CommentInfo] entity is returned that
5359describes the updated comment.
5360
5361.Response
5362----
5363 HTTP/1.1 200 OK
5364 Content-Disposition: attachment
5365 Content-Type: application/json; charset=UTF-8
5366
5367 )]}'
5368 {
5369 "id": "TvcXrmjM",
5370 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5371 "line": 23,
5372 "message": "Comment removed by: Administrator; Reason: contains confidential information",
5373 "updated": "2013-02-26 15:40:43.986000000",
5374 "author": {
5375 "_account_id": 1000096,
5376 "name": "John Doe",
5377 "email": "john.doe@example.com"
5378 }
5379 }
5380----
5381
Edwin Kempinb050a482016-12-01 09:11:19 +01005382[[list-robot-comments]]
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005383=== List Robot Comments
5384--
5385'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/'
5386--
5387
5388Lists the link:config-robot-comments.html[robot comments] of a
5389revision.
5390
5391As result a map is returned that maps the file path to a list of
5392link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
5393map are sorted by file path.
5394
5395.Request
5396----
5397 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0
5398----
5399
5400.Response
5401----
5402 HTTP/1.1 200 OK
5403 Content-Disposition: attachment
5404 Content-Type: application/json; charset=UTF-8
5405
5406 )]}'
5407 {
5408 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5409 {
5410 "id": "TvcXrmjM",
5411 "line": 23,
5412 "message": "unused import",
5413 "updated": "2016-02-26 15:40:43.986000000",
5414 "author": {
5415 "_account_id": 1000110,
5416 "name": "Code Analyzer",
5417 "email": "code.analyzer@example.com"
5418 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005419 "robot_id": "importChecker",
5420 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005421 },
5422 {
5423 "id": "TveXwFiA",
5424 "line": 49,
5425 "message": "wrong indention",
5426 "updated": "2016-02-26 15:40:45.328000000",
5427 "author": {
5428 "_account_id": 1000110,
5429 "name": "Code Analyzer",
5430 "email": "code.analyzer@example.com"
5431 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005432 "robot_id": "styleChecker",
5433 "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005434 }
5435 ]
5436 }
5437----
5438
5439[[get-robot-comment]]
5440=== Get Robot Comment
5441--
5442'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]'
5443--
5444
5445Retrieves a link:config-robot-comments.html[robot comment] of a
5446revision.
5447
5448.Request
5449----
5450 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0
5451----
5452
5453As response a link:#robot-comment-info[RobotCommentInfo] entity is
5454returned that describes the robot comment.
5455
5456.Response
5457----
5458 HTTP/1.1 200 OK
5459 Content-Disposition: attachment
5460 Content-Type: application/json; charset=UTF-8
5461
5462 )]}'
5463 {
5464 "id": "TvcXrmjM",
5465 "line": 23,
5466 "message": "unused import",
5467 "updated": "2016-02-26 15:40:43.986000000",
5468 "author": {
5469 "_account_id": 1000110,
5470 "name": "Code Analyzer",
5471 "email": "code.analyzer@example.com"
5472 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005473 "robot_id": "importChecker",
5474 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005475 }
5476----
5477
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005478[[list-ported-comments]]
5479=== List Ported Comments
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005480--
5481'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_comments'
5482--
5483
5484Ports comments of other revisions to the requested revision.
5485
5486Only comments added on earlier patchsets are ported. That set of comments is filtered even further
5487due to some additional rules. Callers of this endpoint shouldn't rely on the exact logic of which
5488comments are ported as that logic might change in the future. Instead, callers must be able to
5489handle any smaller/larger set of comments returned by this endpoint.
5490
5491Typically, a comment thread is returned fully or excluded fully. However, draft comments and
5492robot comments are ignored and not returned via this endpoint. Hence, it's possible to get ported
5493comments from this endpoint which are a reply to a non-ported robot comment. Callers must be
5494able to deal with this situation.
5495
5496The returned comments are organized in a map of file path to link:#comment-info[CommentInfo] entries
5497in the same fashion as for the link:#list-comments[List Revision Comments] endpoint.
5498The map is filled with the original comment attributes except for these attributes: `path`, `line`,
5499and `range` point to the computed position in the target revision. If the exactly correct position
5500can't be determined, those fields will be filled with the next best position. That can also mean
5501not filling the `line` or `range` attribute anymore and thus converting the comment to a file
5502comment (or even moving the comment to a different file or the patchset level). Callers of this
5503endpoint must be able to deal with this and not rely on the original comment position.
5504
5505It's possible that this endpoint returns different link:#comment-info[CommentInfo] entries with
5506the same comment UUID. This is not a bug but a feature. If a comment appears on a file which Gerrit
5507recognizes as copied between patchsets, the ported version of this comment consists of two ported
5508instances having the same UUID but different `file`/`line`/`range` positions. Callers must be able
5509to handle this situation.
5510
5511Repeated calls of this endpoint might produce different results. Internal errors during the
5512position computation are mapped to fallback locations for affected comments. Those errors might
5513have vanished on later calls, upon which this endpoint returns the actually mapped position. In
5514addition, comments can be deleted and draft comments can be published, upon which the set of ported
5515comments may change.
5516
5517.Request
5518----
5519 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/4/ported_comments/ HTTP/1.0
5520----
5521
5522.Response
5523----
5524 HTTP/1.1 200 OK
5525 Content-Disposition: attachment
5526 Content-Type: application/json; charset=UTF-8
5527
5528 )]}'
5529 {
5530 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5531 {
5532 "id": "TvcXrmjM",
5533 "patch_set": 2,
5534 "line": 23,
5535 "message": "[nit] trailing whitespace",
5536 "updated": "2013-02-26 15:40:43.986000000",
5537 "author": {
5538 "_account_id": 1000096,
5539 "name": "John Doe",
5540 "email": "john.doe@example.com"
5541 },
5542 "unresolved": true
5543 },
5544 {
5545 "id": "TveXwFiA",
5546 "patch_set": 2,
5547 "line": 23,
5548 "in_reply_to": "TvcXrmjM",
5549 "message": "Done",
5550 "updated": "2013-02-26 15:40:45.328000000",
5551 "author": {
5552 "_account_id": 1000097,
5553 "name": "Jane Roe",
5554 "email": "jane.roe@example.com"
5555 },
5556 "unresolved": true
5557 }
5558 ]
5559 }
5560----
5561
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005562[[list-ported-drafts]]
5563=== List Ported Drafts
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005564--
5565'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_drafts'
5566--
5567
5568Ports draft comments of other revisions to the requested revision.
5569
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005570This endpoint behaves similarly to the link:#list-ported-comments[List Ported Comments] endpoint.
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005571With this endpoint, only draft comments of the calling user are ported, though. If a draft comment
5572is a reply to a published comment, only the ported draft comment is returned.
5573
5574Depending on the filtering rules, it's possible that this endpoint returns a draft comment which is
5575a reply to a comment thread which is not returned by the
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005576link:#list-ported-comments[List Ported Comments] endpoint. That's intended behavior. Callers must be
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005577able to handle this situation. The same holds for drafts which are a reply to a robot comment.
5578
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005579Different than the link:#list-ported-comments[List Ported Comments] endpoint, the `author` of the
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005580returned comments is not filled for this endpoint as only comments of the calling user are returned.
5581
Patrick Hieselafd6c702020-11-06 10:21:47 +01005582This endpoint requires authentication.
5583
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005584.Request
5585----
5586 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/ported_drafts/ HTTP/1.0
5587----
5588
5589.Response
5590----
5591 HTTP/1.1 200 OK
5592 Content-Disposition: attachment
5593 Content-Type: application/json; charset=UTF-8
5594
5595 )]}'
5596 {
5597 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5598 {
5599 "id": "TveXwFiA",
5600 "patch_set": 2,
5601 "line": 23,
5602 "in_reply_to": "TvcXrmjM",
5603 "message": "Done",
5604 "updated": "2013-02-26 15:40:45.328000000",
5605 "unresolved": true
5606 }
5607 ]
5608 }
5609----
5610
Sharad Bagri3f6ed642022-06-06 12:41:57 -07005611[[apply-stored-fix]]
5612=== Apply Stored Fix
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005613--
5614'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply'
5615--
5616
5617Applies a suggested fix by creating a change edit which includes the
5618modifications indicated by the fix suggestion. If a change edit already exists,
5619it will be updated accordingly. A fix can only be applied if no change edit
5620exists and the fix refers to the current patch set, or the fix refers to the
5621patch set on which the change edit is based.
5622
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05305623If one of the secondary emails associated with the user performing the operation was used as the
5624committer email in the current patch set, the same email will be used as the committer email in the
5625new change edit commit; otherwise, the user's preferred email will be used.
5626
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005627.Request
5628----
5629 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0
5630----
5631
5632If the fix was successfully applied, an <<edit-info,EditInfo>> describing the
5633resulting change edit is returned.
5634
5635.Response
5636----
5637 HTTP/1.1 200 OK
5638 Content-Disposition: attachment
5639 Content-Type: application/json; charset=UTF-8
5640
5641 )]}'
5642 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01005643 "commit": {
5644 "parents": [
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005645 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01005646 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005647 }
5648 ],
Edwin Kempine813c5a2019-03-13 09:51:12 +01005649 "author": {
5650 "name": "John Doe",
5651 "email": "john.doe@example.com",
5652 "date": "2013-05-07 15:21:27.000000000",
5653 "tz": 120
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005654 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005655 "committer": {
5656 "name": "Jane Doe",
5657 "email": "jane.doe@example.com",
5658 "date": "2013-05-07 15:35:43.000000000",
5659 "tz": 120
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005660 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005661 "subject": "Implement feature X",
5662 "message": "Implement feature X\n\nWith this feature ..."
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005663 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005664 "base_patch_set_number": 1,
5665 "base_revision": "674ac754f91e64a0efb8087e59a176484bd534d1"
5666 "ref": "refs/users/01/1000001/edit-42622/1"
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005667 }
5668----
5669
5670If the application failed e.g. due to conflicts with an existing change edit,
5671the response "`409 Conflict`" including an error message in the response body
5672is returned.
5673
5674.Response
5675----
5676 HTTP/1.1 409 Conflict
5677 Content-Disposition: attachment
5678 Content-Type: text/plain; charset=UTF-8
5679
5680 The existing change edit could not be merged with another tree.
5681----
5682
Sharad Bagribdb582d2022-03-26 01:32:35 -07005683[[apply-provided-fix]]
5684==== Apply Provided Fix
5685--
5686'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fix:apply'
5687--
5688Applies a list of <<fix-replacement-info,FixReplacementInfo>> loaded from the
5689<<apply-provided-fix-input,ApplyProvidedFixInput>> entity. The fixes are passed as part of the request body. The
5690application of the fixes creates a new change edit. `Apply Provided Fix` can only be applied on the current
5691patchset.
5692
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05305693If one of the secondary emails associated with the user performing the operation was used as the
5694committer email in the current patch set, the same email will be used as the committer email in the
5695new change edit commit; otherwise, the user's preferred email will be used.
5696
Sharad Bagribdb582d2022-03-26 01:32:35 -07005697.Request
5698----
5699 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fix:apply HTTP/1.0
5700 Content-Type: application/json; charset=UTF-8
5701
5702 {
5703 "fix_replacement_infos": [
5704 {
5705 "path": "abcd.txt",
5706 "range": {
5707 "start_line": 2,
5708 "start_character": 2,
5709 "end_line": 2,
5710 "end_character": 5
5711 },
5712 "replacement": "abcdefg"
5713 }
5714 ]
5715 }
5716----
5717
5718If the `ApplyProvidedFixInput` was successfully applied, an link:#edit-info[EditInfo] describing the
5719resulting change edit is returned.
5720
5721.Response
5722----
5723 HTTP/1.1 200 OK
5724 Content-Disposition: attachment
5725 Content-Type: application/json; charset=UTF-8
5726
5727 )]}'
5728 {
5729 "commit": {
5730 "commit": "bd43e48c33d2b1a03485040eba38cefc505f7997",
5731 "parents": [
5732 {
5733 "commit": "9825962f8ab6da89afebad3f5034db05fb4b7560"
5734 }
5735 ],
5736 "author": {
5737 "name": "John Doe",
5738 "email": "john.doe@example.com",
5739 "date": "2022-05-07 15:21:27.000000000",
5740 "tz": 120
5741 },
5742 "committer": {
5743 "name": "Jane Doe",
5744 "email": "jane.doe@example.com",
5745 "date": "2022-05-07 15:35:43.000000000",
5746 "tz": 120
5747 },
5748 "subject": "Implement feature X",
5749 "message": "Implement feature X\n\nWith this feature ..."
5750 },
5751 "base_patch_set_number": 1,
5752 "base_revision": "86d87686ce0ef7f7c536bfc7e9a66f5a6fa5d658",
5753 "ref": "refs/users/01/1000001/edit-1/1"
5754 }
5755----
5756
5757If the application failed due to presence of an existing change edit,
5758the response "`400 Bad Request`" including an error message in the response body
5759is returned.
5760
5761.Response
5762----
5763 HTTP/1.1 400 Bad Request
5764 Content-Disposition: attachment
5765 Content-Type: text/plain; charset=UTF-8
5766
5767 Change edit already exists. A new change edit can't be created
5768----
5769
5770If the application failed due to application on a previous patch set, the response
5771"`409 Conflict`" including an error message in the response body is returned.
5772
5773.Response
5774----
5775 HTTP/1.1 409 Conflict
5776 Content-Disposition: attachment
5777 Content-Type: text/plain; charset=UTF-8
5778
5779 A change edit may only be created for the current patch set 1,2 (and not for 1,1)
5780----
5781
Edwin Kempin682ac712013-05-14 13:40:46 +02005782[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005783=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005784--
Edwin Kempin682ac712013-05-14 13:40:46 +02005785'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005786--
Edwin Kempin682ac712013-05-14 13:40:46 +02005787
5788Lists the files that were modified, added or deleted in a revision.
5789
5790.Request
5791----
5792 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
5793----
5794
Makson Leefaf05c22018-07-26 22:42:59 +00005795As result a map is returned that maps the link:#file-id[file path] to a
5796link:#file-info[FileInfo] entry. The entries in the map are
Edwin Kempin682ac712013-05-14 13:40:46 +02005797sorted by file path.
5798
5799.Response
5800----
5801 HTTP/1.1 200 OK
5802 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005803 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02005804
5805 )]}'
5806 {
5807 "/COMMIT_MSG": {
5808 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02005809 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01005810 "size_delta": 551,
5811 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02005812 },
5813 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
5814 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02005815 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01005816 "size_delta": 98,
5817 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02005818 }
5819 }
5820----
5821
Shawn Pearce984747d2013-07-18 00:42:16 -07005822The request parameter `reviewed` changes the response to return a list
5823of the paths the caller has marked as reviewed. Clients that also
5824need the FileInfo should make two requests.
5825
Shawn Pearce8ca03a62015-01-02 22:03:20 -08005826The request parameter `q` changes the response to return a list
5827of all files (modified or unmodified) that contain that substring
5828in the path name. This is useful to implement suggestion services
David Pursehousefcfb29d2019-08-01 12:55:16 +09005829finding a file by partial name. Clients that also need the FileInfo
5830should make two requests.
Shawn Pearce8ca03a62015-01-02 22:03:20 -08005831
David Pursehouse89c00ca2019-08-03 13:47:29 +09005832For merge commits only, the integer-valued request parameter `parent`
5833changes the response to return a map of the files which are different
5834in this commit compared to the given parent commit. The value is the
Andrii Shyshkalov350a4512019-09-23 02:26:33 -070058351-based index of the parent's position in the commit object,
5836with the first parent always belonging to the target branch. If not
David Pursehouse89c00ca2019-08-03 13:47:29 +09005837specified, the response contains a map of the files different in the
5838auto merge result.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005839
David Pursehousefcfb29d2019-08-01 12:55:16 +09005840The request parameter `base` changes the response to return a map of the
5841files which are different in this commit compared to the given revision. The
5842revision must correspond to a patch set in the change.
5843
5844The `reviewed`, `q`, `parent`, and `base` options are mutually exclusive.
5845That is, only one of them may be used at a time.
Shawn Pearce984747d2013-07-18 00:42:16 -07005846
5847.Request
5848----
5849 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
5850----
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005851
Shawn Pearce984747d2013-07-18 00:42:16 -07005852.Response
5853----
5854 HTTP/1.1 200 OK
5855 Content-Disposition: attachment
5856 Content-Type: application/json; charset=UTF-8
5857
5858 )]}'
5859 [
Edwin Kempinaef44b02013-05-07 16:15:55 +02005860 "/COMMIT_MSG",
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005861 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005862 ]
Edwin Kempinbea55a52013-05-14 13:53:39 +02005863----
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005864
Edwin Kempinaef44b02013-05-07 16:15:55 +02005865[[get-content]]
5866=== Get Content
5867--
5868'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content'
5869--
5870
5871Gets the content of a file from a certain revision.
5872
Patrick Hiesel38667d42017-05-02 13:12:48 +02005873The optional, integer-valued `parent` parameter can be specified to request
5874the named file from a parent commit of the specified revision. The value is
5875the 1-based index of the parent's position in the commit object. If the
5876parameter is omitted or the value is non-positive, the patch set is referenced.
5877
Edwin Kempinaef44b02013-05-07 16:15:55 +02005878.Request
5879----
5880 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
5881----
5882
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05005883The content is returned as base64 encoded string. The HTTP response
5884Content-Type is always `text/plain`, reflecting the base64 wrapping.
5885A Gerrit-specific `X-FYI-Content-Type` header is returned describing
5886the server detected content type of the file.
5887
5888If only the content type is required, callers should use HEAD to
5889avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02005890
5891.Response
5892----
5893 HTTP/1.1 200 OK
5894 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05005895 Content-Type: text/plain; charset=ISO-8859-1
5896 X-FYI-Content-Encoding: base64
5897 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02005898
5899 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
5900----
5901
David Ostrovskyd0078672015-02-06 21:51:04 +01005902Alternatively, if the only value of the Accept request header is
5903`application/json` the content is returned as JSON string and
5904`X-FYI-Content-Encoding` is set to `json`.
5905
David Pletcherd1efb452015-09-01 17:45:55 -07005906[[get-safe-content]]
5907=== Download Content
5908--
5909'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
5910--
5911
5912Downloads the content of a file from a certain revision, in a safe format
5913that poses no risk for inadvertent execution of untrusted code.
5914
5915If the content type is defined as safe, the binary file content is returned
5916verbatim. If the content type is not safe, the file is stored inside a ZIP
5917file, containing a single entry with a random, unpredictable name having the
5918same base and suffix as the true filename. The ZIP file is returned in
5919verbatim binary form.
5920
5921See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
5922for information about safe file type configuration.
5923
5924The HTTP resource Content-Type is dependent on the file type: the
5925applicable type for safe files, or "application/zip" for unsafe files.
5926
David Pletcherec622bf2015-09-18 14:30:05 -07005927The optional, integer-valued `parent` parameter can be specified to request
5928the named file from a parent commit of the specified revision. The value is
5929the 1-based index of the parent's position in the commit object. If the
5930parameter is omitted or the value non-positive, the patch set is referenced.
5931
5932Filenames are decorated with a suffix of `_new` for the current patch,
5933`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07005934
5935.Request
5936----
David Pursehouse6147f6d2016-10-18 05:40:44 +00005937 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/download HTTP/1.0
David Pletcherd1efb452015-09-01 17:45:55 -07005938----
5939
5940.Response
5941----
5942 HTTP/1.1 200 OK
5943 Content-Disposition: attachment; filename="logo.png"
5944 Content-Type: image/png
5945
5946 `[binary data for logo.png]`
5947----
5948
5949.Request
5950----
David Pursehouse6147f6d2016-10-18 05:40:44 +00005951 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 -07005952----
5953
5954.Response
5955----
5956 HTTP/1.1 200 OK
5957 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
5958 Content-Type:application/zip
5959
5960 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
5961----
5962
David Pursehouse882aef22013-06-05 10:56:37 +09005963[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005964=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005965--
David Pursehouse882aef22013-06-05 10:56:37 +09005966'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 -08005967--
David Pursehouse882aef22013-06-05 10:56:37 +09005968
5969Gets the diff of a file from a certain revision.
5970
5971.Request
5972----
5973 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
5974----
5975
5976As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
5977
5978.Response
5979----
5980 HTTP/1.1 200 OK
5981 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005982 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005983
5984 )]
5985 {
5986 "meta_a": {
5987 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005988 "content_type": "text/x-java-source",
5989 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09005990 },
5991 "meta_b": {
5992 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005993 "content_type": "text/x-java-source",
5994 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005995 },
5996 "change_type": "MODIFIED",
5997 "diff_header": [
5998 "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",
5999 "index 59b7670..9faf81c 100644",
6000 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
6001 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
6002 ],
6003 "content": [
6004 {
6005 "ab": [
6006 "// Copyright (C) 2010 The Android Open Source Project",
6007 "//",
6008 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
6009 "// you may not use this file except in compliance with the License.",
6010 "// You may obtain a copy of the License at",
6011 "//",
6012 "// http://www.apache.org/licenses/LICENSE-2.0",
6013 "//",
6014 "// Unless required by applicable law or agreed to in writing, software",
6015 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
6016 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
6017 "// See the License for the specific language governing permissions and",
6018 "// limitations under the License."
6019 ]
6020 },
6021 {
6022 "b": [
6023 "//",
6024 "// Add some more lines in the header."
6025 ]
6026 },
6027 {
6028 "ab": [
6029 "",
6030 "package com.google.gerrit.server.project;",
6031 "",
6032 "import com.google.common.collect.Maps;",
6033 ...
6034 ]
6035 }
6036 ...
6037 ]
6038 }
6039----
6040
6041If the `intraline` parameter is specified, intraline differences are included in the diff.
6042
6043.Request
6044----
6045 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
6046----
6047
6048.Response
6049----
6050 HTTP/1.1 200 OK
6051 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09006052 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09006053
6054 )]
6055 {
6056 "meta_a": {
6057 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08006058 "content_type": "text/x-java-source",
6059 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09006060 },
6061 "meta_b": {
6062 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08006063 "content_type": "text/x-java-source",
6064 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09006065 },
6066 "change_type": "MODIFIED",
6067 "diff_header": [
6068 "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",
6069 "index 59b7670..9faf81c 100644",
6070 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
6071 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
6072 ],
6073 "content": [
6074 ...
6075 {
6076 "a": [
6077 "/** Manages access control for Git references (aka branches, tags). */"
6078 ],
6079 "b": [
6080 "/** Manages access control for the Git references (aka branches, tags). */"
6081 ],
6082 "edit_a": [],
6083 "edit_b": [
6084 [
6085 31,
6086 4
6087 ]
6088 ]
6089 }
6090 ]
6091 }
6092----
6093
6094The `base` parameter can be specified to control the base patch set from which the diff should
6095be generated.
6096
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01006097The integer-valued request parameter `parent` can be specified to control the
6098parent commit number against which the diff should be generated. This is useful
6099for supporting review of merge commits. The value is the 1-based index of the
6100parent's position in the commit object.
6101
David Pursehouse882aef22013-06-05 10:56:37 +09006102.Request
6103----
6104 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
6105----
6106
6107.Response
6108----
6109 HTTP/1.1 200 OK
6110 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09006111 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09006112
6113 )]
6114 {
6115 "meta_a": {
6116 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08006117 "content_type": "text/x-java-source",
6118 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09006119 },
6120 "meta_b": {
6121 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08006122 "content_type": "text/x-java-source",
6123 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09006124 },
6125 "change_type": "MODIFIED",
6126 "content": [
6127 {
6128 "skip": 578
6129 }
6130 ]
6131 }
6132----
6133
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01006134The `whitespace` parameter can be specified to control how whitespace
6135differences are reported in the result. Valid values are `IGNORE_NONE`,
6136`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09006137
Sharad Bagri3f6ed642022-06-06 12:41:57 -07006138[[preview-stored-fix]]
6139=== Preview Stored Fix
Dmitrii Filippovbf3f08b2019-12-06 03:13:06 +01006140--
6141'GET /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/preview'
6142--
6143
6144Gets the diffs of all files for a certain <<fix-id,\{fix-id\}>>.
6145As response, a map of link:#diff-info[DiffInfo] entities is returned that describes the diffs.
6146
6147Each link:#diff-info[DiffInfo] is the differences between the patch set indicated by revision-id and a virtual patch set with the applied fix.
6148
Sharad Bagrid1b05fd2022-05-18 13:14:17 -07006149[[preview-provided-fix]]
6150=== Preview Provided fix
6151--
6152'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fix:preview'
6153--
6154
6155Gets the diffs of all files for a list of <<fix-replacement-info,FixReplacementInfo>> loaded from
6156the <<apply-provided-fix-input,ApplyProvidedFixInput>> entity. The fixes are passed as part of the
6157request body.
6158As response, a map of link:#diff-info[DiffInfo] is returned that describes the diffs.
6159
6160Each link:#diff-info[DiffInfo] is the differences between the patch set indicated by revision-id
6161and a virtual patch set with the applied fix. No content on the server will be modified as part of this request.
6162
6163.Request
6164----
6165 POST /changes/myProject~master~Id6f0b9d946791f8aba90ace53074eda565983452/revisions/1/fix:preview HTTP/1.0
6166 Content-Type: application/json; charset=UTF-8
6167
6168 {
6169 "fix_replacement_infos": [
6170 {
6171 "path": "abcd.txt",
6172 "range": {
6173 "start_line": 2,
6174 "start_character": 2,
6175 "end_line": 2,
6176 "end_character": 5
6177 },
6178 "replacement": "abcdefg"
6179 }
6180 ]
6181 }
6182----
6183
6184If the `Preview Provided Fix` operation was successful, a link:#diff-info[DiffInfo] previewing the
6185change is returned.
6186
6187.Response
6188----
6189 HTTP/1.1 200 OK
6190 Content-Disposition: attachment
6191 Content-Type: application/json; charset=UTF-8
6192
6193 )]}'
6194 {
6195 "abcd.txt": {
6196 "meta_a": {
6197 "name": "abcd.txt",
6198 "content_type": "text/plain",
6199 "lines": 3
6200 },
6201 "meta_b": {
6202 "name": "abcd.txt",
6203 "content_type": "text/plain",
6204 "lines": 3
6205 },
6206 "intraline_status": "OK",
6207 "change_type": "MODIFIED",
6208 "content": [
6209 {
6210 "ab": [
6211 "ABCDEFGHI"
6212 ]
6213 },
6214 {
6215 "a": [
6216 "JKLMNOPQR"
6217 ],
6218 "b": [
6219 "JKabcdefgOPQR"
6220 ],
6221 "edit_a": [
6222 [
6223 2,
6224 3
6225 ]
6226 ],
6227 "edit_b": [
6228 [
6229 2,
6230 7
6231 ]
6232 ]
6233 },
6234 {
6235 "ab": [
6236 ""
6237 ]
6238 }
6239 ]
6240 }
6241 }
6242----
6243
6244
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006245[[get-blame]]
6246=== Get Blame
6247--
6248'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
6249--
6250
6251Gets the blame of a file from a certain revision.
6252
6253.Request
6254----
6255 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
6256----
6257
6258As response a link:#blame-info[BlameInfo] entity is returned that describes the
6259blame.
6260
6261.Response
6262----
6263 HTTP/1.1 200 OK
6264 Content-Disposition: attachment
6265 Content-Type: application/json; charset=UTF-8
6266
6267 )]
6268 {
6269 [
6270 {
6271 "author": "Joe Daw",
6272 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
6273 "time": 1421441349,
6274 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
6275 "ranges": [
6276 {
6277 "start": 1,
6278 "end": 10
6279 },
6280 {
6281 "start": 16,
6282 "end": 296
6283 }
6284 ]
6285 },
6286 {
6287 "author": "Jane Daw",
6288 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
6289 "time": 1421825421,
6290 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
6291 "ranges": [
6292 {
6293 "start": 13,
6294 "end": 13
6295 }
6296 ]
6297 }
6298 ]
6299 }
6300----
6301
6302The `base` parameter can be specified to control the base patch set from which
6303the blame should be generated.
6304
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006305[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006306=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08006307--
Edwin Kempinbea55a52013-05-14 13:53:39 +02006308'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 -08006309--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01006310
Edwin Kempinbea55a52013-05-14 13:53:39 +02006311Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006312
6313.Request
6314----
6315 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
6316----
6317
6318.Response
6319----
6320 HTTP/1.1 201 Created
6321----
6322
Edwin Kempinbea55a52013-05-14 13:53:39 +02006323If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006324response is "`200 OK`".
6325
6326[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006327=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08006328--
Edwin Kempinbea55a52013-05-14 13:53:39 +02006329'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 -08006330--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01006331
Edwin Kempinbea55a52013-05-14 13:53:39 +02006332Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006333
6334.Request
6335----
6336 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
6337----
6338
6339.Response
6340----
6341 HTTP/1.1 204 No Content
6342----
6343
Gustaf Lundh019fb262012-11-28 14:20:22 +01006344[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006345=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08006346--
Gustaf Lundh019fb262012-11-28 14:20:22 +01006347'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08006348--
Gustaf Lundh019fb262012-11-28 14:20:22 +01006349
6350Cherry picks a revision to a destination branch.
6351
Yash Chaturvedi28bb35e2023-07-09 16:45:18 +05306352If one of the secondary emails associated with the user performing the operation was used as the
6353committer email in the original revision, the same email will be used as the committer email
6354in the new patch set; otherwise, the user's preferred email will be used.
6355
Changcheng Xiao54b6c0c2017-10-23 14:57:42 +02006356To cherry pick a commit with no change-id associated with it, see
6357link:rest-api-projects.html#cherry-pick-commit[CherryPickCommit].
6358
Gustaf Lundh019fb262012-11-28 14:20:22 +01006359The commit message and destination branch must be provided in the request body inside a
Han-Wen Nienhuys02272e02017-03-28 14:47:09 +02006360link:#cherrypick-input[CherryPickInput] entity. If the commit message
6361does not specify a Change-Id, a new one is picked for the destination change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01006362
Gal Paikin8dadd422021-05-07 10:21:54 +02006363When cherry-picking a change into a branch that already contains the Change-Id
6364that we want to cherry-pick, the cherry-pick will create a new patch-set on the
6365destination's branch's appropriate Change-Id. If the change is closed on the
6366destination branch, the cherry-pick will fail.
6367
Gustaf Lundh019fb262012-11-28 14:20:22 +01006368.Request
6369----
6370 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09006371 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01006372
6373 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01006374 "message" : "Implementing Feature X",
6375 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01006376 }
6377----
6378
Edwin Kempinaab27d32020-01-29 13:17:04 +01006379As response a link:#change-info[ChangeInfo] entity is returned that
6380describes the resulting cherry-pick change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01006381
6382.Response
6383----
6384 HTTP/1.1 200 OK
6385 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09006386 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01006387
6388 )]}'
6389 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01006390 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
6391 "project": "myProject",
6392 "branch": "release-branch",
6393 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
6394 "subject": "Implementing Feature X",
6395 "status": "NEW",
6396 "created": "2013-02-01 09:59:32.126000000",
6397 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01006398 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01006399 "insertions": 12,
6400 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01006401 "_number": 3965,
6402 "owner": {
6403 "name": "John Doe"
6404 }
6405 }
6406----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006407
Changcheng Xiao2fcae692017-01-02 12:38:30 +01006408[[revision-reviewer-endpoints]]
6409== Revision Reviewer Endpoints
6410
6411[[list-revision-reviewers]]
6412=== List Revision Reviewers
6413--
6414'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/'
6415--
6416
6417Lists the reviewers of a revision.
6418
6419Please note that only the current revision is supported.
6420
6421As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
6422
6423.Request
6424----
6425 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0
6426----
6427
6428.Response
6429----
6430 HTTP/1.1 200 OK
6431 Content-Disposition: attachment
6432 Content-Type: application/json; charset=UTF-8
6433
6434 )]}'
6435 [
6436 {
6437 "approvals": {
6438 "Verified": "+1",
6439 "Code-Review": "+2"
6440 },
6441 "_account_id": 1000096,
6442 "name": "John Doe",
6443 "email": "john.doe@example.com"
6444 },
6445 {
6446 "approvals": {
6447 "Verified": " 0",
6448 "Code-Review": "-1"
6449 },
6450 "_account_id": 1000097,
6451 "name": "Jane Roe",
6452 "email": "jane.roe@example.com"
6453 }
6454 ]
6455----
6456
6457[[list-revision-votes]]
6458=== List Revision Votes
6459--
6460'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
6461--
6462
6463Lists the votes for a specific reviewer of the revision.
6464
6465Please note that only the current revision is supported.
6466
6467.Request
6468----
6469 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0
6470----
6471
6472As result a map is returned that maps the label name to the label value.
6473The entries in the map are sorted by label name.
6474
6475.Response
6476----
6477 HTTP/1.1 200 OK
6478 Content-Disposition: attachment
6479 Content-Type: application/json;charset=UTF-8
6480
6481 )]}'
6482 {
6483 "Code-Review": -1,
6484 "Verified": 1,
6485 "Work-In-Progress": 1
6486 }
6487----
6488
6489[[delete-revision-vote]]
6490=== Delete Revision Vote
6491--
6492'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
6493/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' +
6494'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
6495/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete'
6496--
6497
6498Deletes a single vote from a revision. The deletion will be possible only
6499if the revision is the current revision. By using this endpoint you can prevent
6500deleting the vote (with same label) from a newer patch set by mistake.
6501
6502Note, that even when the last vote of a reviewer is removed the reviewer itself
6503is still listed on the change.
6504
Gal Paikin6ce56dc2021-03-29 12:28:43 +02006505If another user removed a user's vote, the user with the deleted vote will be
6506added to the attention set.
6507
Changcheng Xiao2fcae692017-01-02 12:38:30 +01006508.Request
6509----
6510 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
6511 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
6512----
6513
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02006514Options can be provided in the request body as a
6515link:#delete-vote-input[DeleteVoteInput] entity.
6516Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01006517link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02006518In this case, use a POST request instead:
Changcheng Xiao2fcae692017-01-02 12:38:30 +01006519
6520.Request
6521----
6522 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
6523 Content-Type: application/json; charset=UTF-8
6524
6525 {
6526 "notify": "NONE"
6527 }
6528----
6529
6530.Response
6531----
6532 HTTP/1.1 204 No Content
6533----
6534
Gal Paikinc326de42020-06-16 18:49:00 +03006535[[attention-set-endpoints]]
6536== Attention Set Endpoints
6537
6538[[get-attention-set]]
6539=== Get Attention Set
6540--
6541'GET /changes/link:#change-id[\{change-id\}]/attention'
6542--
6543
6544Returns all users that are currently in the attention set.
6545As response a list of link:#attention-set-info[AttentionSetInfo]
6546entity is returned.
6547
6548.Request
6549----
6550 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
6551----
6552
6553.Response
6554----
6555 HTTP/1.1 200 OK
6556 Content-Disposition: attachment
6557 Content-Type: application/json; charset=UTF-8
6558
6559 )]}'
6560 [
6561 {
6562 "account": {
6563 "_account_id": 1000096,
6564 "name": "John Doe",
6565 "email": "john.doe@example.com",
6566 "username": "jdoe"
6567 },
6568 "last_update": "2013-02-01 09:59:32.126000000",
6569 "reason": "reviewer or cc replied"
6570 },
6571 {
6572 "account": {
6573 "_account_id": 1000097,
6574 "name": "Jane Doe",
6575 "email": "jane.doe@example.com",
6576 "username": "janedoe"
6577 },
6578 "last_update": "2013-02-01 09:59:32.126000000",
6579 "reason": "Reviewer was added"
6580 }
6581 ]
6582----
6583
6584[[add-to-attention-set]]
6585=== Add To Attention Set
6586--
6587'POST /changes/link:#change-id[\{change-id\}]/attention'
6588--
6589
6590Adds a single user to the attention set of a change.
6591
6592A user can only be added if they are not in the attention set.
6593If a user is added while already in the attention set, the
6594request is silently ignored.
6595
Gal Paikine631de22020-10-29 12:19:11 +01006596The user must be a reviewer, cc, uploader, or owner on the change.
6597
Gal Paikinc326de42020-06-16 18:49:00 +03006598.Request
6599----
6600 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
6601----
6602
6603Details should be provided in the request body as an
6604link:#attention-set-input[AttentionSetInput] entity.
6605
6606.Request
6607----
6608 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
6609 Content-Type: application/json; charset=UTF-8
6610
6611 {
6612 "user": "John Doe",
6613 "reason": "reason"
6614 }
6615----
6616
6617.Response
6618----
6619 HTTP/1.1 200 OK
6620 Content-Disposition: attachment
6621 Content-Type: application/json; charset=UTF-8
6622
6623 )]}'
6624 {
6625 "_account_id": 1000096,
6626 "name": "John Doe",
6627 "email": "john.doe@example.com",
6628 "username": "jdoe"
6629 }
6630----
6631
6632[[remove-from-attention-set]]
6633=== Remove from Attention Set
6634--
6635'DELETE /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]' +
6636'POST /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]/delete'
6637--
6638
6639Deletes a single user from the attention set of a change.
6640
6641A user can only be removed from the attention set if they
6642are currently in the attention set. Otherwise, the request
6643is silently ignored.
6644
6645.Request
6646----
6647 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe HTTP/1.0
6648 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0
6649----
6650
6651Reason can be provided in the request body as an
6652link:#attention-set-input[AttentionSetInput] entity.
6653
6654User must be left empty, or the user must be exactly
6655the same user as in the request header.
6656
6657.Request
6658----
6659 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0
6660 Content-Type: application/json; charset=UTF-8
6661
6662 {
6663 "reason": "reason"
6664 }
6665----
6666
6667.Response
6668----
6669 HTTP/1.1 204 No Content
6670----
6671
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006672[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006673== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006674
Edwin Kempina3d02ef2013-02-22 16:31:53 +01006675[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006676=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01006677--
6678--
6679
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006680[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006681=== \{change-id\}
Patrick Hiesel18da0452017-12-21 14:02:05 +01006682Identifier that uniquely identifies one change. It contains the URL-encoded
Edwin Kempin00ecc022023-07-26 06:49:09 +00006683project name as well as the change number: "<project>~<changeNumber>"
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006684
Sven Selberg78ce9f42023-01-05 14:41:04 +01006685==== Alternative identifiers
6686Gerrit also supports an array of other change identifiers.
6687
6688[NOTE]
Sven Selbergaaf8ed82023-01-11 11:44:08 +00006689Even though these identifiers will work in the majority of cases it is highly
Edwin Kempin00ecc022023-07-26 06:49:09 +00006690recommended to use "<project>~<changeNumber>" whenever possible.
Sven Selbergaaf8ed82023-01-11 11:44:08 +00006691Since these identifiers require additional lookups from index and caches, to
Edwin Kempin00ecc022023-07-26 06:49:09 +00006692be translated to the "<project>~<changeNumber>" identifier, they
Sven Selbergaaf8ed82023-01-11 11:44:08 +00006693may result in both false-positives and false-negatives.
6694Furthermore the additional lookup mean that they come with a performance penalty.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006695
Edwin Kempin00ecc022023-07-26 06:49:09 +00006696* an ID of the change in the format "<project>~<branch>~<Change-Id>",
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006697 where for the branch the `refs/heads/` prefix can be omitted
Edwin Kempin00ecc022023-07-26 06:49:09 +00006698 ("myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940")
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006699* a Change-Id if it uniquely identifies one change
6700 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
Sven Selberg45ca1782023-01-09 08:32:27 +00006701* a change number if it uniquely identifies one change ("4247")
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006702
Changcheng Xiaod61590f2018-04-30 10:59:14 +02006703[[change-message-id]]
6704=== \{change-message-id\}
6705ID of a change message returned in a link:#change-message-info[ChangeMessageInfo].
6706
John Spurlock5e402f02013-03-24 11:35:04 -04006707[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006708=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04006709UUID of a published comment.
6710
Edwin Kempin3ca57192013-02-27 07:44:01 +01006711[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006712=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01006713UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006714
David Ostrovskybeb0b842014-12-13 00:24:29 +01006715[[label-id]]
6716=== \{label-id\}
6717The name of the label.
6718
Edwin Kempinbea55a52013-05-14 13:53:39 +02006719[[file-id]]
David Pursehouseb10c2662016-12-06 08:41:33 +09006720=== \{file-id\}
Edwin Kempinbea55a52013-05-14 13:53:39 +02006721The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006722
David Pursehouse11badbb2017-03-27 10:58:05 +09006723The following magic paths are supported:
6724
6725* `/COMMIT_MSG`:
6726+
6727The commit message and headers with the parent commit(s), the author
6728information and the committer information.
6729
6730* `/MERGE_LIST` (for merge commits only):
6731+
6732The list of commits that are being integrated into the destination
6733branch by submitting the merge commit.
6734
Gal Paikin3edc1422020-03-19 12:04:52 +01006735* `/PATCHSET_LEVEL`:
6736+
6737This file path is used exclusively for posting and indicating
6738patchset-level comments, thus not relevant for other use-cases.
6739
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006740[[fix-id]]
6741=== \{fix-id\}
6742UUID of a suggested fix.
6743
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006744[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006745=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006746Identifier that uniquely identifies one revision of a change.
6747
6748This can be:
6749
Shawn Pearce9c0722a2013-03-02 15:30:31 -08006750* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006751* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
6752* an abbreviated commit ID that uniquely identifies one revision of the
6753 change ("674ac754"), at least 4 digits are required
Edwin Kempin2582c982022-12-27 15:47:59 +01006754* a numeric patch number ("1" for first patch set of the change)
Edwin Kempin8cc0bab2016-09-15 15:53:37 +02006755* "0" or the literal `edit` for a change edit
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006756
Edwin Kempine3446292013-02-19 16:40:14 +01006757[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006758== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01006759
Edwin Kempined5364b2013-02-22 10:39:33 +01006760[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006761=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01006762The `AbandonInput` entity contains information for abandoning a change.
6763
David Pursehouseae367192014-11-25 17:24:47 +09006764[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006765|=============================
6766|Field Name ||Description
6767|`message` |optional|
Edwin Kempined5364b2013-02-22 10:39:33 +01006768Message to be added as review comment to the change when abandoning the
6769change.
Edwin Kempincd07df42016-12-01 09:10:09 +01006770|`notify` |optional|
Stephen Lie5fcdf72016-08-02 11:05:11 -07006771Notify handling that defines to whom email notifications should be sent after
6772the change is abandoned. +
6773Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6774If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006775|`notify_details`|optional|
6776Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03006777of link:user-notify.html#recipient-types[recipient type] to
6778link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01006779|=============================
Edwin Kempined5364b2013-02-22 10:39:33 +01006780
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006781[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006782=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006783The `ActionInfo` entity describes a REST API call the client can
6784make to manipulate a resource. These are frequently implemented by
6785plugins and may be discovered at runtime.
6786
David Pursehouseae367192014-11-25 17:24:47 +09006787[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006788|====================================
6789|Field Name ||Description
6790|`method` |optional|
6791HTTP method to use with the action. Most actions use `POST`, `PUT`
6792or `DELETE` to cause state changes.
6793|`label` |optional|
6794Short title to display to a user describing the action. In the
6795Gerrit web interface the label is used as the text on the button
6796presented in the UI.
6797|`title` |optional|
6798Longer text to display describing the action. In a web UI this
6799should be the title attribute of the element, displaying when
6800the user hovers the mouse.
6801|`enabled` |optional|
6802If true the action is permitted at this time and the caller is
6803likely allowed to execute it. This may change if state is updated
6804at the server or permissions are modified. Not present if false.
Edwin Kempinccc9da02023-01-23 17:57:15 +01006805|`enabled_options` |optional|
6806Optional list of enabled options. +
Edwin Kempinb7c80b52023-03-02 12:30:20 +01006807See the list of suppported options link:#action-options[below].
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006808|====================================
6809
Edwin Kempinccc9da02023-01-23 17:57:15 +01006810[[action-options]]
6811==== Action Options
6812
6813Options that are returned via the `enabled_options` field of
6814link:#action-info[ActionInfo].
6815
6816[options="header",cols="1,^1,5"]
Edwin Kempin3d082a82023-02-23 16:33:12 +01006817|===================================
6818|REST view |Option |Description
6819|`rebase` |`rebase`|
Edwin Kempinccc9da02023-01-23 17:57:15 +01006820Present if the user can rebase the change. +
6821This is the case for the change owner and users with the
6822link:access-control.html#category_submit[Submit] or
6823link:access-control.html#category_rebase[Rebase] permission if they
6824have the link:access-control.html#category_push[Push] permission.
Edwin Kempinc8e0a062023-03-16 11:04:13 +01006825|`rebase` |`rebase_on_behalf_of_uploader`|
Edwin Kempinccc9da02023-01-23 17:57:15 +01006826Present if the user can rebase the change on behalf of the uploader. +
6827This is the case for the change owner and users with the
6828link:access-control.html#category_submit[Submit] or
6829link:access-control.html#category_rebase[Rebase] permission.
Edwin Kempin3d082a82023-02-23 16:33:12 +01006830|`rebase:chain`|`rebase`|
6831Present if the user can rebase the chain. +
6832This is the case if the calling user can rebase each change in the
Edwin Kempinf40b1f82023-03-31 09:40:08 +00006833chain.
Edwin Kempin3d082a82023-02-23 16:33:12 +01006834Rebasing a change is allowed for the change owner and users with the
6835link:access-control.html#category_submit[Submit] or
6836link:access-control.html#category_rebase[Rebase] permission if they
6837have the link:access-control.html#category_push[Push] permission.
Edwin Kempinc8e0a062023-03-16 11:04:13 +01006838|`rebase:chain`|`rebase_on_behalf_of_uploader`|
Edwin Kempin3d082a82023-02-23 16:33:12 +01006839Present if the user can rebase the chain on behalf of the uploader. +
6840This is the case if the calling user can rebase each change in the
Edwin Kempinf40b1f82023-03-31 09:40:08 +00006841chain on behalf of the uploader.
Edwin Kempin3d082a82023-02-23 16:33:12 +01006842Rebasing a change on behalf of the uploader is allowed for the change
6843owner and users with the link:access-control.html#category_submit[Submit]
6844or link:access-control.html#category_rebase[Rebase] permission.
6845|===================================
Edwin Kempinccc9da02023-01-23 17:57:15 +01006846
6847For all other REST views no options are returned.
6848
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03006849[[applypatch-input]]
6850=== ApplyPatchInput
6851The `ApplyPatchInput` entity contains information about a patch to apply.
6852
6853A new commit will be created from the patch, and saved as a new patch set.
6854
6855[options="header",cols="1,^1,5"]
6856|=================================
6857|Field Name ||Description
6858|`patch` |required|
6859The patch to be applied. Must be compatible with `git diff` output.
6860For example, link:#get-patch[Get Patch] output.
Nitzan Gur-Furmancf722f62023-02-15 20:40:33 +01006861The patch must be provided as UTF-8 text, either directly or base64-encoded.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03006862|=================================
6863
6864[[applypatchpatchset-input]]
6865=== ApplyPatchPatchSetInput
6866The `ApplyPatchPatchSetInput` entity contains information for creating a new patch set from a
6867given patch.
6868
6869[options="header",cols="1,^1,5"]
6870|=================================
6871|Field Name ||Description
6872|`patch` |required|
6873The details of the patch to be applied as a link:#applypatch-input[ApplyPatchInput] entity.
6874|`commit_message` |optional|
Nitzan Gur-Furman90398482023-02-23 09:48:24 +01006875The commit message for the new patch set. If not specified, the latest patch-set message will be
6876used.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03006877|`base` |optional|
687840-hex digit SHA-1 of the commit which will be the parent commit of the newly created patch set.
6879If set, it must be a merged commit or a change revision on the destination branch.
6880Otherwise, the target change's branch tip will be used.
6881|`author` |optional|
6882The author of the commit to create. Must be an
6883link:rest-api-accounts.html#account-input[AccountInput] entity with at least
6884the `name` and `email` fields set.
6885The caller needs "Forge Author" permission when using this field, unless specifies their own details.
6886This field does not affect the owner of the change, which will continue to use the identity of the
6887caller.
Patrick Hiesele6759d52023-02-21 15:24:15 +01006888|`response_format_options` |optional|
6889List of link:#query-options[query options] to format the response.
Patrick Hiesel257539f2023-06-23 13:36:05 +02006890|`amend` |optional|
6891If true, the revision from the URL will be amended by the patch. This will use the tree of the
6892revision, apply the patch and create a new commit whose tree is the resulting tree of the operation
6893and whose parent(s) are the parent(s) of the revision. Cannot be used together with `base`.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03006894|=================================
6895
6896
Edwin Kempine3446292013-02-19 16:40:14 +01006897[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006898=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006899The `ApprovalInfo` entity contains information about an approval from a
6900user for a label on a change.
6901
Edwin Kempin963dfd02013-02-27 12:39:32 +01006902`ApprovalInfo` has the same fields as
6903link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01006904In addition `ApprovalInfo` has the following fields:
6905
David Pursehouseae367192014-11-25 17:24:47 +09006906[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006907|===========================
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006908|Field Name ||Description
6909|`value` |optional|
Dave Borowitza30db912013-03-22 14:20:33 -07006910The vote that the user has given for the label. If present and zero, the
6911user is permitted to vote on the label. If absent, the user is not
6912permitted to vote on that label.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006913|`permitted_voting_range` |optional|
6914The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote
6915on that label. If present, the user is permitted to vote on the label
6916regarding the range values. If absent, the user is not permitted to vote
6917on that label.
6918|`date` |optional|
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01006919The time and date describing when the approval was made.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006920|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006921Value of the `tag` field from link:#review-input[ReviewInput] set
Vitaliy Lotorevea882812018-06-28 20:16:39 +00006922while posting the review. Votes/comments that contain `tag` with
6923'autogenerated:' prefix can be filtered out in the web UI.
6924NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006925invocations of the REST call are required.
Dave Borowitze47fe472016-09-09 13:57:14 -04006926|`post_submit` |not set if `false`|
6927If true, this vote was made after the change was submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01006928|===========================
6929
Gal Paikinc326de42020-06-16 18:49:00 +03006930[[attention-set-info]]
6931=== AttentionSetInfo
6932The `AttentionSetInfo` entity contains details of users that are in
Edwin Kempinc9219002023-09-08 08:07:21 +00006933the link:user-attention-set.html[attention set].
Gal Paikinc326de42020-06-16 18:49:00 +03006934
6935[options="header",cols="1,^1,5"]
6936|===========================
6937|Field Name ||Description
6938|`account` || link:rest-api-accounts.html#account-info[AccountInfo] entity.
6939|`last_update` || The link:rest-api.html#timestamp[timestamp] of the last update.
Marija Savtchouk25a5fd5a2021-08-06 17:26:24 +01006940|`reason` ||
6941The reason for adding or removing the user.
6942If the update was caused by another user, that account is represented by
6943account ID in reason as `<GERRIT_ACCOUNT_18419>` and the corresponding
6944link:rest-api-accounts.html#account-info[AccountInfo] can be found in `reason_account` field.
6945|`reason_account` ||
6946link:rest-api-accounts.html#account-info[AccountInfo] of the user who caused the update.
Gal Paikinc326de42020-06-16 18:49:00 +03006947
6948|===========================
6949[[attention-set-input]]
6950=== AttentionSetInput
6951The `AttentionSetInput` entity contains details for adding users to the
Edwin Kempinc9219002023-09-08 08:07:21 +00006952link:user-attention-set.html[attention set] and removing them from it.
Gal Paikinc326de42020-06-16 18:49:00 +03006953
6954[options="header",cols="1,^1,5"]
6955|===========================
Gal Paikinf2b1b332020-07-06 16:34:36 +03006956|Field Name ||Description
6957|`user` |optional| link:rest-api-accounts.html#account-id[ID]
Gal Paikinc326de42020-06-16 18:49:00 +03006958of the account that should be added to the attention set. For removals,
6959this field should be empty or the same as the field in the request header.
Gal Paikinf2b1b332020-07-06 16:34:36 +03006960|`reason` || The reason of for adding or removing the user.
6961|`notify` |optional|
6962Notify handling that defines to whom email notifications should be sent
6963after the change is created. +
6964Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6965If not set, the default is `OWNER`.
6966|`notify_details` |optional|
6967Additional information about whom to notify about the change creation
Gal Paikin1ae8b462020-07-27 15:50:59 +03006968as a map of link:user-notify.html#recipient-types[recipient type] to
6969link:#notify-info[NotifyInfo] entity.
Gal Paikinc326de42020-06-16 18:49:00 +03006970|===========================
6971
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006972[[blame-info]]
6973=== BlameInfo
6974The `BlameInfo` entity stores the commit metadata with the row coordinates where
6975it applies.
6976
6977[options="header",cols="1,6"]
6978|===========================
6979|Field Name | Description
6980|`author` | The author of the commit.
6981|`id` | The id of the commit.
6982|`time` | Commit time.
6983|`commit_msg` | The commit message.
6984|`ranges` |
6985The blame row coordinates as link:#range-info[RangeInfo] entities.
6986|===========================
6987
Edwin Kempin521c1242015-01-23 12:44:44 +01006988[[change-edit-input]]
6989=== ChangeEditInput
6990The `ChangeEditInput` entity contains information for restoring a
6991path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02006992
Edwin Kempin521c1242015-01-23 12:44:44 +01006993[options="header",cols="1,^1,5"]
6994|===========================
6995|Field Name ||Description
6996|`restore_path`|optional|Path to file to restore.
6997|`old_path` |optional|Old path to file to rename.
6998|`new_path` |optional|New path to file to rename.
6999|===========================
7000
7001[[change-edit-message-input]]
7002=== ChangeEditMessageInput
7003The `ChangeEditMessageInput` entity contains information for changing
7004the commit message within a change edit.
7005
7006[options="header",cols="1,^1,5"]
7007|===========================
7008|Field Name ||Description
7009|`message` ||New commit message.
7010|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02007011
Edwin Kempine3446292013-02-19 16:40:14 +01007012[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007013=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007014The `ChangeInfo` entity contains information about a change.
7015
David Pursehouseae367192014-11-25 17:24:47 +09007016[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007017|==================================
7018|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01007019|`id` ||
Marija Savtchouk50735252023-04-27 12:22:44 +02007020The ID of the change. Subject to a 'GerritBackendFeature__return_new_change_info_id'
7021 experiment, the format is either "'<project>\~<_number>'" (new format),
7022or `triplet_id`. The experiment is needed to allow callers to migrate.
7023'project' and '_number' are URL encoded. The callers must not rely on the format.
7024|`triplet_id` ||
Edwin Kempine3446292013-02-19 16:40:14 +01007025The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
Alon Bar-Lev921085b2023-05-18 21:16:48 +03007026where 'project' and 'branch' are URL encoded. For 'branch' the
Marija Savtchouk50735252023-04-27 12:22:44 +02007027`refs/heads/` prefix is omitted.
Edwin Kempine3446292013-02-19 16:40:14 +01007028|`project` ||The name of the project.
7029|`branch` ||
7030The name of the target branch. +
7031The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01007032|`topic` |optional|The topic to which this change belongs.
Gal Paikinc326de42020-06-16 18:49:00 +03007033|`attention_set` |optional|
7034The map that maps link:rest-api-accounts.html#account-id[account IDs]
Gal Paikin69f20462021-11-08 17:26:42 +01007035to link:#attention-set-info[AttentionSetInfo] of that account. Those are all
7036accounts that are currently in the attention set.
7037|`removed_from_attention_set` |optional|
7038The map that maps link:rest-api-accounts.html#account-id[account IDs]
7039to link:#attention-set-info[AttentionSetInfo] of that account. Those are all
7040accounts that were in the attention set but were removed. The
7041link:#attention-set-info[AttentionSetInfo] is the latest and most recent removal
7042 of the account from the attention set.
Edwin Kempin93b74fb2017-08-25 10:42:56 +02007043|`hashtags` |optional|
Gal Paikin07a580c2021-04-15 09:47:36 +02007044List of hashtags that are set on the change.
Chris Poucetc2962dc2023-03-07 17:19:25 +01007045|`custom_keyed_values` |optional|
7046A map that maps custom keys to custom values that are tied to a specific change,
7047both in the form of strings. Only set if link:#custom-keyed-values[custom keyed
7048values] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007049|`change_id` ||The Change-Id of the change.
7050|`subject` ||
7051The subject of the change (header line of the commit message).
7052|`status` ||
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01007053The status of the change (`NEW`, `MERGED`, `ABANDONED`).
Edwin Kempine3446292013-02-19 16:40:14 +01007054|`created` ||
7055The link:rest-api.html#timestamp[timestamp] of when the change was
7056created.
7057|`updated` ||
7058The link:rest-api.html#timestamp[timestamp] of when the change was last
7059updated.
Khai Do96a7caf2016-01-07 14:07:54 -08007060|`submitted` |only set for merged changes|
7061The link:rest-api.html#timestamp[timestamp] of when the change was
7062submitted.
Dave Borowitz8ec31f92017-08-23 10:28:34 -04007063|`submitter` |only set for merged changes|
7064The user who submitted the change, as an
7065link:rest-api-accounts.html#account-info[ AccountInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01007066|`starred` |not set if `false`|
Nitzan Gur-Furman70933e52023-06-30 13:36:41 +02007067Whether the calling user has starred this change.
Youssef Elghareebf4f49482023-04-26 18:02:33 +02007068Only set if link:#star[requested].
Edwin Kempine3446292013-02-19 16:40:14 +01007069|`reviewed` |not set if `false`|
7070Whether the change was reviewed by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07007071Only set if link:#reviewed[reviewed] is requested.
Dave Borowitzace32102015-12-17 13:08:25 -05007072|`submit_type` |optional|
Changcheng Xiao21885982019-01-15 18:16:51 +01007073The link:config-project-config.html#submit-type[submit type] of the change. +
Dave Borowitzace32102015-12-17 13:08:25 -05007074Not set for merged changes.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01007075|`mergeable` |optional|
7076Whether the change is mergeable. +
Patrick Hiesela4824db2019-12-20 10:55:26 +01007077Only set for open changes if
7078link:config-gerrit.html#change.mergeabilityComputationBehavior[change.mergeabilityComputationBehavior]
7079is `API_REF_UPDATED_AND_CHANGE_REINDEX`.
Shawn Pearce4cd05b22016-09-17 22:45:33 -07007080|`submittable` |optional|
7081Whether the change has been approved by the project submit rules. +
Jonathan Niedercb51d742016-09-23 11:37:57 -07007082Only set if link:#submittable[requested].
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01007083|`insertions` ||
7084Number of inserted lines.
7085|`deletions` ||
7086Number of deleted lines.
Dave Borowitzc001f322018-10-31 14:31:08 -07007087|`total_comment_count` |optional|
7088Total number of inline comments across all patch sets. Not set if the current
7089change index doesn't have the data.
Changcheng Xiao81c48092017-02-08 13:04:07 +01007090|`unresolved_comment_count` |optional|
Dave Borowitzc001f322018-10-31 14:31:08 -07007091Number of unresolved inline comment threads across all patch sets. Not set if
7092the current change index doesn't have the data.
Ben Rohlfsb56e3552021-09-10 09:04:19 +02007093|`_number` ||
Sven Selberg45ca1782023-01-09 08:32:27 +00007094The change number. (The underscore is just a relict of a prior
7095attempt to deprecate the change number.)
Edwin Kempine3446292013-02-19 16:40:14 +01007096|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01007097The owner of the change as an link:rest-api-accounts.html#account-info[
7098AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07007099|`actions` |optional|
7100Actions the caller might be able to perform on this revision. The
7101information is a map of view name to link:#action-info[ActionInfo]
7102entities.
Youssef Elghareeb02d33aa2021-10-04 13:24:52 +02007103|`submit_records` ||
7104List of the link:rest-api-changes.html#submit-record-info[SubmitRecordInfo]
7105containing the submit records for the change at the latest patchset.
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01007106|`requirements` |optional|
7107List of the link:rest-api-changes.html#requirement[requirements] to be met before this change
Youssef Elghareeb79f473622021-05-26 18:58:40 +02007108can be submitted. This field is deprecated in favour of `submit_requirements`.
7109|`submit_requirements` |optional|
7110List of the link:#submit-requirement-result-info[SubmitRequirementResultInfo]
7111containing the evaluated submit requirements for the change.
7112Only set if link:#submit-requirements[`SUBMIT_REQUIREMENTS`] is requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007113|`labels` |optional|
7114The labels of the change as a map that maps the label names to
7115link:#label-info[LabelInfo] entries. +
7116Only set if link:#labels[labels] or link:#detailed-labels[detailed
7117labels] are requested.
7118|`permitted_labels` |optional|
7119A map of the permitted labels that maps a label name to the list of
7120values that are allowed for that label. +
7121Only set if link:#detailed-labels[detailed labels] are requested.
Nitzan Gur-Furmand1223572023-01-16 12:07:46 +00007122|`removable_labels` |optional|
7123A map of the removable labels that maps a label name to the map of
7124values and reviewers (
7125link:rest-api-accounts.html#account-info[AccountInfo] entities)
7126that are allowed to be removed from the change. +
7127Only set if link:#labels[labels] or
7128link:#detailed-labels[detailed labels] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007129|`removable_reviewers`|optional|
7130The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01007131link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Patrick Hieselae92ad82020-11-17 11:09:05 +01007132Only set if link:#labels[labels] or
7133link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07007134|`reviewers` |optional|
Edwin Kempin66af3d82015-11-10 17:38:40 -08007135The reviewers as a map that maps a reviewer state to a list of
7136link:rest-api-accounts.html#account-info[AccountInfo] entities.
7137Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
7138`REVIEWER`: Users with at least one non-zero vote on the change. +
7139`CC`: Users that were added to the change, but have not voted. +
7140`REMOVED`: Users that were previously reviewers on the change, but have
7141been removed. +
Patrick Hieselae92ad82020-11-17 11:09:05 +01007142Only set if link:#labels[labels] or
7143link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07007144|`pending_reviewers` |optional|
7145Updates to `reviewers` that have been made while the change was in the
7146WIP state. Only present on WIP changes and only if there are pending
7147reviewer updates to report. These are reviewers who have not yet been
7148notified about being added to or removed from the change. +
Patrick Hieselae92ad82020-11-17 11:09:05 +01007149Only set if link:#labels[labels] or
7150link:#detailed-labels[detailed labels] are requested.
Viktar Donich316bf7a2016-07-06 11:29:01 -07007151|`reviewer_updates`|optional|
7152Updates to reviewers set for the change as
7153link:#review-update-info[ReviewerUpdateInfo] entities.
Han-Wen Nienhuys3c670be2020-06-30 19:17:07 +02007154Only set if link:#reviewer-updates[reviewer updates] are requested.
John Spurlock74a70cc2013-03-23 16:41:50 -04007155|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07007156Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04007157link:#change-message-info[ChangeMessageInfo] entities. +
7158Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007159|`current_revision` |optional|
7160The commit ID of the current patch set of this change. +
7161Only set if link:#current-revision[the current revision] is requested
7162or if link:#all-revisions[all revisions] are requested.
7163|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05007164All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01007165patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08007166Only set if link:#current-revision[the current revision] is requested
7167(in which case it will only contain a key for the current revision) or
7168if link:#all-revisions[all revisions] are requested.
Han-Wen Nienhuys4ec526a2021-02-16 19:20:26 +01007169|`meta_rev_id` |optional|
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02007170The SHA-1 of the NoteDb meta ref.
Makson Lee3568a932017-08-28 17:12:03 +08007171|`tracking_ids` |optional|
7172A list of link:#tracking-id-info[TrackingIdInfo] entities describing
7173references to external tracking systems. Only set if
7174link:#tracking-ids[tracking ids] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007175|`_more_changes` |optional, not set if `false`|
7176Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08007177Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05007178|`problems` |optional|
7179A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08007180problems with this change. Only set if link:#check[CHECK] is set.
David Ostrovskycb19cec2017-04-28 11:55:45 +02007181|`is_private` |optional, not set if `false`|
7182When present, change is marked as private.
David Ostrovsky258849b2017-03-09 23:21:03 +01007183|`work_in_progress` |optional, not set if `false`|
7184When present, change is marked as Work In Progress.
Logan Hanks724b24c2017-07-14 10:01:05 -07007185|`has_review_started` |optional, not set if `false`|
Logan Hanks296cd892017-05-03 15:14:41 -07007186When present, change has been marked Ready at some point in time.
Patrick Hiesel828f3222017-07-13 14:18:38 +02007187|`revert_of` |optional|
Sven Selberg45ca1782023-01-09 08:32:27 +00007188The change number of the change that this change reverts.
Gal Paikinf57225a2019-11-13 12:39:12 -08007189|`submission_id` |optional|
7190ID of the submission of this change. Only set if the status is `MERGED`.
Sven Selberg45ca1782023-01-09 08:32:27 +00007191This ID is equal to the change number of the change that triggered the
7192submission. If the change that triggered the submission also has a topic,
7193it will be "<id>-<topic>" of the change that triggered the submission.
Gal Paikindd31db92019-12-06 14:43:35 +01007194The callers must not rely on the format of the submission ID.
Edwin Kempinaab27d32020-01-29 13:17:04 +01007195|`cherry_pick_of_change` |optional|
Sven Selberg45ca1782023-01-09 08:32:27 +00007196The change 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|`cherry_pick_of_patch_set`|optional|
Kaushik Lingarkar73bcb412020-01-29 13:00:46 -08007200The patchset number of the change that this change was cherry-picked from.
Edwin Kempin4529d642021-02-01 13:03:08 +01007201Only set if the cherry-pick has been done through the Gerrit REST API (and
7202not if a cherry-picked commit was pushed).
Edwin Kempinaab27d32020-01-29 13:17:04 +01007203|`contains_git_conflicts` |optional, not set if `false`|
7204Whether the change contains conflicts. +
7205If `true`, some of the file contents of the change contain git conflict
7206markers to indicate the conflicts. +
7207Only set if this change info is returned in response to a request that
7208creates a new change or patch set and conflicts are allowed. In
7209particular this field is only populated if the change info is returned
7210by one of the following REST endpoints: link:#create-change[Create
7211Change], link:#create-merge-patch-set-for-change[Create Merge Patch Set
7212For Change], link:#cherry-pick[Cherry Pick Revision],
Edwin Kempin269a9502022-05-11 12:28:22 +02007213link:rest-api-project.html#cherry-pick-commit[Cherry Pick Commit],
7214link:#rebase-change[Rebase Change]
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08007215|==================================
7216
7217[[change-input]]
7218=== ChangeInput
7219The `ChangeInput` entity contains information about creating a new change.
7220
7221[options="header",cols="1,^1,5"]
7222|==================================
7223|Field Name ||Description
7224|`project` ||The name of the project.
7225|`branch` ||
7226The name of the target branch. +
7227The `refs/heads/` prefix is omitted.
7228|`subject` ||
Edwin Kempinba8388c2020-03-06 08:46:59 +01007229The commit message of the change. Comment lines (beginning with `#`)
7230will be removed. If the commit message contains a Change-Id (as a
7231"Change-Id: I..." footer) that Change-Id will be used for the newly
7232created changed. If a change with this Change-Id already exists for
7233same repository and branch, the request is rejected since Change-Ids
7234must be unique per repository and branch. If the commit message doesn't
7235contain a Change-Id, a newly generated Change-Id is automatically
7236inserted into the commit message.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08007237|`topic` |optional|The topic to which this change belongs.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02007238Topic can't contain quotation marks.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08007239|`status` |optional, default to `NEW`|
David Ostrovsky4b44bdc2017-07-27 08:05:43 +02007240The status of the change (only `NEW` accepted here).
Edwin Kempin14d50ed2017-05-03 13:26:30 +02007241|`is_private` |optional, default to `false`|
7242Whether the new change should be marked as private.
7243|`work_in_progress` |optional, default to `false`|
7244Whether the new change should be set to work in progress.
David Ostrovsky9d8ec422014-12-24 00:52:09 +01007245|`base_change` |optional|
7246A link:#change-id[\{change-id\}] that identifies the base change for a create
Nitzan Gur-Furman6799a832023-01-13 12:20:25 +01007247change operation. +
7248Mutually exclusive with `base_commit`. +
7249If neither `base_commit` nor `base_change` are set, the target branch tip will
7250be used as the parent commit.
Aaron Gablee8e73282018-04-26 11:09:30 -07007251|`base_commit` |optional|
7252A 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 +01007253created change. If set, it must be a merged commit on the destination branch. +
7254Mutually exclusive with `base_change`. +
7255If neither `base_commit` nor `base_change` are set, the target branch tip will
7256be used as the parent commit.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08007257|`new_branch` |optional, default to `false`|
Edwin Kempine94bb872019-10-08 13:47:41 +02007258Allow creating a new branch when set to `true`. Using this option is
7259only possible for non-merge commits (if the `merge` field is not set).
Edwin Kempined8a6bf2021-06-15 14:00:31 +02007260|`validation_options` |optional|
7261Map with key-value pairs that are forwarded as options to the commit validation
7262listeners (e.g. can be used to skip certain validations). Which validation
7263options are supported depends on the installed commit validation listeners.
7264Gerrit core doesn't support any validation options, but commit validation
7265listeners that are implemented in plugins may. Please refer to the
7266documentation of the installed plugins to learn whether they support validation
7267options. Unknown validation options are silently ignored.
Chris Poucetf5e68292023-04-03 16:21:39 +02007268|`custom_keyed_values`|optional|Custom keyed values as a
7269map from custom keys to values.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007270|`merge` |optional|
7271The detail of a merge commit as a link:#merge-input[MergeInput] entity.
Edwin Kempine94bb872019-10-08 13:47:41 +02007272If set, the target branch (see `branch` field) must exist (it is not
7273possible to create it automatically by setting the `new_branch` field
7274to `true`.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03007275|`patch` |optional|
7276The detail of a patch to be applied as an link:#applypatch-input[ApplyPatchInput] entity.
Han-Wen Nienhuys2a1029e2020-01-30 18:52:45 +01007277|`author` |optional|
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03007278The author of the commit to create. Must be an
7279link:rest-api-accounts.html#account-input[AccountInput] entity with at least
7280the `name` and `email` fields set.
Han-Wen Nienhuys2a1029e2020-01-30 18:52:45 +01007281The caller needs "Forge Author" permission when using this field.
7282This field does not affect the owner of the change, which will
7283continue to use the identity of the caller.
Edwin Kempin5f8c3832017-01-13 11:45:06 +01007284|`notify` |optional|
7285Notify handling that defines to whom email notifications should be sent
7286after the change is created. +
7287Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7288If not set, the default is `ALL`.
7289|`notify_details` |optional|
7290Additional information about whom to notify about the change creation
Gal Paikin1ae8b462020-07-27 15:50:59 +03007291as a map of link:user-notify.html#recipient-types[recipient type] to
7292link:#notify-info[NotifyInfo] entity.
Patrick Hiesele6759d52023-02-21 15:24:15 +01007293|`response_format_options` |optional|
7294List of link:#query-options[query options] to format the response.
Edwin Kempine3446292013-02-19 16:40:14 +01007295|==================================
7296
John Spurlock74a70cc2013-03-23 16:41:50 -04007297[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007298=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04007299The `ChangeMessageInfo` entity contains information about a message
7300attached to a change.
7301
David Pursehouseae367192014-11-25 17:24:47 +09007302[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04007303|==================================
7304|Field Name ||Description
7305|`id` ||The ID of the message.
7306|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07007307Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04007308link:rest-api-accounts.html#account-info[AccountInfo] entity. +
7309Unset if written by the Gerrit system.
Patrick Hiesel9221ef12017-03-23 16:44:36 +01007310|`real_author` |optional|
7311Real author of the message as an
7312link:rest-api-accounts.html#account-info[AccountInfo] entity. +
Edwin Kempine03de5f2023-01-31 14:54:51 +01007313Only set if the message was posted on behalf of another user.
John Spurlock74a70cc2013-03-23 16:41:50 -04007314|`date` ||
7315The link:rest-api.html#timestamp[timestamp] this message was posted.
Marija Savtchouke40dc1a2021-04-07 09:56:12 +01007316|`message` ||
7317The text left by the user or Gerrit system. Accounts are served as account IDs
7318inlined in the text as `<GERRIT_ACCOUNT_18419>`.
Kamil Musin47d9d712023-08-23 17:11:47 +02007319All accounts, used in message, can be found in `accounts_in_message`
Marija Savtchouke40dc1a2021-04-07 09:56:12 +01007320field.
Kamil Musin47d9d712023-08-23 17:11:47 +02007321|`accounts_in_message` ||
7322link:rest-api-accounts.html#account-info[AccountInfo] list, used in `message`.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007323|`tag` |optional|
7324Value of the `tag` field from link:#review-input[ReviewInput] set
Vitaliy Lotorevea882812018-06-28 20:16:39 +00007325while posting the review. Votes/comments that contain `tag` with
7326'autogenerated:' prefix can be filtered out in the web UI.
7327NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007328invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04007329|`_revision_number` |optional|
7330Which patchset (if any) generated this message.
7331|==================================
7332
Gustaf Lundh019fb262012-11-28 14:20:22 +01007333[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007334=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01007335The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
7336
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02007337[options="header",cols="1,^1,5"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01007338|===========================
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007339|Field Name ||Description
7340|`message` |optional|
Edwin Kempin159804b2019-09-23 11:09:39 +02007341Commit message for the cherry-pick change. If not set, the commit message of
7342the cherry-picked commit is used.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007343|`destination` ||Destination branch
7344|`base` |optional|
Changcheng Xiaoe3332582017-05-26 15:29:41 +0200734540-hex digit SHA-1 of the commit which will be the parent commit of the newly created change.
7346If set, it must be a merged commit or a change revision on the destination branch.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007347|`parent` |optional, defaults to 1|
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02007348Number of the parent relative to which the cherry-pick should be considered.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007349|`notify` |optional|
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02007350Notify handling that defines to whom email notifications should be sent
7351after the cherry-pick. +
7352Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Saša Živkov357e2bd2020-06-12 12:06:07 +02007353If not set, the default is `ALL`.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007354|`notify_details` |optional|
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02007355Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007356of link:user-notify.html#recipient-types[recipient type] to
7357link:#notify-info[NotifyInfo] entity.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007358|`keep_reviewers` |optional, defaults to false|
Edwin Kempin5ac370d2018-10-05 13:39:34 +02007359If `true`, carries reviewers and ccs over from original change to newly created one.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007360|`allow_conflicts` |optional, defaults to false|
Edwin Kempin5ac370d2018-10-05 13:39:34 +02007361If `true`, the cherry-pick uses content merge and succeeds also if
7362there are conflicts. If there are conflicts the file contents of the
7363created change contain git conflict markers to indicate the conflicts.
7364Callers can find out if there were conflicts by checking the
Edwin Kempinaab27d32020-01-29 13:17:04 +01007365`contains_git_conflicts` field in the link:#change-info[ChangeInfo]. If
7366there are conflicts the cherry-pick change is marked as
Edwin Kempin3c4113a2018-10-12 10:49:33 +02007367work-in-progress.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007368|`topic` |optional|
Gal Paikinf3abd3c2020-03-24 16:39:20 +01007369The topic of the created cherry-picked change. If not set, the default depends
7370on the source. If the source is a change with a topic, the resulting topic
7371of the cherry-picked change will be {source_change_topic}-{destination_branch}.
7372Otherwise, if the source change has no topic, or the source is a commit,
7373the created change will have no topic.
Gal Paikin1f83c202020-03-31 16:23:41 +02007374If the change already exists, the topic will not change if not set. If set, the
7375topic will be overridden.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007376|`allow_empty` |optional, defaults to false|
Gal Paikin626abe02020-04-07 12:21:26 +02007377If `true`, the cherry-pick succeeds also if the created commit will be empty.
7378If `false`, a cherry-pick that would create an empty commit fails without creating
7379the commit.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007380|`validation_options`|optional|
7381Map with key-value pairs that are forwarded as options to the commit validation
7382listeners (e.g. can be used to skip certain validations). Which validation
7383options are supported depends on the installed commit validation listeners.
7384Gerrit core doesn't support any validation options, but commit validation
7385listeners that are implemented in plugins may. Please refer to the
7386documentation of the installed plugins to learn whether they support validation
7387options. Unknown validation options are silently ignored.
Gustaf Lundh019fb262012-11-28 14:20:22 +01007388|===========================
7389
Edwin Kempincb6724a2013-02-26 16:58:51 +01007390[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007391=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05007392The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01007393
David Pursehouseae367192014-11-25 17:24:47 +09007394[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01007395|===========================
7396|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07007397|`patch_set` |optional|
7398The patch set number for the comment; only set in contexts where +
7399comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04007400|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01007401|`path` |optional|
Gal Paikin3edc1422020-03-19 12:04:52 +01007402link:#file-id[The file path] for which the inline comment was done. +
Edwin Kempincb6724a2013-02-26 16:58:51 +01007403Not set if returned in a map where the key is the file path.
7404|`side` |optional|
7405The side on which the comment was added. +
7406Allowed values are `REVISION` and `PARENT`. +
7407If not set, the default is `REVISION`.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01007408|`parent` |optional|
7409The 1-based parent number. Used only for merge commits when `side == PARENT`.
7410When not set the comment is for the auto-merge tree.
Edwin Kempincb6724a2013-02-26 16:58:51 +01007411|`line` |optional|
7412The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04007413If range is set, this equals the end line of the range. +
7414If neither line nor range is set, it's a file comment.
7415|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09007416The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04007417entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01007418|`in_reply_to` |optional|
7419The URL encoded UUID of the comment to which this comment is a reply.
7420|`message` |optional|The comment message.
7421|`updated` ||
7422The link:rest-api.html#timestamp[timestamp] of when this comment was
7423written.
John Spurlock5e402f02013-03-24 11:35:04 -04007424|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09007425The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04007426link:rest-api-accounts.html#account-info[AccountInfo] entity. +
7427Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007428|`tag` |optional|
7429Value of the `tag` field from link:#review-input[ReviewInput] set
7430while posting the review.
Sven Selberg1a6728d2018-09-28 12:30:12 +02007431NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007432invocations of the REST call are required.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08007433|`unresolved` |optional|
7434Whether or not the comment must be addressed by the user. The state of
7435resolution of a comment thread is stored in the last comment in that thread
7436chronologically.
Youssef Elghareeb7fdfa442020-02-03 12:00:52 +01007437|`change_message_id` |optional|
Youssef Elghareeb5bd4e4e2020-08-13 17:09:42 +02007438Available with the link:#list-change-comments[list change comments] endpoint.
7439Contains the link:rest-api-changes.html#change-message-info[id] of the change
7440message that this comment is linked to.
Youssef Elghareebb5e42082020-07-09 15:24:01 +02007441|`commit_id` |optional|
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02007442Hex commit SHA-1 (40 characters string) of the commit of the patchset to which
Youssef Elghareebb5e42082020-07-09 15:24:01 +02007443this comment applies.
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02007444|`context_lines` |optional|
7445A list of link:#context-line[ContextLine] containing the lines of the source
Youssef Elghareeb68e87b62021-01-11 13:20:03 +01007446file where the comment was written. Available only if the "enable-context"
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02007447parameter (see link:#list-change-comments[List Change Comments]) is set.
Youssef Elghareeb27d62012021-02-23 18:21:46 +01007448|`source_content_type` |optional|
7449Mime type of the file where the comment is written. Available only if the
7450"enable-context" parameter (see link:#list-change-comments[List Change Comments])
7451is set.
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02007452
Edwin Kempincb6724a2013-02-26 16:58:51 +01007453|===========================
7454
Edwin Kempin67498de2013-02-25 16:15:34 +01007455[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007456=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03007457The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01007458comment.
7459
David Pursehouseae367192014-11-25 17:24:47 +09007460[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01007461|===========================
7462|Field Name ||Description
7463|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01007464The URL encoded UUID of the comment if an existing draft comment should
7465be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01007466|`path` |optional|
Gal Paikin3edc1422020-03-19 12:04:52 +01007467link:#file-id[The file path] for which the inline comment should be added. +
Edwin Kempin7faf41e2013-02-27 08:17:02 +01007468Doesn't need to be set if contained in a map where the key is the file
7469path.
Edwin Kempin67498de2013-02-25 16:15:34 +01007470|`side` |optional|
7471The side on which the comment should be added. +
7472Allowed values are `REVISION` and `PARENT`. +
7473If not set, the default is `REVISION`.
7474|`line` |optional|
7475The number of the line for which the comment should be added. +
7476`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04007477If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09007478If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04007479|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09007480The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04007481entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01007482|`in_reply_to` |optional|
7483The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01007484|`updated` |optional|
7485The link:rest-api.html#timestamp[timestamp] of this comment. +
7486Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01007487|`message` |optional|
7488The comment message. +
7489If not set and an existing draft comment is updated, the existing draft
7490comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04007491|`tag` |optional, drafts only|
7492Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
7493inputs; for published comments, use the `tag` field in +
Gal Paikinb2b81f22020-02-26 13:14:08 +01007494link:#review-input[ReviewInput]. Votes/comments that contain `tag` with
Vitaliy Lotorevea882812018-06-28 20:16:39 +00007495'autogenerated:' prefix can be filtered out in the web UI.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08007496|`unresolved` |optional|
7497Whether or not the comment must be addressed by the user. This value will
7498default to false if the comment is an orphan, or the value of the `in_reply_to`
7499comment if it is supplied.
Edwin Kempin67498de2013-02-25 16:15:34 +01007500|===========================
7501
Michael Zhou596c7682013-08-25 05:43:34 -04007502[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007503=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04007504The `CommentRange` entity describes the range of an inline comment.
7505
Quinten Yearsley31786712018-07-16 13:44:33 -07007506The comment range is a range from the start position, specified by `start_line`
7507and `start_character`, to the end position, specified by `end_line` and
7508`end_character`. The start position is *inclusive* and the end position is
7509*exclusive*.
7510
7511So, a range over part of a line will have `start_line` equal to
7512`end_line`; however a range with `end_line` set to 5 and `end_character` equal
7513to 0 will not include any characters on line 5,
7514
David Pursehouseae367192014-11-25 17:24:47 +09007515[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04007516|===========================
Quinten Yearsley31786712018-07-16 13:44:33 -07007517|Field Name ||Description
7518|`start_line` ||The start line number of the range. (1-based)
7519|`start_character` ||The character position in the start line. (0-based)
7520|`end_line` ||The end line number of the range. (1-based)
7521|`end_character` ||The character position in the end line. (0-based)
Michael Zhou596c7682013-08-25 05:43:34 -04007522|===========================
7523
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02007524[[context-line]]
7525=== ContextLine
7526The `ContextLine` entity contains the line number and line text of a single
7527line of the source file content.
7528
7529[options="header",cols="1,6"]
7530|===========================
7531|Field Name |Description
7532|`line_number` |The line number of the source line.
7533|`context_line` |String containing the line text.
7534|===========================
7535
Edwin Kempine3446292013-02-19 16:40:14 +01007536[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007537=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007538The `CommitInfo` entity contains information about a commit.
7539
Edwin Kempinf0c57152015-07-15 18:18:24 +02007540[options="header",cols="1,^1,5"]
7541|===========================
7542|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02007543|`commit` |Optional|
7544The commit ID. Not set if included in a link:#revision-info[
7545RevisionInfo] entity that is contained in a map which has the commit ID
7546as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007547|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01007548The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02007549link:#commit-info[CommitInfo] entities. In each parent
7550only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007551|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01007552link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007553|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01007554link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007555|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01007556The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02007557|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01007558|`web_links` |optional|
Frank Bordendf69edb2021-05-05 17:00:15 +02007559Links to the patch set in external sites as a list of
7560link:#web-link-info[WebLinkInfo] entities.
7561|`resolve_conflicts_web_links` |optional|
7562Links to the commit in external sites for resolving conflicts as a list of
Sven Selbergd26bd542014-11-21 16:28:10 +01007563link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007564|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01007565
Patrick Hieselfda96452017-06-14 16:44:54 +02007566[[commit-message-input]]
7567=== CommitMessageInput
7568The `CommitMessageInput` entity contains information for changing
7569the commit message of a change.
7570
7571[options="header",cols="1,^1,5"]
7572|=============================
7573|Field Name ||Description
7574|`message` ||New commit message.
7575|`notify` |optional|
7576Notify handling that defines to whom email notifications should be sent
7577after the commit message was updated. +
7578Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Logan Hanksa1e68dc2017-06-29 15:13:27 -07007579If not set, the default is `OWNER` for WIP changes and `ALL` otherwise.
Patrick Hieselfda96452017-06-14 16:44:54 +02007580|`notify_details`|optional|
7581Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007582of link:user-notify.html#recipient-types[recipient type] to
7583link:#notify-info[NotifyInfo] entity.
Patrick Hieselfda96452017-06-14 16:44:54 +02007584|=============================
7585
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02007586[[delete-change-message-input]]
7587=== DeleteChangeMessageInput
7588The `DeleteChangeMessageInput` entity contains the options for deleting a change message.
7589
7590[options="header",cols="1,^1,5"]
7591|=============================
7592|Field Name ||Description
7593|`reason` |optional|
7594The reason why the change message should be deleted. +
7595If set, the change message will be replaced with
7596"Change message removed by: `name`\nReason: `reason`",
7597or just "Change message removed by: `name`." if not set.
7598|=============================
7599
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01007600[[delete-comment-input]]
7601=== DeleteCommentInput
7602The `DeleteCommentInput` entity contains the option for deleting a comment.
7603
7604[options="header",cols="1,^1,5"]
7605|=============================
7606|Field Name ||Description
7607|`reason` |optional|
7608The reason why the comment should be deleted. +
7609If set, the comment's message will be replaced with
7610"Comment removed by: `name`; Reason: `reason`",
7611or just "Comment removed by: `name`." if not set.
7612|=============================
7613
Edwin Kempin407fca32016-08-29 12:01:00 +02007614[[delete-reviewer-input]]
7615=== DeleteReviewerInput
7616The `DeleteReviewerInput` entity contains options for the deletion of a
7617reviewer.
7618
7619[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007620|=============================
7621|Field Name ||Description
7622|`notify` |optional|
Edwin Kempin407fca32016-08-29 12:01:00 +02007623Notify handling that defines to whom email notifications should be sent
7624after the reviewer is deleted. +
7625Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7626If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007627|`notify_details`|optional|
7628Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007629of link:user-notify.html#recipient-types[recipient type] to
7630link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01007631|=============================
Edwin Kempin407fca32016-08-29 12:01:00 +02007632
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007633[[delete-vote-input]]
7634=== DeleteVoteInput
7635The `DeleteVoteInput` entity contains options for the deletion of a
7636vote.
7637
7638[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007639|=============================
7640|Field Name ||Description
7641|`label` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007642The label for which the vote should be deleted. +
7643If set, must match the label in the URL.
Edwin Kempincd07df42016-12-01 09:10:09 +01007644|`notify` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007645Notify handling that defines to whom email notifications should be sent
7646after the vote is deleted. +
7647Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7648If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007649|`notify_details`|optional|
7650Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007651of link:user-notify.html#recipient-types[recipient type] to
7652link:#notify-info[NotifyInfo] entity.
Gal Paikinbd7575d2021-11-11 14:42:53 +01007653|`ignore_automatic_attention_set_rules`|optional|
7654If set to true, ignore all automatic attention set rules described in the
Edwin Kempinc9219002023-09-08 08:07:21 +00007655link:user-attention-set.html[attention set]. When not set, the default is false.
Patrick Hiesel8c5568a2022-05-31 08:33:52 +02007656|`reason` |optional|
7657The reason why this vote is deleted. Will +
7658go into the change message.
Edwin Kempincd07df42016-12-01 09:10:09 +01007659|=============================
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007660
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08007661[[description-input]]
7662=== DescriptionInput
7663The `DescriptionInput` entity contains information for setting a description.
7664
7665[options="header",cols="1,6"]
7666|===========================
7667|Field Name |Description
7668|`description` |The description text.
7669|===========================
7670
David Pursehouse882aef22013-06-05 10:56:37 +09007671[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007672=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09007673The `DiffContent` entity contains information about the content differences
7674in a file.
7675
David Pursehouseae367192014-11-25 17:24:47 +09007676[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09007677|==========================
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007678|Field Name ||Description
7679|`a` |optional|Content only in the file on side A (deleted in B).
7680|`b` |optional|Content only in the file on side B (added in B).
7681|`ab` |optional|Content in the file on both sides (unchanged).
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007682|`edit_a` |only present when the `intraline` parameter is set and the
7683DiffContent is a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09007684Text sections deleted from side A as a
7685link:#diff-intraline-info[DiffIntralineInfo] entity.
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007686|`edit_b` |only present when the `intraline` parameter is set and the
7687DiffContent is a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09007688Text sections inserted in side B as a
7689link:#diff-intraline-info[DiffIntralineInfo] entity.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007690|`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a
7691rebase.
Renan Oliveirac5077aa2020-09-25 18:11:54 +02007692|`due_to_move`|not set if `false`|Indicates whether this entry was introduced by a
7693move operation.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007694|`skip` |optional|count of lines skipped on both sides when the file is
David Pursehouse882aef22013-06-05 10:56:37 +09007695too large to include all common lines.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007696|`common` |optional|Set to `true` if the region is common according
Shawn Pearce425a2be2014-01-02 16:00:58 -08007697to the requested ignore-whitespace parameter, but a and b contain
7698differing amounts of whitespace. When present and true a and b are
7699used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09007700|==========================
7701
7702[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007703=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09007704The `DiffFileMetaInfo` entity contains meta information about a file diff.
7705
David Pursehouseae367192014-11-25 17:24:47 +09007706[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09007707|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02007708|Field Name ||Description
7709|`name` ||The name of the file.
Youssef Elghareeb20a91dd2022-02-03 13:46:44 +01007710|`content_type`||The content type of the file. For the commit message and merge
7711list the value is `text/x-gerrit-commit-message` and `text/x-gerrit-merge-list`
7712respectively. For git links the value is `x-git/gitlink`. For symlinks the value
7713is `x-git/symlink`. For regular files the value is the file mime type (e.g.
7714`text/x-java`, `text/x-c++src`, etc...).
Sven Selberge7f3f0a2014-10-21 11:04:42 +02007715|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01007716|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02007717Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07007718link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09007719|==========================
7720
7721[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007722=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09007723The `DiffInfo` entity contains information about the diff of a file
7724in a revision.
7725
Edwin Kempin8cdce502014-12-06 10:55:38 +01007726If the link:#weblinks-only[weblinks-only] parameter is specified, only
7727the `web_links` field is set.
7728
David Pursehouseae367192014-11-25 17:24:47 +09007729[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09007730|==========================
7731|Field Name ||Description
7732|`meta_a` |not present when the file is added|
7733Meta information about the file on side A as a
7734link:#diff-file-meta-info[DiffFileMetaInfo] entity.
7735|`meta_b` |not present when the file is deleted|
7736Meta information about the file on side B as a
7737link:#diff-file-meta-info[DiffFileMetaInfo] entity.
7738|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
7739`COPIED`, `REWRITE`).
7740|`intraline_status`|only set when the `intraline` parameter was specified in the request|
7741Intraline status (`OK`, `ERROR`, `TIMEOUT`).
7742|`diff_header` ||A list of strings representing the patch set diff header.
7743|`content` ||The content differences in the file as a list of
7744link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01007745|`web_links` |optional|
7746Links to the file diff in external sites as a list of
7747link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
Frank Borden19524922021-05-04 11:40:44 +02007748|`edit_web_links` |optional|
7749Links to edit the file in external sites as a list of
7750link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01007751|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09007752|==========================
7753
7754[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007755=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09007756The `DiffIntralineInfo` entity contains information about intraline edits in a
7757file.
7758
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007759The information consists of a list of `<skip length, edit length>` pairs, where
David Pursehouse31203f52013-06-08 17:05:45 +09007760the skip length is the number of characters between the end of the previous edit
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007761and the start of this edit, and the edit length is the number of edited characters
David Pursehouse31203f52013-06-08 17:05:45 +09007762following the skip. The start of the edits is from the beginning of the related
Tao Zhou42430482019-09-13 11:26:01 +02007763diff content lines. If the list is empty, the entire DiffContent should be considered
7764as unedited.
David Pursehouse882aef22013-06-05 10:56:37 +09007765
David Pursehouse31203f52013-06-08 17:05:45 +09007766Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07007767the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09007768
Edwin Kempin8cdce502014-12-06 10:55:38 +01007769[[diff-web-link-info]]
7770=== DiffWebLinkInfo
Ben Rohlfs25c478112023-03-16 16:06:40 +01007771The `DiffWebLinkInfo` entity extends link:#web-link-info[WebLinkInfo] and
7772describes a link on a diff screen to an external site.
Edwin Kempin8cdce502014-12-06 10:55:38 +01007773
Ben Rohlfs25c478112023-03-16 16:06:40 +01007774[options="header",cols="1,^1,5"]
Edwin Kempin8cdce502014-12-06 10:55:38 +01007775|=======================
Ben Rohlfs25c478112023-03-16 16:06:40 +01007776|Field Name||Description
7777|`name` ||See link:#web-link-info[WebLinkInfo]
7778|`tooltip` |optional|See link:#web-link-info[WebLinkInfo]
7779|`url` ||See link:#web-link-info[WebLinkInfo]
7780|`image_url`|optional|See link:#web-link-info[WebLinkInfo]
7781|show_on_side_by_side_diff_view||
Edwin Kempin8cdce502014-12-06 10:55:38 +01007782Whether the web link should be shown on the side-by-side diff screen.
Ben Rohlfs25c478112023-03-16 16:06:40 +01007783|show_on_unified_diff_view||
Edwin Kempin8cdce502014-12-06 10:55:38 +01007784Whether the web link should be shown on the unified diff screen.
7785|=======================
7786
Sharad Bagribdb582d2022-03-26 01:32:35 -07007787[[apply-provided-fix-input]]
7788=== ApplyProvidedFixInput
7789The `ApplyProvidedFixInput` entity contains the fixes to be applied on a review.
7790
Chris Poucetf5e68292023-04-03 16:21:39 +02007791[[custom-keyed-values-input]]
7792=== CustomKeyedValuesInput
7793
7794The `CustomKeyedValuesInput` entity contains information about custom keyed values
7795to add to, and/or remove from, a change.
7796
7797[options="header",cols="1,^1,5"]
7798|=======================
7799|Field Name||Description
7800|`add` |optional|The map of custom keyed values to be added to the change.
7801|`remove` |optional|The list of custom keys to be removed from the change.
7802|=======================
7803
Sharad Bagribdb582d2022-03-26 01:32:35 -07007804[options="header",cols="1,6"]
7805|=======================
7806|Field Name |Description
7807|`fix_replacement_infos` |A list of <<fix-replacement-info,FixReplacementInfo>>.
7808|=======================
7809
David Ostrovsky9ea9c112015-01-25 00:12:38 +01007810[[edit-file-info]]
7811=== EditFileInfo
7812The `EditFileInfo` entity contains additional information
7813of a file within a change edit.
7814
7815[options="header",cols="1,^1,5"]
7816|===========================
7817|Field Name ||Description
7818|`web_links` |optional|
7819Links to the diff info in external sites as a list of
7820link:#web-link-info[WebLinkInfo] entities.
7821|===========================
7822
Edwin Kempin521c1242015-01-23 12:44:44 +01007823[[edit-info]]
7824=== EditInfo
7825The `EditInfo` entity contains information about a change edit.
7826
7827[options="header",cols="1,^1,5"]
7828|===========================
David Pursehouse5934d3f2019-01-07 15:23:49 +09007829|Field Name ||Description
7830|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01007831link:#commit-info[CommitInfo] entity.
David Pursehouse5934d3f2019-01-07 15:23:49 +09007832|`base_patch_set_number`||The patch set number of the patch set the change edit is based on.
7833|`base_revision` ||The revision of the patch set the change edit is based on.
David Pursehouse1bb55ff2019-01-07 15:28:22 +09007834|`ref` ||The ref of the change edit.
David Pursehouse5934d3f2019-01-07 15:23:49 +09007835|`fetch` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01007836Information about how to fetch this patch set. The fetch information is
7837provided as a map that maps the protocol name ("`git`", "`http`",
7838"`ssh`") to link:#fetch-info[FetchInfo] entities.
David Pursehouse5934d3f2019-01-07 15:23:49 +09007839|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01007840The files of the change edit as a map that maps the file names to
7841link:#file-info[FileInfo] entities.
7842|===========================
7843
Edwin Kempine3446292013-02-19 16:40:14 +01007844[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007845=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007846The `FetchInfo` entity contains information about how to fetch a patch
7847set via a certain protocol.
7848
David Pursehouseae367192014-11-25 17:24:47 +09007849[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007850|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02007851|Field Name ||Description
7852|`url` ||The URL of the project.
7853|`ref` ||The ref of the patch set.
7854|`commands` |optional|
7855The download commands for this patch set as a map that maps the command
7856names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09007857Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007858|==========================
7859
7860[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007861=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007862The `FileInfo` entity contains information about a file in a patch set.
7863
David Pursehouseae367192014-11-25 17:24:47 +09007864[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007865|=============================
7866|Field Name ||Description
7867|`status` |optional|
7868The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
7869"`C`"=Copied, "`W`"=Rewritten). +
7870Not set if the file was Modified ("`M`").
7871|`binary` |not set if `false`|Whether the file is binary.
7872|`old_path` |optional|
7873The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05007874Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01007875|`lines_inserted`|optional|
7876Number of inserted lines. +
Alice Kober-Sotzek7eff37c2018-07-05 15:58:50 +02007877Not set for binary files or if no lines were inserted. +
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 Kempine3446292013-02-19 16:40:14 +01007880|`lines_deleted` |optional|
7881Number of deleted lines. +
Alice Kober-Sotzek7eff37c2018-07-05 15:58:50 +02007882Not set for binary files or if no lines were deleted. +
7883An empty last line is not included in the count and hence this number can
Sharad Bagri6fc48982022-06-25 14:11:50 -07007884differ by one from details provided in <<diff-info,DiffInfo>>.
Edwin Kempin640f9842015-10-08 15:53:20 +02007885|`size_delta` ||
7886Number of bytes by which the file size increased/decreased.
Youssef Elghareeb1ae12c02022-06-28 13:49:18 +02007887|`size` || File size in bytes.
7888|`old_mode` |optional|File mode in octal (e.g. 100644) at the old commit.
7889The first three digits indicate the file type and the last three digits contain
7890the file permission bits. For added files, this field will not be present.
7891|`new_mode` |optional|File mode in octal (e.g. 100644) at the new commit.
7892The first three digits indicate the file type and the last three digits contain
7893the file permission bits. For deleted files, this field will not be present.
Edwin Kempine3446292013-02-19 16:40:14 +01007894|=============================
7895
Dave Borowitzbad53ee2015-06-11 10:10:18 -04007896[[fix-input]]
7897=== FixInput
7898The `FixInput` entity contains options for fixing commits using the
7899link:#fix-change[fix change] endpoint.
7900
7901[options="header",cols="1,6"]
7902|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07007903|Field Name |Description
7904|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04007905database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07007906|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07007907merged into the destination branch as this exact SHA-1. If not, insert
7908a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04007909|==========================
7910
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007911[[fix-suggestion-info]]
7912=== FixSuggestionInfo
7913The `FixSuggestionInfo` entity represents a suggested fix.
7914
7915[options="header",cols="1,^1,5"]
7916|==========================
7917|Field Name ||Description
7918|`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested
7919fix. It will be generated automatically and hence will be ignored if it's set
7920for input objects.
7921|`description` ||A description of the suggested fix.
7922|`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>>
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01007923entities indicating how the content of one or several files should be modified.
7924Within a file, they should refer to non-overlapping regions.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007925|==========================
7926
7927[[fix-replacement-info]]
7928=== FixReplacementInfo
Alice Kober-Sotzek110f60f2016-12-19 14:53:40 +01007929The `FixReplacementInfo` entity describes how the content of a file should be
7930replaced by another content.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007931
7932[options="header",cols="1,6"]
7933|==========================
7934|Field Name |Description
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01007935|`path` |The path of the file which should be modified. Any file in
Alice Kober-Sotzek368547f2020-03-13 22:00:41 +01007936the repository may be modified. The commit message can be modified via the
7937magic file `/COMMIT_MSG` though only the part below the generated header of
7938that magic file can be modified. References to the header lines will result in
7939errors when the fix is applied.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007940|`range` |A <<comment-range,CommentRange>> indicating which content
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01007941of the file should be replaced. Lines in the file are assumed to be separated
Alice Kober-Sotzekf0a3f342020-09-24 14:16:06 +02007942by the line feed character.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007943|`replacement` |The content which should be used instead of the current one.
7944|==========================
7945
Edwin Kempine3446292013-02-19 16:40:14 +01007946[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007947=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007948The `GitPersonInfo` entity contains information about the
7949author/committer of a commit.
7950
David Pursehouseae367192014-11-25 17:24:47 +09007951[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01007952|==========================
7953|Field Name |Description
7954|`name` |The name of the author/committer.
7955|`email` |The email address of the author/committer.
7956|`date` |The link:rest-api.html#timestamp[timestamp] of when
7957this identity was constructed.
7958|`tz` |The timezone offset from UTC of when this identity was
7959constructed.
7960|==========================
7961
Edwin Kempin521c1242015-01-23 12:44:44 +01007962[[group-base-info]]
7963=== GroupBaseInfo
7964The `GroupBaseInfo` entity contains base information about the group.
7965
7966[options="header",cols="1,6"]
7967|==========================
7968|Field Name |Description
Edwin Kempin703613c2016-11-25 16:06:04 +01007969|`id` |The UUID of the group.
Edwin Kempin521c1242015-01-23 12:44:44 +01007970|`name` |The name of the group.
7971|==========================
7972
David Pursehoused9dac372016-11-24 19:41:10 +09007973[[hashtags-input]]
7974=== HashtagsInput
7975
7976The `HashtagsInput` entity contains information about hashtags to add to,
7977and/or remove from, a change.
7978
7979[options="header",cols="1,^1,5"]
7980|=======================
7981|Field Name||Description
7982|`add` |optional|The list of hashtags to be added to the change.
Mike Frysinger136ecbd2021-02-09 14:26:02 -05007983|`remove` |optional|The list of hashtags to be removed from the change.
David Pursehoused9dac372016-11-24 19:41:10 +09007984|=======================
7985
Edwin Kempin521c1242015-01-23 12:44:44 +01007986[[included-in-info]]
7987=== IncludedInInfo
7988The `IncludedInInfo` entity contains information about the branches a
Xinan Lindc40ff12021-07-26 23:26:28 -07007989change was merged into and tags it was tagged with. The branch or tag
7990must have 'refs/head/' or 'refs/tags/' prefix respectively.
Edwin Kempin521c1242015-01-23 12:44:44 +01007991
Edwin Kempin78279ba2015-05-22 15:22:41 +02007992[options="header",cols="1,^1,5"]
7993|=======================
7994|Field Name||Description
7995|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01007996Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02007997|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01007998Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02007999|`external`|optional|A map that maps a name to a list of external
8000systems that include this change, e.g. a list of servers on which this
8001change is deployed.
8002|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01008003
Edwin Kempine3446292013-02-19 16:40:14 +01008004[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008005=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07008006The `LabelInfo` entity contains information about a label on a change, always
8007corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01008008
Dave Borowitz88159512013-06-14 14:21:50 -07008009There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07008010link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07008011
Youssef Elghareeb9b3e0212022-01-21 14:40:18 +01008012* Using `LABELS` will skip the `all.permitted_voting_range` attribute.
8013* Using `DETAILED_LABELS` will include the `all.permitted_voting_range`
8014 attribute.
Dave Borowitz88159512013-06-14 14:21:50 -07008015
David Pursehouseae367192014-11-25 17:24:47 +09008016[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01008017|===========================
8018|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01008019|`optional` |not set if `false`|
8020Whether the label is optional. Optional means the label may be set, but
8021it's neither necessary for submission nor does it block submission if
8022set.
Youssef Elghareeb261691a2021-11-17 13:01:08 +01008023|`description` |optional| The description of the label.
Dave Borowitz88159512013-06-14 14:21:50 -07008024|`approved` |optional|One user who approved this label on the change
8025(voted the maximum value) as an
8026link:rest-api-accounts.html#account-info[AccountInfo] entity.
8027|`rejected` |optional|One user who rejected this label on the change
8028(voted the minimum value) as an
8029link:rest-api-accounts.html#account-info[AccountInfo] entity.
8030|`recommended` |optional|One user who recommended this label on the
8031change (voted positively, but not the maximum value) as an
8032link:rest-api-accounts.html#account-info[AccountInfo] entity.
8033|`disliked` |optional|One user who disliked this label on the change
8034(voted negatively, but not the minimum value) as an
8035link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01008036|`blocking` |optional|If `true`, the label blocks submit operation.
8037If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07008038|`value` |optional|The voting value of the user who
8039recommended/disliked this label on the change if it is not
8040"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07008041|`default_value`|optional|The default voting value for the label.
8042This value may be outside the range specified in permitted_labels.
Youssef Elghareeb9b3e0212022-01-21 14:40:18 +01008043|votes|optional|A list of integers containing the vote values applied to this
8044label at the latest patchset.
Edwin Kempine3446292013-02-19 16:40:14 +01008045|`all` |optional|List of all approvals for this label as a list
Aaron Gableea8a2112017-04-25 14:18:16 -07008046of link:#approval-info[ApprovalInfo] entities. Items in this list may
8047not represent actual votes cast by users; if a user votes on any label,
Youssef Elghareeb9b3e0212022-01-21 14:40:18 +01008048a corresponding ApprovalInfo will appear in this list for all labels. +
8049The `permitted_voting_range` attribute is only set if the `DETAILED_LABELS`
8050option is requested.
Edwin Kempine3446292013-02-19 16:40:14 +01008051|`values` |optional|A map of all values that are allowed for this
8052label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07008053to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01008054|===========================
8055
Saša Živkov499873f2014-05-05 13:34:18 +02008056[[mergeable-info]]
8057=== MergeableInfo
8058The `MergeableInfo` entity contains information about the mergeability of a
8059change.
8060
David Pursehouseae367192014-11-25 17:24:47 +09008061[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02008062|============================
Saša Živkov697cab22014-04-29 16:46:50 +02008063|Field Name ||Description
8064|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02008065Submit type used for this change, can be `MERGE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02008066`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or
Saša Živkov499873f2014-05-05 13:34:18 +02008067`CHERRY_PICK`.
Edwin Kempinfad66bc2020-01-29 10:26:00 +01008068|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07008069The strategy of the merge, can be `recursive`, `resolve`,
8070`simple-two-way-in-core`, `ours` or `theirs`.
Saša Živkov697cab22014-04-29 16:46:50 +02008071|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02008072`true` if this change is cleanly mergeable, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01008073|`commit_merged` |optional|
Zhen Chen8f00d552016-07-26 16:54:59 -07008074`true` if this change is already merged, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01008075|`content_merged`|optional|
Zhen Chen8f00d552016-07-26 16:54:59 -07008076`true` if the content of this change is already merged, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01008077|`conflicts` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07008078A list of paths with conflicts
Saša Živkov697cab22014-04-29 16:46:50 +02008079|`mergeable_into`|optional|
8080A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02008081|============================
Dave Borowitz88159512013-06-14 14:21:50 -07008082
Zhen Chenf7d85ea2016-05-02 15:14:43 -07008083[[merge-input]]
8084=== MergeInput
8085The `MergeInput` entity contains information about the merge
8086
8087[options="header",cols="1,^1,5"]
Edwin Kempinaab27d32020-01-29 13:17:04 +01008088|==============================
8089|Field Name ||Description
8090|`source` ||
Zhen Chenf7d85ea2016-05-02 15:14:43 -07008091The source to merge from, e.g. a complete or abbreviated commit SHA-1,
David Pursehouse4abaef932018-03-18 15:05:08 +09008092a complete reference name, a short reference name under `refs/heads`, `refs/tags`,
8093or `refs/remotes` namespace, etc.
Edwin Kempinaab27d32020-01-29 13:17:04 +01008094|`source_branch` |optional|
Han-Wen Nienhuys9ec1f6a2020-01-07 17:32:08 +01008095A branch from which `source` is reachable. If specified,
8096`source` is checked for visibility and reachability against only this
8097branch. This speeds up the operation, especially for large repos with
8098many branches.
Edwin Kempinaab27d32020-01-29 13:17:04 +01008099|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07008100The strategy of the merge, can be `recursive`, `resolve`,
8101`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
Edwin Kempinaab27d32020-01-29 13:17:04 +01008102|`allow_conflicts`|optional, defaults to false|
8103If `true`, creating the merge succeeds also if there are conflicts. +
8104If there are conflicts the file contents of the created change contain
8105git conflict markers to indicate the conflicts. +
8106Callers can find out whether there were conflicts by checking the
8107`contains_git_conflicts` field in the link:#change-info[ChangeInfo]. +
8108If there are conflicts the change is marked as work-in-progress. +
8109This option is not supported for all merge strategies (e.g. it's
8110supported for `recursive` and `resolve`, but not for
8111`simple-two-way-in-core`).
8112|==============================
Zhen Chenf7d85ea2016-05-02 15:14:43 -07008113
Zhen Chenb1e07e52016-09-23 12:59:48 -07008114[[merge-patch-set-input]]
8115=== MergePatchSetInput
8116The `MergePatchSetInput` entity contains information about updating a new
8117change by creating a new merge commit.
8118
8119[options="header",cols="1,^1,5"]
8120|==================================
8121|Field Name ||Description
8122|`subject` |optional|
8123The new subject for the change, if not specified, will reuse the current patch
8124set's subject
Han-Wen Nienhuysbd2af0c2020-01-09 16:39:26 +01008125|`inherit_parent` |optional, default to `false`|
Zhen Chenb1e07e52016-09-23 12:59:48 -07008126Use the current patch set's first parent as the merge tip when set to `true`.
Changcheng Xiao9bdedaf2017-10-24 09:34:42 +02008127|`base_change` |optional|
Han-Wen Nienhuys69917fe2020-01-09 16:39:26 +01008128A link:#change-id[\{change-id\}] that identifies a change. When `inherit_parent`
Changcheng Xiao9bdedaf2017-10-24 09:34:42 +02008129is `false`, the merge tip will be the current patch set of the `base_change` if
8130it's set. Otherwise, the current branch tip of the destination branch will be used.
Zhen Chenb1e07e52016-09-23 12:59:48 -07008131|`merge` ||
8132The detail of the source commit for merge as a link:#merge-input[MergeInput]
8133entity.
Patrick Hiesele8fc7972020-10-06 13:22:07 +02008134|`author` |optional|
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03008135The author of the commit to create. Must be an
8136link:rest-api-accounts.html#account-input[AccountInput] entity with at least
8137the `name` and `email` fields set.
Patrick Hiesele8fc7972020-10-06 13:22:07 +02008138The caller needs "Forge Author" permission when using this field.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03008139This field does not affect the owner or the committer of the change, which will
Patrick Hiesele8fc7972020-10-06 13:22:07 +02008140continue to use the identity of the caller.
chengyang8b10b0852023-07-24 21:49:35 +08008141|`validation_options` |optional|
8142Map with key-value pairs that are forwarded as options to the commit validation
8143listeners (e.g. can be used to skip certain validations). Which validation
8144options are supported depends on the installed commit validation listeners.
8145Gerrit core doesn't support any validation options, but commit validation
8146listeners that are implemented in plugins may. Please refer to the
8147documentation of the installed plugins to learn whether they support validation
8148options. Unknown validation options are silently ignored.
Zhen Chenb1e07e52016-09-23 12:59:48 -07008149|==================================
8150
Raviteja Sunkara791f3392015-11-03 13:24:50 +05308151[[move-input]]
8152=== MoveInput
8153The `MoveInput` entity contains information for moving a change to a new branch.
8154
8155[options="header",cols="1,^1,5"]
8156|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04008157|Field Name ||Description
8158|`destination_branch`||Destination branch
8159|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05308160A message to be posted in this change's comments
Marija Savtchoukd89fefc2020-12-15 06:46:15 +00008161|`keep_all_votes` |optional, defaults to false|
Marija Savtchoukcee6a8f2020-12-03 12:58:04 +00008162By default, only veto votes that are blocking the change from submission are moved to
8163the destination branch. Using this option is only allowed for administrators,
8164because it can affect the submission behaviour of the change (depending on the label access
8165configuration and submissions rules).
Raviteja Sunkara791f3392015-11-03 13:24:50 +05308166|===========================
8167
Edwin Kempincd07df42016-12-01 09:10:09 +01008168[[notify-info]]
8169=== NotifyInfo
8170The `NotifyInfo` entity contains detailed information about who should
8171be notified about an update. These notifications are sent out even if a
8172`notify` option in the request input disables normal notifications.
8173`NotifyInfo` entities are normally contained in a `notify_details` map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008174in the request input where the key is the
8175link:user-notify.html#recipient-types[recipient type].
Edwin Kempincd07df42016-12-01 09:10:09 +01008176
8177[options="header",cols="1,^1,5"]
8178|=======================
8179|Field Name||Description
8180|`accounts`|optional|
8181A list of link:rest-api-accounts.html#account-id[account IDs] that
8182identify the accounts that should be should be notified.
8183|=======================
8184
Youssef Elghareeba1121442023-06-14 14:53:59 +02008185[[parent-info]]
8186=== ParentInfo
8187The `ParentInfo` entity contains information about the parent commit of a
8188patch-set.
8189
8190[options="header",cols="1,^1,5"]
8191|=======================
8192|Field Name||Description
8193|`branch_name` |optional|Name of the target branch into which the parent commit
8194is merged.
8195|`commit_id` |optional|The commit SHA-1 of the parent commit, or null if the
8196current commit is root.
8197|`is_merged_in_target_branch` |optional, default to false| Set to true if the
8198parent commit is merged into the target branch.
8199|`change_id` |optional| If the parent commit is a patch-set of another gerrit
8200change, this field will hold the change ID of the parent change. Otherwise,
8201will be null.
8202|`change_number` |optional|If the parent commit is a patch-set of another gerrit
8203change, this field will hold the change number of the parent change. Otherwise,
8204will be null.
8205|`patch_set_number` |optional|If the parent commit is a patch-set of another gerrit
8206change, this field will hold the patch-set number of the parent change. Otherwise,
8207will be null.
8208|`change_status` |optional|If the parent commit is a patch-set of another gerrit
8209change, this field will hold the change status of the parent change. Otherwise,
8210will be null.
8211|=======================
8212
Edwin Kempin364a86b2017-04-27 12:34:00 +02008213[[private-input]]
8214=== PrivateInput
8215The `PrivateInput` entity contains information for changing the private
8216flag on a change.
8217
8218[options="header",cols="1,^1,5"]
8219|=======================
8220|Field Name||Description
8221|`message` |optional|Message describing why the private flag was changed.
8222|=======================
8223
Edwin Kempin521c1242015-01-23 12:44:44 +01008224[[problem-info]]
8225=== ProblemInfo
8226The `ProblemInfo` entity contains a description of a potential consistency problem
8227with a change. These are not related to the code review process, but rather
8228indicate some inconsistency in Gerrit's database or repository metadata related
8229to the enclosing change.
8230
8231[options="header",cols="1,^1,5"]
8232|===========================
8233|Field Name||Description
8234|`message` ||Plaintext message describing the problem with the change.
8235|`status` |optional|
8236The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
8237fix was attempted.
8238|`outcome` |optional|
8239If `status` is set, an additional plaintext message describing the
8240outcome of the fix.
8241|===========================
8242
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02008243[[publish-change-edit-input]]
8244=== PublishChangeEditInput
8245The `PublishChangeEditInput` entity contains options for the publishing of
8246change edit.
8247
8248[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01008249|=============================
8250|Field Name ||Description
8251|`notify` |optional|
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02008252Notify handling that defines to whom email notifications should be sent
8253after the change edit is published. +
8254Allowed values are `NONE` and `ALL`. +
8255If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01008256|`notify_details`|optional|
8257Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008258of link:user-notify.html#recipient-types[recipient type] to
8259link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01008260|=============================
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02008261
Patrick Hieselbb84fd72017-08-23 11:11:22 +02008262[[pure-revert-info]]
8263=== PureRevertInfo
8264The `PureRevertInfo` entity describes the result of a pure revert check.
8265
8266[options="header",cols="1,6"]
8267|======================
8268|Field Name |Description
8269|`is_pure_revert` |Outcome of the check as boolean.
8270|======================
8271
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04008272[[push-certificate-info]]
8273=== PushCertificateInfo
8274The `PushCertificateInfo` entity contains information about a push
8275certificate provided when the user pushed for review with `git push
8276--signed HEAD:refs/for/<branch>`. Only used when signed push is
8277link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
8278
8279[options="header",cols="1,6"]
8280|===========================
8281|Field Name|Description
8282|`certificate`|Signed certificate payload and GPG signature block.
8283|`key` |
8284Information about the key that signed the push, along with any problems
8285found while checking the signature or the key itself, as a
8286link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
8287|===========================
8288
Gabor Somossyb72d4c62015-10-20 23:40:07 +01008289[[range-info]]
8290=== RangeInfo
8291The `RangeInfo` entity stores the coordinates of a range.
8292
8293[options="header",cols="1,6"]
8294|===========================
8295|Field Name | Description
8296|`start` | First index.
8297|`end` | Last index.
8298|===========================
8299
Zalan Blenessy874aed72015-01-12 13:26:18 +01008300[[rebase-input]]
8301=== RebaseInput
8302The `RebaseInput` entity contains information for changing parent when rebasing.
8303
Edwin Kempin2f47eb42022-02-10 12:48:45 +01008304[options="header",cols="1,^1,5"]
Edwin Kempinccc9da02023-01-23 17:57:15 +01008305|====================================
8306|Field Name ||Description
8307|`base` |optional|
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02008308The new parent revision. This can be a ref or a SHA-1 to a concrete patchset. +
Zalan Blenessy874aed72015-01-12 13:26:18 +01008309Alternatively, a change number can be specified, in which case the current
8310patch set is inferred. +
8311Empty string is used for rebasing directly on top of the target branch,
8312which effectively breaks dependency towards a parent change.
Michael Kelly6d5c9f62023-04-20 23:09:19 -07008313|`strategy` |optional|
8314The strategy of the merge, can be `recursive`, `resolve`,
8315`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
Edwin Kempinccc9da02023-01-23 17:57:15 +01008316|`allow_conflicts` |optional, defaults to false|
Edwin Kempin9a6f0542021-01-13 13:51:42 +01008317If `true`, the rebase also succeeds if there are conflicts. +
8318If there are conflicts the file contents of the rebased patch set contain
8319git conflict markers to indicate the conflicts. +
8320Callers can find out whether there were conflicts by checking the
8321`contains_git_conflicts` field in the returned link:#change-info[ChangeInfo]. +
Edwin Kempinccc9da02023-01-23 17:57:15 +01008322If there are conflicts the change is marked as work-in-progress. +
8323Cannot be combined with the `on_behalf_of_uploader` option.
8324|`on_behalf_of_uploader`|optional, defaults to false|
8325If `true`, the rebase is done on behalf of the uploader. +
8326This means the uploader of the current patch set will also be the uploader of
8327the rebased patch set. The calling user will be recorded as the real user. +
8328Rebasing on behalf of the uploader is only supported for trivial rebases.
8329This means this option cannot be combined with the `allow_conflicts` option. +
8330In addition, rebasing on behalf of the uploader is only supported for the
Edwin Kempin8bf2d862023-03-10 08:48:02 +01008331current patch set of a change. +
Edwin Kempinccc9da02023-01-23 17:57:15 +01008332If the caller is the uploader this flag is ignored and a normal rebase is done.
8333|`validation_options` |optional|
Edwin Kempine5ec9212022-02-11 13:37:35 +01008334Map with key-value pairs that are forwarded as options to the commit validation
8335listeners (e.g. can be used to skip certain validations). Which validation
8336options are supported depends on the installed commit validation listeners.
8337Gerrit core doesn't support any validation options, but commit validation
8338listeners that are implemented in plugins may. Please refer to the
8339documentation of the installed plugins to learn whether they support validation
8340options. Unknown validation options are silently ignored.
Edwin Kempinccc9da02023-01-23 17:57:15 +01008341|====================================
Zalan Blenessy874aed72015-01-12 13:26:18 +01008342
Nitzan Gur-Furman4655d8b2022-12-16 08:46:18 +01008343[[rebase-chain-info]]
8344=== RebaseChainInfo
8345
8346The `RebaseChainInfo` entity contains information about a chain of changes
8347that were rebased.
8348
8349[options="header",cols="1,^1,5"]
8350|===========================
8351|Field Name ||Description
8352|`rebased_changes` ||List of the unsubmitted ancestors, as link:#change-info[ChangeInfo]
8353entities. Includes both rebased changes, and previously up-to-date ancestors. The list is ordered by
8354ancestry, where the oldest ancestor is the first.
8355|`contains_git_conflicts` ||Whether any of the rebased changes has conflicts
8356due to rebasing.
Nitzan Gur-Furmanca0c55c2023-01-11 09:33:38 +01008357|===========================
Nitzan Gur-Furman4655d8b2022-12-16 08:46:18 +01008358
Edwin Kempin521c1242015-01-23 12:44:44 +01008359[[related-change-and-commit-info]]
8360=== RelatedChangeAndCommitInfo
8361
8362The `RelatedChangeAndCommitInfo` entity contains information about
8363a related change and commit.
8364
8365[options="header",cols="1,^1,5"]
8366|===========================
8367|Field Name ||Description
Patrick Hieselcab63512017-07-28 10:25:42 +02008368|`project` ||The project of the change or commit.
Edwin Kempin521c1242015-01-23 12:44:44 +01008369|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01008370|`commit` ||The commit as a
8371link:#commit-info[CommitInfo] entity.
8372|`_change_number` |optional|The change number.
8373|`_revision_number` |optional|The revision number.
8374|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07008375|`status` |optional|The status of the change. The status of
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01008376the change is one of (`NEW`, `MERGED`, `ABANDONED`).
Joerg Zieren75e95382022-07-08 11:30:35 +02008377|`submittable` |optional|Boolean indicating whether the change is
8378submittable. +
8379Only populated if link:#get-related-changes-submittable[requested].
Edwin Kempin521c1242015-01-23 12:44:44 +01008380|===========================
8381
8382[[related-changes-info]]
8383=== RelatedChangesInfo
8384The `RelatedChangesInfo` entity contains information about related
8385changes.
8386
8387[options="header",cols="1,6"]
8388|===========================
8389|Field Name |Description
8390|`changes` |A list of
8391link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
8392describing the related changes. Sorted by git commit order, newest to
8393oldest. Empty if there are no related changes.
8394|===========================
8395
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01008396
8397[[requirement]]
8398=== Requirement
8399The `Requirement` entity contains information about a requirement relative to a change.
8400
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01008401[options="header",cols="1,^1,5"]
8402|===========================
8403|Field Name | |Description
8404|`status` | | Status of the requirement. Can be either `OK`, `NOT_READY` or `RULE_ERROR`.
Sven Selberge748e3f2020-09-24 13:44:56 +02008405|`fallback_text` | | A human readable reason
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01008406|`type` | |
8407Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and why it
8408was triggered. Can be seen as a class: requirements sharing the same type were created for a similar
8409reason, and the data structure will follow one set of rules.
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01008410|===========================
8411
8412
Edwin Kempined5364b2013-02-22 10:39:33 +01008413[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008414=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01008415The `RestoreInput` entity contains information for restoring a change.
8416
David Pursehouseae367192014-11-25 17:24:47 +09008417[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01008418|===========================
8419|Field Name ||Description
8420|`message` |optional|
8421Message to be added as review comment to the change when restoring the
8422change.
8423|===========================
8424
Edwin Kempind2ec4152013-02-22 12:17:19 +01008425[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008426=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01008427The `RevertInput` entity contains information for reverting a change.
8428
David Pursehouseae367192014-11-25 17:24:47 +09008429[options="header",cols="1,^1,5"]
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008430|=================================
8431|Field Name ||Description
8432|`message` |optional|
Edwin Kempind2ec4152013-02-22 12:17:19 +01008433Message to be added as review comment to the change when reverting the
8434change.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008435|`notify` |optional|
Edwin Kempin0d5be4f52018-03-14 16:54:24 +01008436Notify handling that defines to whom email notifications should be sent
8437for reverting the change. +
8438Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
8439If not set, the default is `ALL`.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008440|`notify_details` |optional|
Edwin Kempin0d5be4f52018-03-14 16:54:24 +01008441Additional information about whom to notify about the revert as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008442of link:user-notify.html#recipient-types[recipient type] to
8443link:#notify-info[NotifyInfo] entity.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008444|`topic` |optional|
Gal Paikinb81f56c2019-10-16 14:39:24 +02008445Name of the topic for the revert change. If not set, the default for Revert
8446endpoint is the topic of the change being reverted, and the default for the
8447RevertSubmission endpoint is `revert-{submission_id}-{timestamp.now}`.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02008448Topic can't contain quotation marks.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008449|`work_in_progress` |optional|
Youssef Elghareeb86095442021-08-02 18:18:22 +02008450When present, change is marked as Work In Progress. The `notify` input is
Nitzan Gur-Furman08765cb2022-10-18 13:27:34 +02008451used if it's present, otherwise it will be overridden to `NONE`. +
8452Notifications for the reverted change will only sent once the result change is
8453no longer WIP. +
Youssef Elghareebfd02dae2020-09-03 21:56:30 +02008454If not set, the default is false.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008455|`validation_options`|optional|
8456Map with key-value pairs that are forwarded as options to the commit validation
8457listeners (e.g. can be used to skip certain validations). Which validation
8458options are supported depends on the installed commit validation listeners.
8459Gerrit core doesn't support any validation options, but commit validation
8460listeners that are implemented in plugins may. Please refer to the
8461documentation of the installed plugins to learn whether they support validation
8462options. Unknown validation options are silently ignored.
8463|=================================
Gal Paikinb81f56c2019-10-16 14:39:24 +02008464
8465[[revert-submission-info]]
8466=== RevertSubmissionInfo
Gal Paikin64777c72019-12-18 14:11:13 +01008467The `RevertSubmissionInfo` entity describes the revert changes.
Gal Paikinb81f56c2019-10-16 14:39:24 +02008468
8469[options="header",cols="1,6"]
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02008470|==============================
Gal Paikinb81f56c2019-10-16 14:39:24 +02008471|Field Name | Description
8472|`revert_changes` |
Edwin Kempin6e7fb4e2019-10-24 17:20:51 +02008473A list of link:#change-info[ChangeInfo] that describes the revert changes. Each
8474entity in that list is a revert change that was created in that revert
8475submission.
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02008476|==============================
Edwin Kempind2ec4152013-02-22 12:17:19 +01008477
Edwin Kempin67498de2013-02-25 16:15:34 +01008478[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008479=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01008480The `ReviewInfo` entity contains information about a review.
8481
David Pursehouseae367192014-11-25 17:24:47 +09008482[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01008483|===========================
8484|Field Name |Description
8485|`labels` |
8486The labels of the review as a map that maps the label names to the
8487voting values.
8488|===========================
8489
Viktar Donich316bf7a2016-07-06 11:29:01 -07008490[[review-update-info]]
8491=== ReviewerUpdateInfo
8492The `ReviewerUpdateInfo` entity contains information about updates to
8493change's reviewers set.
8494
8495[options="header",cols="1,6"]
8496|===========================
8497|Field Name |Description
8498|`updated`|
8499Timestamp of the update.
8500|`updated_by`|
8501The account which modified state of the reviewer in question as
8502link:rest-api-accounts.html#account-info[AccountInfo] entity.
8503|`reviewer`|
8504The reviewer account added or removed from the change as an
8505link:rest-api-accounts.html#account-info[AccountInfo] entity.
8506|`state`|
8507The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`.
8508|===========================
8509
Edwin Kempin67498de2013-02-25 16:15:34 +01008510[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008511=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01008512The `ReviewInput` entity contains information for adding a review to a
8513revision.
8514
David Pursehouseae367192014-11-25 17:24:47 +09008515[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01008516|============================
Gal Paikin3e984c22020-07-03 16:44:40 +03008517|Field Name ||Description
8518|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008519The message to be added as review comment.
Gal Paikin3e984c22020-07-03 16:44:40 +03008520|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01008521Apply this tag to the review comment message, votes, and inline
Ben Rohlfsd9be63f2021-02-04 09:01:46 +01008522comments. Tags with an 'autogenerated:' prefix may be used by CI or other
8523automated systems to distinguish them from human reviews. If another
8524message was posted on a newer patchset, but with the same tag, then the older
8525message will be hidden in the UI. Suffixes starting with `~` are not considered,
8526so `autogenerated:my-ci-system~trigger` and `autogenerated:my-ci-system~result`
8527will be considered being the same tag with regards to the hiding rule.
Gal Paikin3e984c22020-07-03 16:44:40 +03008528|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008529The votes that should be added to the revision as a map that maps the
8530label names to the voting values.
Gal Paikin3e984c22020-07-03 16:44:40 +03008531|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008532The comments that should be added as a map that maps a file path to a
8533list of link:#comment-input[CommentInput] entities.
Gal Paikin3e984c22020-07-03 16:44:40 +03008534|`robot_comments` |optional|
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008535The robot comments that should be added as a map that maps a file path
8536to a list of link:#robot-comment-input[RobotCommentInput] entities.
Gal Paikin3e984c22020-07-03 16:44:40 +03008537|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008538Draft handling that defines how draft comments are handled that are
8539already in the database but that were not also described in this
8540input. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05008541Allowed values are `PUBLISH`, `PUBLISH_ALL_REVISIONS` and `KEEP`. All values
8542except `PUBLISH_ALL_REVISIONS` operate only on drafts for a single revision. +
Dave Borowitzc0640542016-10-05 16:19:21 -04008543Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05008544If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value
8545besides `KEEP` is allowed.
Youssef Elghareeb3e4bf512021-05-12 18:40:27 +02008546|`draft_ids_to_publish` |optional|
8547List of draft IDs to be published. The draft IDs should belong to the current
8548user and be valid. If `drafts` is set to `PUBLISH`, then draft IDs should
8549contain drafts for the same revision that is requested for review. If `drafts`
8550is set to `KEEP`, then `draft_ids_to_publish` will be ignored and no draft
8551comments will be published. +
8552If not set, the default is to publish all drafts according to the `drafts` field.
Gal Paikin3e984c22020-07-03 16:44:40 +03008553|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008554Notify handling that defines to whom email notifications should be sent
8555after the review is stored. +
8556Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
8557If not set, the default is `ALL`.
Gal Paikin3e984c22020-07-03 16:44:40 +03008558|`notify_details` |optional|
Edwin Kempincd07df42016-12-01 09:10:09 +01008559Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008560of link:user-notify.html#recipient-types[recipient type] to
8561link:#notify-info[NotifyInfo] entity.
Gal Paikin3e984c22020-07-03 16:44:40 +03008562|`omit_duplicate_comments` |optional|
Bill Wendling692b4ec2015-10-19 15:40:57 -07008563If `true`, comments with the same content at the same place will be omitted.
Gal Paikin3e984c22020-07-03 16:44:40 +03008564|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07008565link:rest-api-accounts.html#account-id[\{account-id\}] the review
8566should be posted on behalf of. To use this option the caller must
8567have been granted `labelAs-NAME` permission for all keys of labels.
Gal Paikin3e984c22020-07-03 16:44:40 +03008568|`reviewers` |optional|
Patrick Hieselcf6d9352017-04-13 10:15:42 +02008569A list of link:rest-api-changes.html#reviewer-input[ReviewerInput]
Gal Paikin0184a2b2021-04-15 08:58:34 +02008570representing reviewers that should be added/removed to/from the change.
Gal Paikin3e984c22020-07-03 16:44:40 +03008571|`ready` |optional|
Logan Hanks53c36012017-06-30 13:47:54 -07008572If true, and if the change is work in progress, then start review.
8573It is an error for both `ready` and `work_in_progress` to be true.
Gal Paikin3e984c22020-07-03 16:44:40 +03008574|`work_in_progress` |optional|
Logan Hanks53c36012017-06-30 13:47:54 -07008575If true, mark the change as work in progress. It is an error for both
8576`ready` and `work_in_progress` to be true.
Gal Paikin3e984c22020-07-03 16:44:40 +03008577|`add_to_attention_set` |optional|
Gal Paikinc326de42020-06-16 18:49:00 +03008578list of link:#attention-set-input[AttentionSetInput] entities to add
Edwin Kempinc9219002023-09-08 08:07:21 +00008579to the link:user-attention-set.html[attention set]. Users that are not reviewers,
Gal Paikine631de22020-10-29 12:19:11 +01008580ccs, owner, or uploader are silently ignored.
Gal Paikin3e984c22020-07-03 16:44:40 +03008581|`remove_from_attention_set` |optional|
Gal Paikinc326de42020-06-16 18:49:00 +03008582list of link:#attention-set-input[AttentionSetInput] entities to remove
Edwin Kempinc9219002023-09-08 08:07:21 +00008583from the link:user-attention-set.html[attention set].
Gal Paikin3e984c22020-07-03 16:44:40 +03008584|`ignore_automatic_attention_set_rules`|optional|
8585If set to true, ignore all automatic attention set rules described in the
Edwin Kempinc9219002023-09-08 08:07:21 +00008586link:user-attention-set.html[attention set]. Updates in add_to_attention_set
Gal Paikinc326de42020-06-16 18:49:00 +03008587and remove_from_attention_set are not ignored.
Patrick Hiesel055aac62023-08-03 11:37:58 +00008588|`response_format_options` |optional|
8589List of link:#query-options[query options] to format the response.
Edwin Kempin67498de2013-02-25 16:15:34 +01008590|============================
8591
Aaron Gable843b0c12017-04-21 08:25:27 -07008592[[review-result]]
8593=== ReviewResult
8594The `ReviewResult` entity contains information regarding the updates
8595that were made to a review.
8596
8597[options="header",cols="1,^1,5"]
8598|============================
8599|Field Name ||Description
8600|`labels` |optional|
8601Map of labels to values after the review was posted. Null if any reviewer
8602additions were rejected.
8603|`reviewers` |optional|
8604Map of account or group identifier to
Gal Paikin721a40b2021-04-15 09:30:00 +02008605link:rest-api-changes.html#reviewer-result[ReviewerResult]
Gal Paikin0184a2b2021-04-15 08:58:34 +02008606representing the outcome of adding/removing a reviewer.
Aaron Gable843b0c12017-04-21 08:25:27 -07008607Absent if no reviewer additions were requested.
Logan Hankse81ad8e2017-07-18 09:45:46 -07008608|`ready` |optional|
8609If true, the change was moved from WIP to ready for review as a result of this
8610action. Not set if false.
Edwin Kempinddcf6f92022-08-02 11:21:05 +02008611|`error` |optional|
8612Error message for non-200 responses.
Patrick Hiesel055aac62023-08-03 11:37:58 +00008613|`change_info` |optional|
8614Post-update change information. Only set if `response_format_options` were
8615set.
Aaron Gable843b0c12017-04-21 08:25:27 -07008616|============================
8617
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008618[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008619=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008620The `ReviewerInfo` entity contains information about a reviewer and its
8621votes on a change.
8622
Edwin Kempin963dfd02013-02-27 12:39:32 +01008623`ReviewerInfo` has the same fields as
8624link:rest-api-accounts.html#account-info[AccountInfo] and includes
8625link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008626In addition `ReviewerInfo` has the following fields:
8627
David Pursehouseae367192014-11-25 17:24:47 +09008628[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008629|==========================
8630|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008631|`approvals` |
8632The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09008633approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Patrick Hiesel11873ef2017-03-17 17:36:05 +01008634|`_account_id` |
8635This field is inherited from `AccountInfo` but is optional here if an
8636unregistered reviewer was added by email. See
8637link:rest-api-changes.html#add-reviewer[add-reviewer] for details.
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008638|==========================
8639
Edwin Kempin392328e2013-02-25 12:50:03 +01008640[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008641=== ReviewerInput
Gal Paikin0184a2b2021-04-15 08:58:34 +02008642The `ReviewerInput` entity contains information for adding or removing
8643reviewers to/from the change.
Edwin Kempin392328e2013-02-25 12:50:03 +01008644
David Pursehouseae367192014-11-25 17:24:47 +09008645[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01008646|=============================
8647|Field Name ||Description
8648|`reviewer` ||
Edwin Kempin392328e2013-02-25 12:50:03 +01008649The link:rest-api-accounts.html#account-id[ID] of one account that
Gal Paikin0184a2b2021-04-15 08:58:34 +02008650should be added/removed as reviewer or the link:rest-api-groups.html#group-id[
Han-Wen Nienhuyse6229052020-01-29 12:51:36 +01008651ID] of one internal group for which all members should be added as reviewers. +
Edwin Kempin392328e2013-02-25 12:50:03 +01008652If an ID identifies both an account and a group, only the account is
8653added as reviewer to the change.
Han-Wen Nienhuyse6229052020-01-29 12:51:36 +01008654External groups, such as LDAP groups, will be silently omitted from a
8655link:#set-review[set-review] or
Gal Paikin0184a2b2021-04-15 08:58:34 +02008656link:rest-api-changes.html#add-reviewer[add-reviewer] call. A group can only be
8657specified for adding reviewers, not for removing them.
Edwin Kempincd07df42016-12-01 09:10:09 +01008658|`state` |optional|
Gal Paikin0184a2b2021-04-15 08:58:34 +02008659Add reviewer in this state. Possible reviewer states are `REVIEWER`,
8660`CC` and `REMOVED`. If not given, defaults to `REVIEWER`.
Edwin Kempincd07df42016-12-01 09:10:09 +01008661|`confirmed` |optional|
Edwin Kempin392328e2013-02-25 12:50:03 +01008662Whether adding the reviewer is confirmed. +
8663The Gerrit server may be configured to
8664link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
8665confirmation] when adding a group as reviewer that has many members.
Edwin Kempincd07df42016-12-01 09:10:09 +01008666|`notify` |optional|
Sven Selberg4d64f972016-09-26 16:15:02 +02008667Notify handling that defines to whom email notifications should be sent
8668after the reviewer is added. +
8669Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
8670If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01008671|`notify_details`|optional|
8672Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008673of link:user-notify.html#recipient-types[recipient type] to
8674link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01008675|=============================
Edwin Kempin392328e2013-02-25 12:50:03 +01008676
Gal Paikin721a40b2021-04-15 09:30:00 +02008677[[reviewer-result]]
8678=== ReviewerResult
Gal Paikin0184a2b2021-04-15 08:58:34 +02008679The `ReviewerResult` entity describes the result of modifying reviewers of
8680a change.
Gal Paikin721a40b2021-04-15 09:30:00 +02008681
8682[options="header",cols="1,^1,5"]
8683|===========================
8684|Field Name ||Description
8685|`input` ||
8686Value of the `reviewer` field from link:#reviewer-input[ReviewerInput]
8687set while adding the reviewer.
8688|`reviewers` |optional|
8689The newly added reviewers as a list of link:#reviewer-info[
8690ReviewerInfo] entities.
8691|`ccs` |optional|
Gal Paikinefb4ad52021-04-15 09:44:40 +02008692The newly CCed accounts as a list of
8693link:rest-api-accounts.html#account-info[AccountInfo] entities. This field will
Gal Paikin0184a2b2021-04-15 08:58:34 +02008694only appear if the requested `state` for the reviewer was `CC`.
8695|`removed` |optional|
8696The newly removed accounts as a list of
8697link:rest-api-accounts.html#account-info[AccountInfo] entities.
8698This field will only appear if the requested `state` for the reviewer was
8699`REMOVED`.
Gal Paikin721a40b2021-04-15 09:30:00 +02008700|`error` |optional|
8701Error message explaining why the reviewer could not be added. +
8702If a group was specified in the input and an error is returned, it
8703means that none of the members were added as reviewer.
8704|`confirm` |`false` if not set|
8705Whether adding the reviewer requires confirmation.
8706|===========================
8707
Edwin Kempine3446292013-02-19 16:40:14 +01008708[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008709=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01008710The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07008711Not all fields are returned by default. Additional fields can
8712be obtained by adding `o` parameters as described in
8713link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01008714
David Pursehouseae367192014-11-25 17:24:47 +09008715[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01008716|===========================
8717|Field Name ||Description
David Pursehouse4de41112016-06-28 09:24:08 +09008718|`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`,
8719`MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`.
Kasper Nilssonbe3616d2018-01-23 14:10:36 -08008720|`_number` ||The patch set number, or `edit` if the patch set is an edit.
Edwin Kempin04cbd342015-02-19 16:31:22 +01008721|`created` ||
8722The link:rest-api.html#timestamp[timestamp] of when the patch set was
8723created.
8724|`uploader` ||
8725The uploader of the patch set as an
8726link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempinccc9da02023-01-23 17:57:15 +01008727|`real_uploader`|optional|
8728The real uploader of the patch set as an
8729link:rest-api-accounts.html#account-info[AccountInfo] entity. +
8730Only set if the upload was done on behalf of another user.
Edwin Kempin4569ced2014-11-25 16:45:05 +01008731|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01008732|`fetch` ||
8733Information about how to fetch this patch set. The fetch information is
8734provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07008735"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
8736only included if a plugin implementing the
8737link:intro-project-owner.html#download-commands[download commands]
8738interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07008739|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01008740link:#commit-info[CommitInfo] entity.
Youssef Elghareeba1121442023-06-14 14:53:59 +02008741|`parents_data` |optional|
8742The parent commits of this patch-set commit as a list of
8743link:#parent-info[ParentInfo] entities. In each parent, we include the target
8744branch name if the parent is a merged commit in the target branch. Otherwise,
8745we include the change and patch-set numbers of the parent change. +
8746Only set if the `PARENTS` option is set.
Youssef Elghareeb4c115442023-06-15 18:16:42 +02008747|`branch` | optional|The name of the target branch that this revision is
8748set to be merged into. +
8749Note that if the change is moved with the link:#move-change[Move Change]
8750endpoint, this field can be different for different patchsets. For example,
8751if the change is moved and a new patchset is uploaded afterwards, the
8752link:#revision-info[RevisionInfo] of the previous patchset will contain the old
8753`branch`, but the newer patchset will contain the new `branch`.
Shawn Pearce12e51592013-07-13 22:08:40 -07008754|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01008755The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07008756link:#file-info[FileInfo] entities. Only set if
8757link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
8758option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07008759|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07008760Actions the caller might be able to perform on this revision. The
8761information is a map of view name to link:#action-info[ActionInfo]
8762entities.
Khai Dob3139b7532014-09-19 15:13:04 -07008763|`reviewed` |optional|
8764Indicates whether the caller is authenticated and has commented on the
8765current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Quinten Yearsley28cd2122019-06-10 14:41:13 -07008766|`commit_with_footers` |optional|
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07008767If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
8768this is the current patch set, contains the full commit message with
8769Gerrit-specific commit footers, as if this revision were submitted
8770using the link:project-configuration.html#cherry_pick[Cherry Pick]
8771submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04008772|`push_certificate` |optional|
8773If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
8774contains the push certificate provided by the user when uploading this
8775patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
8776This field is always set if the option is requested; if no push
8777certificate was provided, it is set to an empty object.
Aaron Gable621c9b62017-04-21 09:24:20 -07008778|`description` |optional|
8779The description of this patchset, as displayed in the patchset
8780selector menu. May be null if no description is set.
Edwin Kempine3446292013-02-19 16:40:14 +01008781|===========================
8782
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008783[[robot-comment-info]]
8784=== RobotCommentInfo
8785The `RobotCommentInfo` entity contains information about a robot inline
8786comment.
8787
Alice Kober-Sotzek7d890be2020-10-01 17:41:56 +02008788`RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>>
8789except for the `unresolved` field which doesn't exist for robot comments.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008790In addition `RobotCommentInfo` has the following fields:
8791
8792[options="header",cols="1,^1,5"]
8793|===========================
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01008794|Field Name ||Description
8795|`robot_id` ||The ID of the robot that generated this comment.
8796|`robot_run_id` ||An ID of the run of the robot.
8797|`url` |optional|URL to more information.
8798|`properties` |optional|Robot specific properties as map that maps arbitrary
8799keys to values.
8800|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
8801<<fix-suggestion-info,FixSuggestionInfo>> entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008802|===========================
8803
8804[[robot-comment-input]]
8805=== RobotCommentInput
8806The `RobotCommentInput` entity contains information for creating an inline
8807robot comment.
8808
Alice Kober-Sotzek7d890be2020-10-01 17:41:56 +02008809[options="header",cols="1,^1,5"]
8810|===========================
8811|Field Name ||Description
8812|`path` ||
8813link:#file-id[The file path] for which the inline comment should be added.
8814|`side` |optional|
8815The side on which the comment should be added. +
8816Allowed values are `REVISION` and `PARENT`. +
8817If not set, the default is `REVISION`.
8818|`line` |optional|
8819The number of the line for which the comment should be added. +
8820`0` if it is a file comment. +
8821If neither line nor range is set, a file comment is added. +
8822If range is set, this value is ignored in favor of the `end_line` of the range.
8823|`range` |optional|
8824The range of the comment as a link:#comment-range[CommentRange]
8825entity.
8826|`in_reply_to` |optional|
8827The URL encoded UUID of the comment to which this comment is a reply.
8828|`message` |optional|
8829The comment message.
8830|`robot_id` ||The ID of the robot that generated this comment.
8831|`robot_run_id` ||An ID of the run of the robot.
8832|`url` |optional|URL to more information.
8833|`properties` |optional|Robot specific properties as map that maps arbitrary
8834keys to values.
8835|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
8836<<fix-suggestion-info,FixSuggestionInfo>> entities.
8837|===========================
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008838
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008839[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008840=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008841The `RuleInput` entity contains information to test a Prolog rule.
8842
David Pursehouseae367192014-11-25 17:24:47 +09008843[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008844|===========================
8845|Field Name ||Description
8846|`rule`||
8847Prolog code to execute instead of the code in `refs/meta/config`.
8848|`filters`|`RUN` if not set|
8849When `RUN` filter rules in the parent projects are called to
8850post-process the results of the project specific rule. This
8851behavior matches how the rule will execute if installed. +
8852If `SKIP` the parent filters are not called, allowing the test
8853to return results from the input rule.
8854|===========================
8855
Edwin Kempin0eddba02013-02-22 15:30:12 +01008856[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008857=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01008858The `SubmitInput` entity contains information for submitting a change.
8859
David Pursehouseae367192014-11-25 17:24:47 +09008860[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01008861|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01008862|Field Name ||Description
Edwin Kempincd07df42016-12-01 09:10:09 +01008863|`on_behalf_of` |optional|
Dave Borowitzc6d143d2016-02-24 12:32:23 -05008864If set, submit the change on behalf of the given user. The value may take any
8865format link:rest-api-accounts.html#account-id[accepted by the accounts REST
8866API]. Using this option requires
8867link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
8868permission on the branch.
Edwin Kempincd07df42016-12-01 09:10:09 +01008869|`notify` |optional|
Stephen Lia5a5ef02016-03-31 16:55:53 -07008870Notify handling that defines to whom email notifications should be sent after
8871the change is submitted. +
8872Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Nitzan Gur-Furman9da317c2022-10-07 11:19:53 +02008873If not set, the default is `ALL`.+
8874Ignored if a post approval diff is present (i.e. if the change is submitted
8875with copied approvals), because in this case everyone should be informed
8876about the non-reviewed diff which has been applied after the change has been
8877approved so that they can take action if the post approval diff looks
8878unexpected. In other words if a post approval diff is present `ALL` is
8879enforced.
Edwin Kempincd07df42016-12-01 09:10:09 +01008880|`notify_details`|optional|
8881Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008882of link:user-notify.html#recipient-types[recipient type] to
8883link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01008884|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01008885
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008886[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008887=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008888The `SubmitRecord` entity describes results from a submit_rule.
Dave Borowitz6453fce2016-09-22 16:11:56 +02008889Fields in this entity roughly correspond to the fields set by `LABELS`
8890in link:#label-info[LabelInfo].
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008891
David Pursehouseae367192014-11-25 17:24:47 +09008892[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008893|===========================
8894|Field Name ||Description
8895|`status`||
8896`OK`, the change can be submitted. +
8897`NOT_READY`, additional labels are required before submit. +
8898`CLOSED`, closed changes cannot be submitted. +
8899`RULE_ERROR`, rule code failed with an error.
8900|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01008901Map of labels that are approved; an
8902link:rest-api-accounts.html#account-info[AccountInfo] identifies the
8903voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008904|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01008905Map of labels that are preventing submit;
8906link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008907|`need`|optional|
8908Map of labels that need to be given to submit. The value is
8909currently an empty object.
8910|`may`|optional|
8911Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01008912link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
8913if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008914|`impossible`|optional|
8915Map of labels that should have been in `need` but cannot be
8916used by any user because of access restrictions. The value
8917is currently an empty object.
8918|`error_message`|optional|
8919When status is RULE_ERROR this message provides some text describing
8920the failure of the rule predicate.
8921|===========================
8922
Youssef Elghareeb02d33aa2021-10-04 13:24:52 +02008923[[submit-record-info]]
8924=== SubmitRecordInfo
8925The `SubmitRecordInfo` entity describes results from a submit_rule.
8926
8927[options="header",cols="1,^1,5"]
8928|===========================
8929|Field Name ||Description
8930|`rule_name`||
8931The name of the submit rule that created this submit record. The submit rule is
8932specified in the form of "$plugin~$rule" where `$plugin` is the plugin name
8933and `$rule` is the name of the class that implemented the submit rule.
8934|`status`||
8935`OK`, the change can be submitted. +
8936`NOT_READY`, additional labels are required before submit. +
8937`CLOSED`, closed changes cannot be submitted. +
8938`FORCED`, the change was submitted bypassing the submit rule. +
8939`RULE_ERROR`, rule code failed with an error.
8940|`labels`|optional|
8941A list of labels, each containing the following fields. +
8942 * `label`: the label name. +
8943 * `status`: the label status: {`OK`, `REJECT`, `MAY`, `NEED`, `IMPOSSIBLE`}. +
8944 * `appliedBy`: the link:rest-api-accounts.html#account-info[AccountInfo]
8945 that applied the vote to the label.
8946|`requirements`|optional|
8947List of the link:rest-api-changes.html#requirement[requirements] to be met
8948before this change can be submitted.
8949|`error_message`|optional|
8950When status is RULE_ERROR this message provides some text describing
8951the failure of the rule predicate.
8952|===========================
8953
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008954[[submit-requirement-expression-info]]
8955=== SubmitRequirementExpressionInfo
8956The `SubmitRequirementExpressionInfo` describes the result of evaluating a
8957single submit requirement expression, for example `label:code-review=+2`.
8958
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008959[options="header",cols="1,^1,5"]
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008960|===========================
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008961|Field Name ||Description
8962|`expression`|optional|
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008963The submit requirement expression as a string, for example
8964`branch:refs/heads/foo and label:verified=+1`.
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008965|`fulfilled`||
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008966True if the submit requirement is fulfilled for the change.
Youssef Elghareebdf62c5a2022-04-08 12:23:23 +02008967|`status`||
8968A string containing the status of evaluating the expression which can be one
8969of the following: +
8970 * `PASS` - expression was evaluated and result is true. +
8971 * `FAIL` - expression was evaluated and result is false. +
8972 * `ERROR` - an error occurred while evaluating the expression. +
8973 * `NOT_EVALUATED` - expression was not evaluated.
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008974|`passing_atoms`|optional|
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008975A list of passing atoms as strings. For the above expression,
8976`passing_atoms` can contain ["branch:refs/heads/foo"] if the branch predicate is
8977fulfilled for the change.
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008978|`failing_atoms`|optional|
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008979A list of failing atoms. This is similar to `passing_atoms` except that it
8980contains the list of predicates that are not fulfilled for the change.
Youssef Elghareeb393be612021-11-16 13:39:33 +01008981|`error_message`|optional|
8982If the submit requirement fails during evaluation, this string will contain
8983an error message describing why it failed.
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008984|===========================
8985
Youssef Elghareebd5986932021-10-15 11:45:23 +02008986[[submit-requirement-input]]
8987=== SubmitRequirementInput
8988The `SubmitRequirementInput` entity describes a submit requirement.
8989
8990[options="header",cols="1,^1,5"]
8991|===========================
8992|Field Name ||Description
8993|`name`||
8994The submit requirement name.
8995|`description`|optional|
8996Description of the submit requirement.
8997|`applicability_expression`|optional|
8998Query expression that can be evaluated on any change. If evaluated to true on a
8999change, the submit requirement is then applicable for this change.
9000If not specified, the submit requirement is applicable for all changes.
9001|`submittability_expression`||
9002Query expression that can be evaluated on any change. If evaluated to true on a
9003change, the submit requirement is fulfilled and not blocking change submission.
9004|`override_expression`|optional|
9005Query expression that can be evaluated on any change. If evaluated to true on a
9006change, the submit requirement is overridden and not blocking change submission.
9007|`allow_override_in_child_projects`|optional|
9008Whether this submit requirement can be overridden in child projects. Default is
9009`true`.
9010|===========================
9011
Youssef Elghareeb79f473622021-05-26 18:58:40 +02009012[[submit-requirement-result-info]]
9013=== SubmitRequirementResultInfo
9014The `SubmitRequirementResultInfo` describes the result of evaluating a
9015submit requirement on a change.
9016
9017[options="header",cols="1,^1,5"]
9018|===========================
9019|Field Name ||Description
9020|`name`||
9021The submit requirement name.
9022|`description`|optional|
9023Description of the submit requirement.
9024|`status`||
9025Status describing the result of evaluating the submit requirement. The status
Youssef Elghareebf592ed12021-11-26 15:52:06 +01009026is one of (`SATISFIED`, `UNSATISFIED`, `OVERRIDDEN`, `NOT_APPLICABLE`, `ERROR`,
9027`FORCED`).
Youssef Elghareeb024103e2021-09-06 14:41:04 +02009028|`is_legacy`||
9029If true, this submit requirement result was created from a legacy
9030link:#submit-record[SubmitRecord]. Otherwise, it was created by evaluating a
9031submit requirement.
Youssef Elghareeb79f473622021-05-26 18:58:40 +02009032|`applicability_expression_result`|optional|
9033A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo]
9034containing the result of evaluating the applicability expression. Not set if the
9035submit requirement did not define an applicability expression.
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02009036Note that fields `expression`, `passing_atoms` and `failing_atoms` are always
9037omitted for the `applicability_expression_result`.
Youssef Elghareebdf62c5a2022-04-08 12:23:23 +02009038|`submittability_expression_result`||
Youssef Elghareeb79f473622021-05-26 18:58:40 +02009039A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo]
Marija Savtchouk6d87bae2022-01-20 17:06:22 +00009040containing the result of evaluating the submittability expression. +
Youssef Elghareebdf62c5a2022-04-08 12:23:23 +02009041If the submit requirement does not apply, the `status` field of the result
9042will be set to `NOT_EVALUATED`.
Youssef Elghareeb79f473622021-05-26 18:58:40 +02009043|`override_expression_result`|optional|
9044A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo]
Marija Savtchouk6d87bae2022-01-20 17:06:22 +00009045containing the result of evaluating the override expression. +
Youssef Elghareebdf62c5a2022-04-08 12:23:23 +02009046Not set if the submit requirement did not define an override expression. If the
9047submit requirement does not apply, the `status` field of the result will be set
9048to `NOT_EVALUATED`.
Youssef Elghareeb79f473622021-05-26 18:58:40 +02009049|===========================
9050
Jonathan Nieder2a629b02016-06-16 15:15:25 -07009051[[submitted-together-info]]
9052=== SubmittedTogetherInfo
9053The `SubmittedTogetherInfo` entity contains information about a
9054collection of changes that would be submitted together.
9055
9056[options="header",cols="1,6"]
9057|===========================
9058|Field Name |Description
9059|`changes` |
9060A list of ChangeInfo entities representing the changes to be submitted together.
9061|`non_visible_changes`|
9062The number of changes to be submitted together that the current user
9063cannot see. (This count includes changes that are visible to the
9064current user when their reason for being submitted together involves
9065changes the user cannot see.)
9066|===========================
9067
Edwin Kempin521c1242015-01-23 12:44:44 +01009068[[suggested-reviewer-info]]
9069=== SuggestedReviewerInfo
9070The `SuggestedReviewerInfo` entity contains information about a reviewer
9071that can be added to a change (an account or a group).
9072
9073`SuggestedReviewerInfo` has either the `account` field that contains
9074the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
9075the `group` field that contains the
9076link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
9077
Logan Hanksab3c81e2016-07-20 15:42:52 -07009078[options="header",cols="1,^1,5"]
9079|===========================
9080|Field Name ||Description
9081|`account` |optional|
9082An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the
9083suggestion is an account.
9084|`group` |optional|
9085A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the
9086suggestion is a group.
9087|`count` ||
9088The total number of accounts in the suggestion. This is `1` if `account` is
9089present. If `group` is present, the total number of accounts that are
9090members of the group is returned (this count includes members of nested
9091groups).
9092|`confirm` |optional|
9093True if `group` is present and `count` is above the threshold where the
9094`confirmed` flag must be passed to add the group as a reviewer.
9095|===========================
9096
Edwin Kempin64006bb2013-02-22 08:17:04 +01009097[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08009098=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01009099The `TopicInput` entity contains information for setting a topic.
9100
David Pursehouseae367192014-11-25 17:24:47 +09009101[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01009102|===========================
9103|Field Name ||Description
9104|`topic` |optional|The topic. +
9105The topic will be deleted if not set.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02009106Topic can't contain quotation marks.
Edwin Kempin64006bb2013-02-22 08:17:04 +01009107|===========================
9108
Makson Lee3568a932017-08-28 17:12:03 +08009109[[tracking-id-info]]
9110=== TrackingIdInfo
9111The `TrackingIdInfo` entity describes a reference to an external tracking system.
9112
9113[options="header",cols="1,6"]
9114|======================
9115|Field Name|Description
9116|`system` |The name of the external tracking system.
9117|`id` |The tracking id.
9118|======================
9119
Oleg Aravinbf313bb2016-10-24 12:28:56 -07009120[[voting-range-info]]
9121=== VotingRangeInfo
9122The `VotingRangeInfo` entity describes the continuous voting range from min
9123to max values.
9124
9125[options="header",cols="1,6"]
9126|======================
9127|Field Name|Description
9128|`min` |The minimum voting value.
9129|`max` |The maximum voting value.
9130|======================
9131
Edwin Kempinbd885ff2014-04-11 16:11:56 +02009132[[web-link-info]]
9133=== WebLinkInfo
Ben Rohlfs25c478112023-03-16 16:06:40 +01009134The `WebLinkInfo` entity describes a link to an external site. Depending on the
9135context and the provided data the UI may decide to show the link as a text link,
9136a linkified icon, or both.
9137
9138If the `tooltip` is not provided, then the UI may fall back to showing something
9139like "Open in External Tool".
9140
9141Weblinks will always be opened in a new tab.
Edwin Kempinbd885ff2014-04-11 16:11:56 +02009142
Edwin Kempinaf35ce42021-01-29 13:50:04 +01009143[options="header",cols="1,^1,5"]
9144|========================
9145|Field Name ||Description
Ben Rohlfs25c478112023-03-16 16:06:40 +01009146|`name` ||The text to be linkified.
9147|`tooltip` |optional|Tooltip to show when hovering over the link. Using "Open
9148in $NAME_OF_EXTERNAL_TOOL" is a good option here.
Edwin Kempinaf35ce42021-01-29 13:50:04 +01009149|`url` ||The link URL.
9150|`image_url`|optional|URL to the icon of the link.
Edwin Kempinaf35ce42021-01-29 13:50:04 +01009151|========================
Edwin Kempinbd885ff2014-04-11 16:11:56 +02009152
Alan Tokaev392cfca2017-04-28 11:11:31 +02009153[[work-in-progress-input]]
9154=== WorkInProgressInput
9155The `WorkInProgressInput` entity contains additional information for a change
9156set to WorkInProgress/ReadyForReview.
9157
9158[options="header",cols="1,^1,5"]
9159|=============================
9160|Field Name ||Description
9161|`message` |optional|
9162Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview.
9163|=============================
9164
Edwin Kempind0a63922013-01-23 16:32:59 +01009165GERRIT
9166------
9167Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07009168
9169SEARCHBOX
9170---------