blob: 828dd03670326f518477926a7449fe0254cf0b19 [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
Edwin Kempin37440832013-02-06 11:36:00 +0100382.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100383----
Edwin Kempinea621482013-10-16 12:58:24 +0200384 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 +0100385----
Edwin Kempind0a63922013-01-23 16:32:59 +0100386
Edwin Kempin37440832013-02-06 11:36:00 +0100387.Response
388----
Edwin Kempind0a63922013-01-23 16:32:59 +0100389 HTTP/1.1 200 OK
390 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900391 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100392
393 )]}'
394 [
395 {
David Pursehousec3be6ad2014-07-18 12:03:06 +0900396 "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
Edwin Kempind0a63922013-01-23 16:32:59 +0100397 "project": "gerrit",
398 "branch": "master",
399 "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
400 "subject": "Use an EventBus to manage star icons",
401 "status": "NEW",
402 "created": "2012-04-25 00:52:25.580000000",
403 "updated": "2012-04-25 00:52:25.586000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100404 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100405 "insertions": 16,
406 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100407 "_number": 97,
408 "owner": {
409 "name": "Shawn Pearce"
410 },
411 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c",
412 "revisions": {
413 "184ebe53805e102605d11f6b143486d15c23a09c": {
David Pursehouse4de41112016-06-28 09:24:08 +0900414 "kind": "REWORK",
Edwin Kempind0a63922013-01-23 16:32:59 +0100415 "_number": 1,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100416 "ref": "refs/changes/97/97/1",
Edwin Kempind0a63922013-01-23 16:32:59 +0100417 "fetch": {
418 "git": {
419 "url": "git://localhost/gerrit",
Edwin Kempinea621482013-10-16 12:58:24 +0200420 "ref": "refs/changes/97/97/1",
421 "commands": {
422 "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
423 "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
424 "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
425 "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1"
426 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100427 },
428 "http": {
Edwin Kempinea621482013-10-16 12:58:24 +0200429 "url": "http://myuser@127.0.0.1:8080/gerrit",
430 "ref": "refs/changes/97/97/1",
431 "commands": {
432 "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
433 "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
434 "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",
435 "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1"
436 }
437 },
438 "ssh": {
439 "url": "ssh://myuser@*:29418/gerrit",
440 "ref": "refs/changes/97/97/1",
441 "commands": {
442 "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
443 "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
444 "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
445 "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1"
446 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100447 }
448 },
449 "commit": {
450 "parents": [
451 {
452 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
453 "subject": "Migrate contributor agreements to All-Projects."
454 }
455 ],
456 "author": {
457 "name": "Shawn O. Pearce",
458 "email": "sop@google.com",
459 "date": "2012-04-24 18:08:08.000000000",
460 "tz": -420
461 },
462 "committer": {
463 "name": "Shawn O. Pearce",
464 "email": "sop@google.com",
465 "date": "2012-04-24 18:08:08.000000000",
466 "tz": -420
467 },
468 "subject": "Use an EventBus to manage star icons",
469 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
470 },
471 "files": {
472 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200473 "lines_deleted": 8,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100474 "size_delta": -412,
475 "size": 7782
Edwin Kempind0a63922013-01-23 16:32:59 +0100476 },
477 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200478 "lines_inserted": 1,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100479 "size_delta": 23,
480 "size": 6762
Edwin Kempind0a63922013-01-23 16:32:59 +0100481 },
482 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": {
483 "lines_inserted": 11,
Edwin Kempin640f9842015-10-08 15:53:20 +0200484 "lines_deleted": 19,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100485 "size_delta": -298,
486 "size": 47023
Edwin Kempind0a63922013-01-23 16:32:59 +0100487 },
488 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": {
489 "lines_inserted": 23,
Edwin Kempin640f9842015-10-08 15:53:20 +0200490 "lines_deleted": 20,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100491 "size_delta": 132,
492 "size": 17727
Edwin Kempind0a63922013-01-23 16:32:59 +0100493 },
494 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": {
495 "status": "D",
Edwin Kempin640f9842015-10-08 15:53:20 +0200496 "lines_deleted": 139,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100497 "size_delta": -5512,
498 "size": 13098
Edwin Kempind0a63922013-01-23 16:32:59 +0100499 },
500 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": {
501 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +0200502 "lines_inserted": 204,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100503 "size_delta": 8345,
504 "size": 8345
Edwin Kempind0a63922013-01-23 16:32:59 +0100505 },
506 "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200507 "lines_deleted": 9,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100508 "size_delta": -343,
509 "size": 5385
Edwin Kempind0a63922013-01-23 16:32:59 +0100510 }
511 }
512 }
513 }
514 }
515 ]
516----
517
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100518[[get-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800519=== Get Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800520--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100521'GET /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800522--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100523
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100524Retrieves a change.
525
Dave Borowitz0314f732013-10-03 09:34:30 -0700526Additional fields can be obtained by adding `o` parameters, each
527option requires more database lookups and slows down the query
528response time to the client so they are generally disabled by
529default. Fields are described in link:#list-changes[Query Changes].
530
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100531.Request
532----
533 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
534----
535
536As response a link:#change-info[ChangeInfo] entity is returned that
537describes the change.
538
539.Response
540----
541 HTTP/1.1 200 OK
542 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900543 Content-Type: application/json; charset=UTF-8
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100544
545 )]}'
546 {
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100547 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
548 "project": "myProject",
549 "branch": "master",
Edwin Kempin065e5a22022-12-19 13:34:10 +0100550 "attention_set": {
551 "1000096": {
Gal Paikinc326de42020-06-16 18:49:00 +0300552 "account": {
Edwin Kempin065e5a22022-12-19 13:34:10 +0100553 "_account_id": 1000096,
554 "name": "John Doe",
555 "email": "john.doe@example.com"
Gal Paikinc326de42020-06-16 18:49:00 +0300556 },
Edwin Kempin065e5a22022-12-19 13:34:10 +0100557 "last_update": "2013-02-21 11:16:36.775000000",
558 "reason": "reviewer or cc replied"
Gal Paikinc326de42020-06-16 18:49:00 +0300559 }
Edwin Kempin065e5a22022-12-19 13:34:10 +0100560 },
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100561 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
562 "subject": "Implementing Feature X",
563 "status": "NEW",
564 "created": "2013-02-01 09:59:32.126000000",
565 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100566 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100567 "insertions": 34,
568 "deletions": 101,
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100569 "_number": 3965,
570 "owner": {
571 "name": "John Doe"
572 }
573 }
574----
575
Han-Wen Nienhuys63b81f22021-02-17 10:31:01 +0100576Historical state of the change can be retrieved by specifying the
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +0200577`meta=SHA-1` parameter. This will use a historical NoteDb snapshot to
578populate ChangeInfo. If the SHA-1 is not reachable as a NoteDb state,
Han-Wen Nienhuys63b81f22021-02-17 10:31:01 +0100579status code 412 is returned.
580
Alex Spradlinb65494f2021-03-03 11:22:27 -0800581[[get-meta-diff]]
582=== Get Meta Diff
583--
Han-Wen Nienhuys524317a2021-04-08 12:12:35 +0200584'GET /changes/link:#change-id[\{change-id\}]/meta_diff?old=SHA-1&meta=SHA-1'
Alex Spradlinb65494f2021-03-03 11:22:27 -0800585--
586
587Retrieves the difference between two historical states of a change
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +0200588by specifying the `old=SHA-1` and the `meta=SHA-1` parameters.
Alex Spradlinb65494f2021-03-03 11:22:27 -0800589
590If the `old` parameter is not provided, the parent of the `meta`
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +0200591SHA-1 is used. If the `meta` parameter is not provided, the current
Alex Spradlinb65494f2021-03-03 11:22:27 -0800592state of the change is used. If neither are provided, the
593difference between the current state of the change and its previous
594state is returned.
595
596Additional fields can be obtained by adding `o` parameters, analogous
597to link:#get-change[Get Change], and the same concerns for Get Change hold for
598this endpoint too. Fields are described in link:#list-changes[Query Changes].
599
600.Request
601----
602 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/meta_diff?old=b083abc34eb6dbdb9e154ba092fc198000e997b4&meta=63b81f2bde703ae07787a940e8fdf9a1828605b1 HTTP/1.0
603----
604
605As a response, two link:#change-info[ChangeInfo] entities are returned
Alex Spradlin94099b62021-09-29 13:15:23 -0700606that describe information added and removed from the `old` change state, and
607the two link:#change-info[ChangeInfo] entities that generated the diff are
608returned. Only fields that differ between the change's two states are returned.
Alex Spradlinb65494f2021-03-03 11:22:27 -0800609
610.Response
611----
612 HTTP/1.1 200 OK
613 Content-Disposition: attachment
614 Content-Type: application/json; charset=UTF-8
615
616 )]}'
617 {
618 "added": {
Edwin Kempin065e5a22022-12-19 13:34:10 +0100619 "attention_set": {
620 "1000096": {
Alex Spradlinb65494f2021-03-03 11:22:27 -0800621 "account": {
Edwin Kempin065e5a22022-12-19 13:34:10 +0100622 "_account_id": 1000096,
623 "name": "John Doe",
624 "email": "john.doe@example.com"
Alex Spradlinb65494f2021-03-03 11:22:27 -0800625 },
Edwin Kempin065e5a22022-12-19 13:34:10 +0100626 "last_update": "2013-02-21 11:16:36.775000000",
627 "reason": "reviewer or cc replied"
Alex Spradlinb65494f2021-03-03 11:22:27 -0800628 }
Edwin Kempin065e5a22022-12-19 13:34:10 +0100629 },
Alex Spradlinb65494f2021-03-03 11:22:27 -0800630 "updated": "2013-02-21 11:16:36.775000000",
631 "topic": "new-topic"
632 },
633 "removed": {
Alex Spradlin94099b62021-09-29 13:15:23 -0700634 "updated": "2013-02-01 09:59:32.126000000",
Alex Spradlinb65494f2021-03-03 11:22:27 -0800635 "topic": "old-topic"
Alex Spradlin94099b62021-09-29 13:15:23 -0700636 },
637 "old_change_info": {
638 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
639 "project": "myProject",
640 "branch": "master",
641 "attention_set": [],
642 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
643 "subject": "Implementing Feature X",
644 "status": "NEW",
645 "topic": "old-topic",
646 "created": "2013-02-01 09:59:32.126000000",
647 "updated": "2013-02-01 09:59:32.126000000",
648 "mergeable": true,
649 "insertions": 34,
650 "deletions": 101,
651 "_number": 3965,
652 "owner": {
653 "name": "John Doe"
654 }
655 },
656 "new_change_info": {
657 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
658 "project": "myProject",
659 "branch": "master",
Edwin Kempin065e5a22022-12-19 13:34:10 +0100660 "attention_set": {
661 "1000096": {
Alex Spradlin94099b62021-09-29 13:15:23 -0700662 "account": {
Edwin Kempin065e5a22022-12-19 13:34:10 +0100663 "_account_id": 1000096,
664 "name": "John Doe",
665 "email": "john.doe@example.com"
Alex Spradlin94099b62021-09-29 13:15:23 -0700666 },
Edwin Kempin065e5a22022-12-19 13:34:10 +0100667 "last_update": "2013-02-21 11:16:36.775000000",
668 "reason": "reviewer or cc replied"
Alex Spradlin94099b62021-09-29 13:15:23 -0700669 }
Edwin Kempin065e5a22022-12-19 13:34:10 +0100670 },
Alex Spradlin94099b62021-09-29 13:15:23 -0700671 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
672 "subject": "Implementing Feature X",
673 "status": "NEW",
674 "topic": "new-topic",
675 "created": "2013-02-01 09:59:32.126000000",
676 "updated": "2013-02-21 11:16:36.775000000",
677 "mergeable": true,
678 "insertions": 34,
679 "deletions": 101,
680 "_number": 3965,
681 "owner": {
682 "name": "John Doe"
683 }
684 },
Alex Spradlinb65494f2021-03-03 11:22:27 -0800685 }
686----
687
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +0200688If the provided SHA-1 for `meta` is not reachable as a NoteDb
689state, the status code 412 is returned. If the SHA-1 for `old`
Alex Spradlinb65494f2021-03-03 11:22:27 -0800690is not reachable, the difference between the change at state
691`meta` and an empty change is returned.
Han-Wen Nienhuys63b81f22021-02-17 10:31:01 +0100692
Edwin Kempin8e492202013-02-21 15:38:25 +0100693[[get-change-detail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800694=== Get Change Detail
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800695--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100696'GET /changes/link:#change-id[\{change-id\}]/detail'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800697--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100698
Edwin Kempin8e492202013-02-21 15:38:25 +0100699Retrieves a change with link:#labels[labels], link:#detailed-labels[
Viktar Donich316bf7a2016-07-06 11:29:01 -0700700detailed labels], link:#detailed-accounts[detailed accounts],
701link:#reviewer-updates[reviewer updates], and link:#messages[messages].
Edwin Kempin8e492202013-02-21 15:38:25 +0100702
Shawn Pearce7f3dccf2013-07-06 19:24:29 -0700703Additional fields can be obtained by adding `o` parameters, each
704option requires more database lookups and slows down the query
705response time to the client so they are generally disabled by
706default. Fields are described in link:#list-changes[Query Changes].
707
Edwin Kempin8e492202013-02-21 15:38:25 +0100708.Request
709----
710 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0
711----
712
713As response a link:#change-info[ChangeInfo] entity is returned that
Khai Doad632012014-06-22 08:29:57 -0700714describes the change. This response will contain all votes for each
715label and include one combined vote. The combined label vote is
716calculated in the following order (from highest to lowest):
717REJECTED > APPROVED > DISLIKED > RECOMMENDED.
Edwin Kempin8e492202013-02-21 15:38:25 +0100718
719.Response
720----
721 HTTP/1.1 200 OK
722 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900723 Content-Type: application/json; charset=UTF-8
Edwin Kempin8e492202013-02-21 15:38:25 +0100724
725 )]}'
726 {
Edwin Kempin8e492202013-02-21 15:38:25 +0100727 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
728 "project": "myProject",
729 "branch": "master",
Edwin Kempin065e5a22022-12-19 13:34:10 +0100730 "attention_set": {
731 "1000096": {
Gal Paikinc326de42020-06-16 18:49:00 +0300732 "account": {
733 "_account_id": 1000096,
734 "name": "John Doe",
735 "email": "john.doe@example.com",
736 "username": "jdoe"
737 },
Edwin Kempin065e5a22022-12-19 13:34:10 +0100738 "last_update": "2013-02-21 11:16:36.775000000",
739 "reason": "reviewer or cc replied"
Gal Paikinc326de42020-06-16 18:49:00 +0300740 }
Edwin Kempin065e5a22022-12-19 13:34:10 +0100741 },
Edwin Kempin8e492202013-02-21 15:38:25 +0100742 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
743 "subject": "Implementing Feature X",
744 "status": "NEW",
745 "created": "2013-02-01 09:59:32.126000000",
746 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempin8e492202013-02-21 15:38:25 +0100747 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100748 "insertions": 126,
749 "deletions": 11,
Edwin Kempin8e492202013-02-21 15:38:25 +0100750 "_number": 3965,
751 "owner": {
752 "_account_id": 1000096,
753 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200754 "email": "john.doe@example.com",
755 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100756 },
757 "labels": {
758 "Verified": {
759 "all": [
760 {
761 "value": 0,
762 "_account_id": 1000096,
763 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200764 "email": "john.doe@example.com",
765 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100766 },
767 {
768 "value": 0,
769 "_account_id": 1000097,
770 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200771 "email": "jane.roe@example.com",
772 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100773 }
774 ],
775 "values": {
776 "-1": "Fails",
777 " 0": "No score",
778 "+1": "Verified"
779 }
780 },
781 "Code-Review": {
Edwin Kempin8e492202013-02-21 15:38:25 +0100782 "disliked": {
783 "_account_id": 1000096,
784 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200785 "email": "john.doe@example.com",
786 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100787 },
788 "all": [
789 {
790 "value": -1,
791 "_account_id": 1000096,
792 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200793 "email": "john.doe@example.com",
794 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100795 },
796 {
797 "value": 1,
798 "_account_id": 1000097,
799 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200800 "email": "jane.roe@example.com",
801 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100802 }
803 ]
804 "values": {
Oswald Buddenhagenf8877702022-02-15 14:01:34 +0100805 "-2": "This shall not be submitted",
806 "-1": "I would prefer this is not submitted as is",
Edwin Kempin8e492202013-02-21 15:38:25 +0100807 " 0": "No score",
808 "+1": "Looks good to me, but someone else must approve",
809 "+2": "Looks good to me, approved"
810 }
811 }
812 },
813 "permitted_labels": {
814 "Verified": [
815 "-1",
816 " 0",
817 "+1"
818 ],
819 "Code-Review": [
820 "-2",
821 "-1",
822 " 0",
823 "+1",
824 "+2"
825 ]
826 },
Nitzan Gur-Furmand1223572023-01-16 12:07:46 +0000827 "removable_labels": {
828 "Code-Review": {
829 "-1": [
830 {
831 "_account_id": 1000096,
832 "name": "John Doe",
833 "email": "john.doe@example.com",
834 "username": "jdoe"
835 }
836 ],
837 "+1": [
838 {
839 "_account_id": 1000097,
840 "name": "Jane Roe",
841 "email": "jane.roe@example.com",
842 "username": "jroe"
843 }
844 ]
845 }
846 },
Edwin Kempin8e492202013-02-21 15:38:25 +0100847 "removable_reviewers": [
848 {
849 "_account_id": 1000096,
850 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200851 "email": "john.doe@example.com",
852 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100853 },
854 {
855 "_account_id": 1000097,
856 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200857 "email": "jane.roe@example.com",
858 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100859 }
John Spurlock74a70cc2013-03-23 16:41:50 -0400860 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -0800861 "reviewers": {
862 "REVIEWER": [
863 {
864 "_account_id": 1000096,
865 "name": "John Doe",
866 "email": "john.doe@example.com",
867 "username": "jdoe"
868 },
869 {
870 "_account_id": 1000097,
871 "name": "Jane Roe",
872 "email": "jane.roe@example.com",
873 "username": "jroe"
874 }
875 ]
876 },
Viktar Donich316bf7a2016-07-06 11:29:01 -0700877 "reviewer_updates": [
878 {
879 "state": "REVIEWER",
880 "reviewer": {
881 "_account_id": 1000096,
882 "name": "John Doe",
883 "email": "john.doe@example.com",
884 "username": "jdoe"
885 },
886 "updated_by": {
887 "_account_id": 1000096,
888 "name": "John Doe",
889 "email": "john.doe@example.com",
890 "username": "jdoe"
891 },
892 "updated": "2016-07-21 20:12:39.000000000"
893 },
894 {
895 "state": "REMOVED",
896 "reviewer": {
897 "_account_id": 1000096,
898 "name": "John Doe",
899 "email": "john.doe@example.com",
900 "username": "jdoe"
901 },
902 "updated_by": {
903 "_account_id": 1000096,
904 "name": "John Doe",
905 "email": "john.doe@example.com",
906 "username": "jdoe"
907 },
908 "updated": "2016-07-21 20:12:33.000000000"
909 },
910 {
911 "state": "CC",
912 "reviewer": {
913 "_account_id": 1000096,
914 "name": "John Doe",
915 "email": "john.doe@example.com",
916 "username": "jdoe"
917 },
918 "updated_by": {
919 "_account_id": 1000096,
920 "name": "John Doe",
921 "email": "john.doe@example.com",
922 "username": "jdoe"
923 },
924 "updated": "2016-03-23 21:34:02.419000000",
925 },
926 ],
John Spurlock74a70cc2013-03-23 16:41:50 -0400927 "messages": [
928 {
929 "id": "YH-egE",
930 "author": {
931 "_account_id": 1000096,
932 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200933 "email": "john.doe@example.com",
934 "username": "jdoe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400935 },
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100936 "date": "2013-03-23 21:34:02.419000000",
John Spurlock74a70cc2013-03-23 16:41:50 -0400937 "message": "Patch Set 1:\n\nThis is the first message.",
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100938 "_revision_number": 1
John Spurlock74a70cc2013-03-23 16:41:50 -0400939 },
940 {
941 "id": "WEEdhU",
942 "author": {
943 "_account_id": 1000097,
944 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200945 "email": "jane.roe@example.com",
946 "username": "jroe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400947 },
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100948 "date": "2013-03-23 21:36:52.332000000",
John Spurlock74a70cc2013-03-23 16:41:50 -0400949 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
Gustaf Lundh3c4f3f02017-11-06 13:52:28 +0100950 "_revision_number": 1
John Spurlock74a70cc2013-03-23 16:41:50 -0400951 }
Edwin Kempin8e492202013-02-21 15:38:25 +0100952 ]
953 }
954----
955
Aaron Gable9b413072017-08-24 13:15:21 -0700956[[create-merge-patch-set-for-change]]
957=== Create Merge Patch Set For Change
958--
959'POST /changes/link:#change-id[\{change-id\}]/merge'
960--
961
962Update an existing change by using a
963link:#merge-patch-set-input[MergePatchSetInput] entity.
964
965Gerrit will create a merge commit based on the information of
966MergePatchSetInput and add a new patch set to the change corresponding
967to the new merge commit.
968
969.Request
970----
971 POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0
972 Content-Type: application/json; charset=UTF-8
973
974 {
975 "subject": "Merge dev_branch into master",
976 "merge": {
David Pursehousef4fb1042018-03-18 23:03:46 +0900977 "source": "refs/changes/34/1234/1"
Aaron Gable9b413072017-08-24 13:15:21 -0700978 }
979 }
980----
981
982As response a link:#change-info[ChangeInfo] entity with current revision is
983returned that describes the resulting change.
984
985.Response
986----
987 HTTP/1.1 200 OK
988 Content-Disposition: attachment
989 Content-Type: application/json; charset=UTF-8
990
991 )]}'
992 {
993 "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc",
994 "project": "test",
995 "branch": "master",
996 "hashtags": [],
997 "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc",
998 "subject": "Merge dev_branch into master",
999 "status": "NEW",
1000 "created": "2016-09-23 18:08:53.238000000",
1001 "updated": "2016-09-23 18:09:25.934000000",
1002 "submit_type": "MERGE_IF_NECESSARY",
1003 "mergeable": true,
1004 "insertions": 5,
1005 "deletions": 0,
1006 "_number": 72,
1007 "owner": {
1008 "_account_id": 1000000
1009 },
1010 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822"
1011 }
1012----
1013
1014[[set-message]]
1015=== Set Commit Message
1016--
1017'PUT /changes/link:#change-id[\{change-id\}]/message'
1018--
1019
1020Creates a new patch set with a new commit message.
1021
1022The new commit message must be provided in the request body inside a
Han-Wen Nienhuys098580a2019-07-24 20:17:41 +02001023link:#commit-message-input[CommitMessageInput] entity. If a Change-Id
1024footer is specified, it must match the current Change-Id footer. If
1025the Change-Id footer is absent, the current Change-Id is added to the
1026message.
Aaron Gable9b413072017-08-24 13:15:21 -07001027
1028.Request
1029----
1030 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/message HTTP/1.0
1031 Content-Type: application/json; charset=UTF-8
1032
1033 {
1034 "message": "New Commit message \n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444\n"
1035 }
1036----
1037
1038.Notifications
1039
1040An email will be sent using the "newpatchset" template.
1041
1042[options="header",cols="1,1"]
1043|=============================
1044|WIP State |Default
1045|Ready for review|owner, reviewers, CCs, stars, NEW_PATCHSETS watchers
1046|Work in progress|owner
1047|=============================
1048
Edwin Kempin64006bb2013-02-22 08:17:04 +01001049[[get-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001050=== Get Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001051--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001052'GET /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001053--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001054
Edwin Kempin64006bb2013-02-22 08:17:04 +01001055Retrieves the topic of a change.
1056
1057.Request
1058----
1059 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
1060----
1061
1062.Response
1063----
1064 HTTP/1.1 200 OK
1065 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001066 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +01001067
1068 )]}'
1069 "Documentation"
1070----
1071
1072If the change does not have a topic an empty string is returned.
1073
1074[[set-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001075=== Set Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001076--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001077'PUT /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001078--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001079
Edwin Kempin64006bb2013-02-22 08:17:04 +01001080Sets the topic of a change.
1081
1082The new topic must be provided in the request body inside a
Patrick Hiesel4aa14562018-06-19 15:07:50 +02001083link:#topic-input[TopicInput] entity. Any leading or trailing whitespace
1084in the topic name will be removed.
Edwin Kempin64006bb2013-02-22 08:17:04 +01001085
1086.Request
1087----
1088 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001089 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +01001090
1091 {
1092 "topic": "Documentation"
1093 }
1094----
1095
1096As response the new topic is returned.
1097
1098.Response
1099----
1100 HTTP/1.1 200 OK
1101 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001102 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +01001103
1104 )]}'
1105 "Documentation"
1106----
1107
1108If the topic was deleted the response is "`204 No Content`".
1109
1110[[delete-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001111=== Delete Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001112--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001113'DELETE /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001114--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001115
Edwin Kempin64006bb2013-02-22 08:17:04 +01001116Deletes the topic of a change.
1117
Edwin Kempin64006bb2013-02-22 08:17:04 +01001118.Request
1119----
1120 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
1121----
1122
1123.Response
1124----
1125 HTTP/1.1 204 No Content
1126----
1127
Patrick Hieselbb84fd72017-08-23 11:11:22 +02001128[[get-pure-revert]]
1129=== Get Pure Revert
1130--
1131'GET /changes/link:#change-id[\{change-id\}]/pure_revert'
1132--
1133
1134Check if the given change is a pure revert of the change it references in `revertOf`.
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02001135Optionally, the query parameter `o` can be passed in to specify a commit (SHA-1 in
Patrick Hieselbb84fd72017-08-23 11:11:22 +0200113640 digit hex representation) to check against. It takes precedence over `revertOf`.
1137If the change has no reference in `revertOf`, the parameter is mandatory.
1138
1139As response a link:#pure-revert-info[PureRevertInfo] entity is returned.
1140
1141.Request
1142----
1143 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/pure_revert?o=247bccf56ae47634650bcc08b8aa784c3580ccas HTTP/1.0
1144----
1145
1146.Response
1147----
1148 HTTP/1.1 200 OK
1149 Content-Disposition: attachment
1150 Content-Type: application/json; charset=UTF-8
1151
1152 )]}'
1153 {
1154 "is_pure_revert" : false
1155 }
1156----
1157
Edwin Kempined5364b2013-02-22 10:39:33 +01001158[[abandon-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001159=== Abandon Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001160--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001161'POST /changes/link:#change-id[\{change-id\}]/abandon'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001162--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001163
Edwin Kempined5364b2013-02-22 10:39:33 +01001164Abandons a change.
1165
1166The request body does not need to include a link:#abandon-input[
1167AbandonInput] entity if no review comment is added.
1168
Gal Paikinc326de42020-06-16 18:49:00 +03001169Abandoning a change also removes all users from the link:#attention-set[attention set].
1170
Edwin Kempined5364b2013-02-22 10:39:33 +01001171.Request
1172----
1173 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0
1174----
1175
1176As response a link:#change-info[ChangeInfo] entity is returned that
1177describes the abandoned change.
1178
1179.Response
1180----
1181 HTTP/1.1 200 OK
1182 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001183 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001184
1185 )]}'
1186 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001187 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1188 "project": "myProject",
1189 "branch": "master",
1190 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1191 "subject": "Implementing Feature X",
1192 "status": "ABANDONED",
1193 "created": "2013-02-01 09:59:32.126000000",
1194 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001195 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001196 "insertions": 3,
1197 "deletions": 310,
Edwin Kempined5364b2013-02-22 10:39:33 +01001198 "_number": 3965,
1199 "owner": {
1200 "name": "John Doe"
1201 }
1202 }
1203----
1204
1205If the change cannot be abandoned because the change state doesn't
1206allow abandoning of the change, the response is "`409 Conflict`" and
1207the error message is contained in the response body.
1208
1209.Response
1210----
1211 HTTP/1.1 409 Conflict
1212 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001213 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001214
1215 change is merged
1216----
1217
Logan Hankse43b68e2017-05-23 13:16:22 -07001218.Notifications
1219
1220An email will be sent using the "abandon" template. The notify handling is ALL.
1221Notifications are suppressed on WIP changes that have never started review.
1222
Logan Hanks87607412017-05-30 13:49:04 -07001223[options="header",cols="1,2"]
Logan Hankse43b68e2017-05-23 13:16:22 -07001224|=============================
Logan Hanks87607412017-05-30 13:49:04 -07001225|WIP State |notify=ALL
Logan Hankse43b68e2017-05-23 13:16:22 -07001226|Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1227|Work in progress|not sent
1228|Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1229|=============================
1230
Edwin Kempined5364b2013-02-22 10:39:33 +01001231[[restore-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001232=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001233--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001234'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001235--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001236
Edwin Kempined5364b2013-02-22 10:39:33 +01001237Restores a change.
1238
1239The request body does not need to include a link:#restore-input[
1240RestoreInput] entity if no review comment is added.
1241
1242.Request
1243----
1244 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
1245----
1246
1247As response a link:#change-info[ChangeInfo] entity is returned that
1248describes the restored change.
1249
1250.Response
1251----
1252 HTTP/1.1 200 OK
1253 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001254 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001255
1256 )]}'
1257 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001258 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1259 "project": "myProject",
1260 "branch": "master",
1261 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1262 "subject": "Implementing Feature X",
1263 "status": "NEW",
1264 "created": "2013-02-01 09:59:32.126000000",
1265 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001266 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001267 "insertions": 2,
1268 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +01001269 "_number": 3965,
1270 "owner": {
1271 "name": "John Doe"
1272 }
1273 }
1274----
1275
1276If the change cannot be restored because the change state doesn't
1277allow restoring the change, the response is "`409 Conflict`" and
1278the error message is contained in the response body.
1279
1280.Response
1281----
1282 HTTP/1.1 409 Conflict
1283 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001284 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001285
1286 change is new
1287----
1288
Edwin Kempincdae63b2013-03-15 15:06:59 +01001289[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001290=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001291--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001292'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001293--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001294
1295Rebases a change.
1296
Zalan Blenessy874aed72015-01-12 13:26:18 +01001297Optionally, the parent revision can be changed to another patch set through the
1298link:#rebase-input[RebaseInput] entity.
1299
Edwin Kempincdae63b2013-03-15 15:06:59 +01001300.Request
1301----
1302 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01001303 Content-Type: application/json;charset=UTF-8
1304
1305 {
1306 "base" : "1234",
1307 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01001308----
1309
1310As response a link:#change-info[ChangeInfo] entity is returned that
1311describes the rebased change. Information about the current patch set
1312is included.
1313
1314.Response
1315----
1316 HTTP/1.1 200 OK
1317 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001318 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001319
1320 )]}'
1321 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01001322 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1323 "project": "myProject",
1324 "branch": "master",
1325 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1326 "subject": "Implement Feature X",
1327 "status": "NEW",
1328 "created": "2013-02-01 09:59:32.126000000",
1329 "updated": "2013-02-21 11:16:36.775000000",
1330 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001331 "insertions": 33,
1332 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +01001333 "_number": 4799,
1334 "owner": {
1335 "name": "John Doe"
1336 },
1337 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
1338 "revisions": {
1339 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09001340 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001341 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01001342 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001343 "fetch": {
1344 "http": {
1345 "url": "http://gerrit:8080/myProject",
1346 "ref": "refs/changes/99/4799/2"
1347 }
1348 },
1349 "commit": {
1350 "parents": [
1351 {
1352 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
1353 "subject": "Implement Feature A"
1354 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00001355 ],
1356 "author": {
1357 "name": "John Doe",
1358 "email": "john.doe@example.com",
1359 "date": "2013-05-07 15:21:27.000000000",
1360 "tz": 120
1361 },
1362 "committer": {
1363 "name": "Gerrit Code Review",
1364 "email": "gerrit-server@example.com",
1365 "date": "2013-05-07 15:35:43.000000000",
1366 "tz": 120
1367 },
1368 "subject": "Implement Feature X",
1369 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01001370 }
1371 }
1372 }
1373----
1374
1375If the change cannot be rebased, e.g. due to conflicts, the response is
1376"`409 Conflict`" and the error message is contained in the response
1377body.
1378
1379.Response
1380----
1381 HTTP/1.1 409 Conflict
1382 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001383 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001384
1385 The change could not be rebased due to a path conflict during merge.
1386----
1387
Nitzan Gur-Furman4655d8b2022-12-16 08:46:18 +01001388[[rebase-chain]]
1389=== Rebase Chain
1390--
1391'POST /changes/link:#change-id[\{change-id\}]/rebase:chain'
1392--
1393
1394Rebases an ancestry chain of changes.
1395
1396The operated change is treated as the chain tip. All unsubmitted ancestors are rebased.
1397
1398Requires a linear ancestry relation (single parenting throughout the chain).
1399
1400Optionally, the parent revision (of the oldest ancestor to be rebased) can be changed to another
1401change, revision or branch through the link:#rebase-input[RebaseInput] entity.
1402
1403If the chain is outdated, i.e., there's a change that depends on an old revision of its parent, the
1404result is the same as individually rebasing all outdated changes on top of their parent's latest
1405revision before running the rebase chain action.
1406
1407.Request
1408----
1409 POST /changes/myProject~master~I08a021fb07b83fe845140a2c11508b3bdd93b48f/rebase:chain HTTP/1.0
1410 Content-Type: application/json;charset=UTF-8
1411
1412 {
1413 "base" : "1234",
1414 }
1415----
1416
1417As response a link:#rebase-chain-info[RebaseChainInfo] entity is returned that
1418describes the rebased changes. Information about the current patch sets
1419are included.
1420
1421.Response
1422----
1423 HTTP/1.1 200 OK
1424 Content-Disposition: attachment
1425 Content-Type: application/json; charset=UTF-8
1426
1427 )]}'
1428 {
1429 "rebased_changes": [
1430 {
1431 "id": "myProject~master~I0e534de9d7f0d6f35b71f7d726acf835b2110c66",
1432 "project": "myProject",
1433 "branch": "master",
1434 "hashtags": [
1435
1436 ],
1437 "change_id": "I0e534de9d7f0d6f35b71f7d726acf835b2110c66",
1438 "subject": "456",
1439 "status": "NEW",
1440 "created": "2022-11-21 20: 51: 31.000000000",
1441 "updated": "2022-11-21 20: 56: 49.000000000",
1442 "submit_type": "MERGE_IF_NECESSARY",
1443 "insertions": 0,
1444 "deletions": 0,
1445 "total_comment_count": 0,
1446 "unresolved_comment_count": 0,
1447 "has_review_started": true,
1448 "meta_rev_id": "a2a6692213f546e1045ecf4647439fac8d6d8faa",
1449 "_number": 21,
1450 "owner": {
1451 "_account_id": 1000000
1452 },
1453 "current_revision": "c3b2ba222d42a56e05c90f88d4509a124620517d",
1454 "revisions": {
1455 "c3b2ba222d42a56e05c90f88d4509a124620517d": {
1456 "kind": "NO_CHANGE",
1457 "_number": 2,
1458 "created": "2022-11-21 20: 56: 49.000000000",
1459 "uploader": {
1460 "_account_id": 1000000
1461 },
1462 "ref": "refs/changes/21/21/2",
1463 "fetch": {
1464
1465 },
1466 "commit": {
1467 "parents": [
1468 {
1469 "commit": "7803f427dd7c4a2441466e4d740a1850dcee1af4",
1470 "subject": "123"
1471 }
1472 ],
1473 "author": {
1474 "name": "Nitzan Gur-Furman",
1475 "email": "nitzan@google.com",
1476 "date": "2022-11-21 20: 49: 39.000000000",
1477 "tz": 60
1478 },
1479 "committer": {
1480 "name": "Administrator",
1481 "email": "admin@example.com",
1482 "date": "2022-11-21 20: 56: 49.000000000",
1483 "tz": 60
1484 },
1485 "subject": "456",
1486 "message": "456\n"
1487 },
1488 "description": "Rebase"
1489 }
1490 },
1491 "requirements": [
1492
1493 ],
1494 "submit_records": [
1495 {
1496 "rule_name": "gerrit~DefaultSubmitRule",
1497 "status": "NOT_READY",
1498 "labels": [
1499 {
1500 "label": "Code-Review",
1501 "status": "NEED"
1502 }
1503 ]
1504 }
1505 ]
1506 },
1507 {
1508 "id": "myProject~master~I08a021fb07b83fe845140a2c11508b3bdd93b48f",
1509 "project": "myProject",
1510 "branch": "master",
1511 "hashtags": [
1512
1513 ],
1514 "change_id": "I08a021fb07b83fe845140a2c11508b3bdd93b48f",
1515 "subject": "789",
1516 "status": "NEW",
1517 "created": "2022-11-21 20: 51: 31.000000000",
1518 "updated": "2022-11-21 20: 56: 49.000000000",
1519 "submit_type": "MERGE_IF_NECESSARY",
1520 "insertions": 0,
1521 "deletions": 0,
1522 "total_comment_count": 0,
1523 "unresolved_comment_count": 0,
1524 "has_review_started": true,
1525 "meta_rev_id": "3bfb843fea471f96e16b9199c3a30fff0285bc45",
1526 "_number": 22,
1527 "owner": {
1528 "_account_id": 1000000
1529 },
1530 "current_revision": "77eb17a9501a5c21963bc6af56085e60f281acbb",
1531 "revisions": {
1532 "77eb17a9501a5c21963bc6af56085e60f281acbb": {
1533 "kind": "NO_CHANGE",
1534 "_number": 2,
1535 "created": "2022-11-21 20: 56: 49.000000000",
1536 "uploader": {
1537 "_account_id": 1000000
1538 },
1539 "ref": "refs/changes/22/22/2",
1540 "fetch": {
1541
1542 },
1543 "commit": {
1544 "parents": [
1545 {
1546 "commit": "c3b2ba222d42a56e05c90f88d4509a124620517d",
1547 "subject": "456"
1548 }
1549 ],
1550 "author": {
1551 "name": "Nitzan Gur-Furman",
1552 "email": "nitzan@google.com",
1553 "date": "2022-11-21 20: 51: 07.000000000",
1554 "tz": 60
1555 },
1556 "committer": {
1557 "name": "Administrator",
1558 "email": "admin@example.com",
1559 "date": "2022-11-21 20: 56: 49.000000000",
1560 "tz": 60
1561 },
1562 "subject": "789",
1563 "message": "789\n"
1564 },
1565 "description": "Rebase"
1566 }
1567 },
1568 "requirements": [
1569
1570 ],
1571 "submit_records": [
1572 {
1573 "rule_name": "gerrit~DefaultSubmitRule",
1574 "status": "NOT_READY",
1575 "labels": [
1576 {
1577 "label": "Code-Review",
1578 "status": "NEED"
1579 }
1580 ]
1581 }
1582 ]
1583 }
1584 ],
1585 }
1586----
1587
1588If the change cannot be rebased, e.g. due to conflicts, the response is
1589"`409 Conflict`" and the error message is contained in the response
1590body.
1591
1592.Response
1593----
1594 HTTP/1.1 409 Conflict
1595 Content-Disposition: attachment
1596 Content-Type: text/plain; charset=UTF-8
1597
1598 Change I0e534de9d7f0d6f35b71f7d726acf835b2110c66 could not be rebased due to a conflict during
1599 merge.
1600
1601 merge conflict(s):
1602 a.txt
1603----
1604
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301605[[move-change]]
1606=== Move Change
1607--
1608'POST /changes/link:#change-id[\{change-id\}]/move'
1609--
1610
1611Move a change.
1612
1613The destination branch must be provided in the request body inside a
1614link:#move-input[MoveInput] entity.
Marija Savtchoukcee6a8f2020-12-03 12:58:04 +00001615Only veto votes that are blocking the change from submission are moved to
1616the destination branch by default.
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301617
1618.Request
1619----
1620 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0
1621 Content-Type: application/json; charset=UTF-8
1622
1623 {
1624 "destination_branch" : "release-branch"
1625 }
1626
1627----
1628
1629As response a link:#change-info[ChangeInfo] entity is returned that
1630describes the moved change.
1631
1632.Response
1633----
1634 HTTP/1.1 200 OK
1635 Content-Disposition: attachment
1636 Content-Type: application/json; charset=UTF-8
1637
1638 )]}'
1639 {
1640 "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940",
1641 "project": "myProject",
1642 "branch": "release-branch",
1643 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1644 "subject": "Implementing Feature X",
1645 "status": "NEW",
1646 "created": "2013-02-01 09:59:32.126000000",
1647 "updated": "2013-02-21 11:16:36.775000000",
1648 "mergeable": true,
1649 "insertions": 2,
1650 "deletions": 13,
1651 "_number": 3965,
1652 "owner": {
1653 "name": "John Doe"
1654 }
1655 }
1656----
1657
Changcheng Xiao6dc90422017-08-09 10:21:58 +02001658Note that this endpoint will not update the change's parents, which is
1659different from the link:#cherry-pick[cherry-pick] endpoint.
1660
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301661If the change cannot be moved because the change state doesn't
1662allow moving the change, the response is "`409 Conflict`" and
1663the error message is contained in the response body.
1664
1665.Response
1666----
1667 HTTP/1.1 409 Conflict
1668 Content-Disposition: attachment
1669 Content-Type: text/plain; charset=UTF-8
1670
1671 change is merged
1672----
1673
1674If the change cannot be moved because the user doesn't have
1675abandon permission on the change or upload permission on the destination,
1676the response is "`409 Conflict`" and the error message is contained in the
1677response body.
1678
1679.Response
1680----
1681 HTTP/1.1 409 Conflict
1682 Content-Disposition: attachment
1683 Content-Type: text/plain; charset=UTF-8
1684
1685 move not permitted
1686----
1687
Edwin Kempind2ec4152013-02-22 12:17:19 +01001688[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001689=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001690--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001691'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001692--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001693
Edwin Kempind2ec4152013-02-22 12:17:19 +01001694Reverts a change.
1695
Gal Paikin006d52b2019-12-19 11:22:09 +01001696The subject of the newly created change will be
1697'Revert "<subject-of-reverted-change>"'. If the subject of the change reverted is
1698above 63 characters, it will be cut down to 59 characters with "..." in the end.
1699
Edwin Kempind2ec4152013-02-22 12:17:19 +01001700The request body does not need to include a link:#revert-input[
1701RevertInput] entity if no review comment is added.
1702
1703.Request
1704----
Michael Zhou10270492016-03-24 22:35:40 -04001705 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0
Edwin Kempind2ec4152013-02-22 12:17:19 +01001706----
1707
1708As response a link:#change-info[ChangeInfo] entity is returned that
1709describes the reverting change.
1710
1711.Response
1712----
1713 HTTP/1.1 200 OK
1714 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001715 Content-Type: application/json; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001716
1717 )]}'
1718 {
Edwin Kempind2ec4152013-02-22 12:17:19 +01001719 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1720 "project": "myProject",
1721 "branch": "master",
1722 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1723 "subject": "Revert \"Implementing Feature X\"",
1724 "status": "NEW",
1725 "created": "2013-02-01 09:59:32.126000000",
1726 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempind2ec4152013-02-22 12:17:19 +01001727 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001728 "insertions": 6,
1729 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +01001730 "_number": 3965,
1731 "owner": {
1732 "name": "John Doe"
1733 }
1734 }
1735----
1736
Gal Paikin6c9ed952020-01-22 10:36:35 +01001737If the user doesn't have revert permission on the change or upload permission on
1738the destination branch, the response is "`403 Forbidden`", and the error message is
1739contained in the response body.
1740
Edwin Kempind2ec4152013-02-22 12:17:19 +01001741If the change cannot be reverted because the change state doesn't
Gal Paikin6c9ed952020-01-22 10:36:35 +01001742allow reverting the change the response is "`409 Conflict`", and the error
1743message is contained in the response body.
Edwin Kempind2ec4152013-02-22 12:17:19 +01001744
1745.Response
1746----
1747 HTTP/1.1 409 Conflict
1748 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001749 Content-Type: text/plain; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001750
1751 change is new
1752----
1753
Gal Paikinb81f56c2019-10-16 14:39:24 +02001754[[revert-submission]]
1755=== Revert Submission
1756--
1757'POST /changes/link:#change-id[\{change-id\}]/revert_submission'
1758--
1759
1760Creates open revert changes for all of the changes of a certain submission.
1761
Gal Paikin006d52b2019-12-19 11:22:09 +01001762The subject of each revert change will be 'Revert "<subject-of-reverted-change"'.
Gal Paikin100bf602019-12-23 14:50:41 +01001763If the subject is above 60 characters, the subject will be cut to 56 characters
1764with "..." in the end. However, whenever reverting the submission of a revert
1765submission, the subject will be shortened from
1766'Revert "Revert "<subject-of-reverted-change""' to
1767'Revert^2 "<subject-of-reverted-change"'. Also, for every future revert submission,
1768the only difference in the subject will be the number of the revert (instead of
1769Revert^2 the subject will change to Revert^3 and so on).
1770There are no guarantees about the subjects if the users change the default subjects.
Gal Paikinaffd0242019-12-18 18:10:08 +01001771
Gal Paikinb81f56c2019-10-16 14:39:24 +02001772Details for the revert can be specified in the request body inside a link:#revert-input[
1773RevertInput] The topic of all created revert changes will be
1774`revert-{submission_id}-{random_string_of_size_10}`.
1775
1776The changes will not be rebased on onto the destination branch so the users may still
1777have to manually rebase them to resolve conflicts and make them submittable.
1778
Gal Paikin653a8522019-11-25 11:40:10 +01001779However, the changes that have the same project and branch will be rebased on top
1780of each other. E.g, the first revert change will have the original change as a
1781parent, and the second revert change will have the first revert change as a
1782parent.
1783
1784There is one special case that involves merge commits; if a user has multiple
1785changes in the same project and branch, but not in the same change series, those
1786changes can still get submitted together if they have the same topic and
1787link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`] in
1788gerrit.config is set to true. In the case, Gerrit may create merge commits on
1789submit (depending on the link:config-project-config.html#submit-type[submit types]
1790of the project).
1791The first parent for the reverts will be the most recent merge commit that was
1792created by Gerrit to merge the different change series into the target branch.
1793
Gal Paikinb81f56c2019-10-16 14:39:24 +02001794.Request
1795----
1796 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert_submission HTTP/1.0
1797----
1798
1799As response link:#revert-submission-info[RevertSubmissionInfo] entity
1800is returned. That entity describes the revert changes.
1801
1802.Response
1803----
1804 HTTP/1.1 200 OK
1805 Content-Disposition: attachment
1806 Content-Type: application/json; charset=UTF-8
1807
1808 )]}'
1809 "revert_changes":
1810 [
1811 {
1812 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1813 "project": "myProject",
1814 "branch": "master",
1815 "topic": "revert--1571043962462-3640749-ABCEEZGHIJ",
1816 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1817 "subject": "Revert \"Implementing Feature X\"",
1818 "status": "NEW",
1819 "created": "2013-02-01 09:59:32.126000000",
1820 "updated": "2013-02-21 11:16:36.775000000",
1821 "mergeable": true,
1822 "insertions": 6,
1823 "deletions": 4,
1824 "_number": 3965,
1825 "owner": {
1826 "name": "John Doe"
1827 }
1828 },
1829 {
1830 "id": "anyProject~master~1eee2c9d8f352483781e772f35dc586a69ff5646",
1831 "project": "anyProject",
1832 "branch": "master",
1833 "topic": "revert--1571043962462-3640749-ABCEEZGHIJ",
1834 "change_id": "I1eee2c9d8f352483781e772f35dc586a69ff5646",
1835 "subject": "Revert \"Implementing Feature Y\"",
1836 "status": "NEW",
1837 "created": "2013-02-04 09:59:33.126000000",
1838 "updated": "2013-02-21 11:16:37.775000000",
1839 "mergeable": true,
1840 "insertions": 62,
1841 "deletions": 11,
1842 "_number": 3966,
1843 "owner": {
1844 "name": "Jane Doe"
1845 }
1846 }
1847 ]
1848----
1849
Gal Paikin6c9ed952020-01-22 10:36:35 +01001850If the user doesn't have revert permission on the change or upload permission on
1851the destination, the response is "`403 Forbidden`", and the error message is
1852contained in the response body.
1853
1854If the change cannot be reverted because the change state doesn't
1855allow reverting the change the response is "`409 Conflict`", and the error
1856message is contained in the response body.
Gal Paikinb81f56c2019-10-16 14:39:24 +02001857
1858.Response
1859----
1860 HTTP/1.1 409 Conflict
1861 Content-Disposition: attachment
1862 Content-Type: text/plain; charset=UTF-8
1863
1864 change is new
1865----
1866
Edwin Kempin0eddba02013-02-22 15:30:12 +01001867[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001868=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001869--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001870'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001871--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001872
Edwin Kempin0eddba02013-02-22 15:30:12 +01001873Submits a change.
1874
1875The request body only needs to include a link:#submit-input[
David Pursehousea8f48f82016-03-10 15:27:47 +09001876SubmitInput] entity if submitting on behalf of another user.
Edwin Kempin0eddba02013-02-22 15:30:12 +01001877
Gal Paikinc326de42020-06-16 18:49:00 +03001878Submitting a change also removes all users from the link:#attention-set[attention set].
1879
Edwin Kempin0eddba02013-02-22 15:30:12 +01001880.Request
1881----
1882 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001883 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001884
1885 {
David Pursehousea8f48f82016-03-10 15:27:47 +09001886 "on_behalf_of": 1001439
Edwin Kempin0eddba02013-02-22 15:30:12 +01001887 }
1888----
1889
1890As response a link:#change-info[ChangeInfo] entity is returned that
1891describes the submitted/merged change.
1892
Gal Paikine2849a82021-04-19 13:41:10 +02001893Submission may submit multiple changes, but we still only return one ChangeInfo
1894object. To query for all submitted changes, please use the submission_id that is
1895part of the response.
1896
1897Changes that will also be submitted:
18981. All changes of the same topic if
1899link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1900configuration is set to true.
19012. All dependent changes.
19023. The closure of the above (e.g if a dependent change has a topic, all changes
1903of *that* topic will also be submitted).
1904
Edwin Kempin0eddba02013-02-22 15:30:12 +01001905.Response
1906----
1907 HTTP/1.1 200 OK
1908 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001909 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001910
1911 )]}'
1912 {
Edwin Kempin0eddba02013-02-22 15:30:12 +01001913 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1914 "project": "myProject",
1915 "branch": "master",
1916 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1917 "subject": "Implementing Feature X",
1918 "status": "MERGED",
1919 "created": "2013-02-01 09:59:32.126000000",
1920 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001921 "submitted": "2013-02-21 11:16:36.615000000",
Edwin Kempin0eddba02013-02-22 15:30:12 +01001922 "_number": 3965,
1923 "owner": {
1924 "name": "John Doe"
1925 }
1926 }
1927----
1928
1929If the change cannot be submitted because the submit rule doesn't allow
1930submitting the change, the response is "`409 Conflict`" and the error
1931message is contained in the response body.
1932
1933.Response
1934----
1935 HTTP/1.1 409 Conflict
1936 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001937 Content-Type: text/plain; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001938
1939 blocked by Verified
1940----
1941
David Pursehouse025c1af2015-11-20 17:02:50 +09001942[[submitted-together]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001943=== Changes Submitted Together
Stefan Bellera7ad6612015-06-26 10:05:43 -07001944--
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001945'GET /changes/link:#change-id[\{change-id\}]/submitted_together?o=NON_VISIBLE_CHANGES'
Stefan Bellera7ad6612015-06-26 10:05:43 -07001946--
1947
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001948Computes list of all changes which are submitted when
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001949link:#submit-change[Submit] is called for this change,
Stefan Beller460f3542015-07-20 14:10:41 -07001950including the current change itself.
1951
Stefan Bellera7ad6612015-06-26 10:05:43 -07001952The list consists of:
1953
1954* The given change.
1955* If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
Gal Paikine7a208d2021-11-30 12:08:27 +01001956 is enabled OR if the `o=TOPIC_CLOSURE` query parameter is passed, include all
1957 open changes with the same topic.
Stefan Bellera7ad6612015-06-26 10:05:43 -07001958* For each change whose submit type is not CHERRY_PICK, include unmerged
1959 ancestors targeting the same branch.
1960
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001961As a special case, the list is empty if this change would be
1962submitted by itself (without other changes).
1963
1964.Request
1965----
1966 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0
1967 Content-Type: application/json; charset=UTF-8
1968----
1969
1970As a response a link:#submitted-together-info[SubmittedTogetherInfo]
1971entity is returned that describes what would happen if the change were
1972submitted. This response contains a list of changes and a count of
1973changes that are not visible to the caller that are part of the set of
1974changes to be merged.
1975
1976The listed changes use the same format as in
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001977link:#list-changes[Query Changes] with the
1978link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`],
Patrick Hiesel6fbbdaa2018-04-05 15:10:13 +02001979link:#current-revision[`CURRENT_REVISION`],and
Jonathan Niedercb51d742016-09-23 11:37:57 -07001980link:#submittable[`SUBMITTABLE`] options set.
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001981
Shawn Pearce8080c3d2016-09-19 19:15:04 -07001982Standard link:#query-options[formatting options] can be specified
1983with the `o` parameter, as well as the `submitted_together` specific
Gal Paikine7a208d2021-11-30 12:08:27 +01001984options `NON_VISIBLE_CHANGES` and `TOPIC_CLOSURE`.
Shawn Pearce8080c3d2016-09-19 19:15:04 -07001985
Stefan Bellera7ad6612015-06-26 10:05:43 -07001986.Response
1987----
1988 HTTP/1.1 200 OK
1989 Content-Disposition: attachment
1990 Content-Type: application/json; charset=UTF-8
1991
1992)]}'
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001993{
1994 "changes": [
1995 {
1996 "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1997 "project": "gerrit",
1998 "branch": "master",
1999 "hashtags": [],
2000 "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
2001 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
2002 "status": "NEW",
2003 "created": "2015-05-01 15:39:57.979000000",
2004 "updated": "2015-05-20 19:25:21.592000000",
2005 "mergeable": true,
2006 "insertions": 303,
2007 "deletions": 210,
2008 "_number": 1779,
2009 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07002010 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002011 },
2012 "labels": {
2013 "Code-Review": {
2014 "approved": {
2015 "_account_id": 1000000
2016 },
2017 "all": [
2018 {
2019 "value": 2,
2020 "date": "2015-05-20 19:25:21.592000000",
2021 "_account_id": 1000000
2022 }
2023 ],
2024 "values": {
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01002025 "-2": "This shall not be submitted",
2026 "-1": "I would prefer this is not submitted as is",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002027 " 0": "No score",
2028 "+1": "Looks good to me, but someone else must approve",
2029 "+2": "Looks good to me, approved"
2030 },
2031 "default_value": 0
2032 },
2033 "Verified": {
2034 "approved": {
2035 "_account_id": 1000000
2036 },
2037 "all": [
2038 {
2039 "value": 1,
2040 "date": "2015-05-20 19:25:21.592000000",
2041 "_account_id": 1000000
2042 }
2043 ],
2044 "values": {
2045 "-1": "Fails",
2046 " 0": "No score",
2047 "+1": "Verified"
2048 },
2049 "default_value": 0
2050 }
2051 },
2052 "permitted_labels": {
2053 "Code-Review": [
2054 "-2",
2055 "-1",
2056 " 0",
2057 "+1",
2058 "+2"
2059 ],
2060 "Verified": [
2061 "-1",
2062 " 0",
2063 "+1"
2064 ]
2065 },
2066 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08002067 {
2068 "_account_id": 1000000
2069 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002070 ],
2071 "reviewers": {
2072 "REVIEWER": [
2073 {
2074 "_account_id": 1000000
2075 }
2076 ]
2077 },
2078 "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379",
2079 "revisions": {
2080 "9adb9f4c7b40eeee0646e235de818d09164d7379": {
David Pursehouse4de41112016-06-28 09:24:08 +09002081 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002082 "_number": 1,
2083 "created": "2015-05-01 15:39:57.979000000",
2084 "uploader": {
2085 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07002086 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002087 "ref": "refs/changes/79/1779/1",
2088 "fetch": {},
Stefan Bellera7ad6612015-06-26 10:05:43 -07002089 }
2090 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07002091 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002092 {
2093 "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22",
2094 "project": "gerrit",
2095 "branch": "master",
2096 "hashtags": [],
2097 "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22",
2098 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
2099 "status": "NEW",
2100 "created": "2015-05-01 15:39:57.979000000",
2101 "updated": "2015-05-20 19:25:21.546000000",
2102 "mergeable": true,
2103 "insertions": 15,
2104 "deletions": 6,
2105 "_number": 1780,
2106 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07002107 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002108 },
2109 "labels": {
2110 "Code-Review": {
2111 "approved": {
2112 "_account_id": 1000000
2113 },
2114 "all": [
2115 {
2116 "value": 2,
2117 "date": "2015-05-20 19:25:21.546000000",
2118 "_account_id": 1000000
2119 }
2120 ],
2121 "values": {
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01002122 "-2": "This shall not be submitted",
2123 "-1": "I would prefer this is not submitted as is",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002124 " 0": "No score",
2125 "+1": "Looks good to me, but someone else must approve",
2126 "+2": "Looks good to me, approved"
2127 },
2128 "default_value": 0
2129 },
2130 "Verified": {
2131 "approved": {
2132 "_account_id": 1000000
2133 },
2134 "all": [
2135 {
2136 "value": 1,
2137 "date": "2015-05-20 19:25:21.546000000",
2138 "_account_id": 1000000
2139 }
2140 ],
2141 "values": {
2142 "-1": "Fails",
2143 " 0": "No score",
2144 "+1": "Verified"
2145 },
2146 "default_value": 0
2147 }
2148 },
2149 "permitted_labels": {
2150 "Code-Review": [
2151 "-2",
2152 "-1",
2153 " 0",
2154 "+1",
2155 "+2"
2156 ],
2157 "Verified": [
2158 "-1",
2159 " 0",
2160 "+1"
2161 ]
2162 },
2163 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08002164 {
2165 "_account_id": 1000000
2166 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002167 ],
2168 "reviewers": {
2169 "REVIEWER": [
2170 {
2171 "_account_id": 1000000
2172 }
2173 ]
2174 },
2175 "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4",
2176 "revisions": {
2177 "1bd7c12a38854a2c6de426feec28800623f492c4": {
David Pursehouse4de41112016-06-28 09:24:08 +09002178 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002179 "_number": 1,
2180 "created": "2015-05-01 15:39:57.979000000",
2181 "uploader": {
2182 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07002183 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002184 "ref": "refs/changes/80/1780/1",
2185 "fetch": {},
Stefan Bellera7ad6612015-06-26 10:05:43 -07002186 }
2187 }
2188 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002189 ],
2190 "non_visible_changes": 0
2191}
Stefan Bellera7ad6612015-06-26 10:05:43 -07002192----
2193
Jonathan Nieder2a629b02016-06-16 15:15:25 -07002194If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then
2195instead of a link:#submitted-together-info[SubmittedTogetherInfo]
2196entity, the response is a list of changes, or a 403 response with a
2197message if the set of changes to be submitted with this change
2198includes changes the caller cannot read.
2199
Stefan Bellera7ad6612015-06-26 10:05:43 -07002200
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02002201[[delete-change]]
2202=== Delete Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002203--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002204'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002205--
David Ostrovsky0d69c232013-09-10 23:10:23 +02002206
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02002207Deletes a change.
2208
Paladox none580ae0e2017-02-12 18:15:48 +00002209New or abandoned changes can be deleted by their owner if the user is granted
2210the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission,
2211otherwise only by administrators.
2212
David Ostrovsky0d69c232013-09-10 23:10:23 +02002213.Request
2214----
2215 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002216 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02002217----
2218
2219.Response
2220----
2221 HTTP/1.1 204 No Content
2222----
2223
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03002224[[apply-patch]]
2225=== Create patch-set from patch
2226--
2227'POST /changes/link:#change-id[\{change-id\}]/patch:apply'
2228--
2229
2230Creates a new patch set on a destination change from the provided patch.
2231
2232The patch must be provided in the request body, inside a
2233link:#applypatchpatchset-input[ApplyPatchPatchSetInput] entity.
2234
2235If a base commit is given, the patch is applied on top of it. Otherwise, the
2236patch is applied on top of the target change's branch tip.
2237
2238Applying the patch will fail if the destination change is closed, or in case of any conflicts.
2239
2240.Request
2241----
2242 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/patch:apply HTTP/1.0
2243 Content-Type: application/json; charset=UTF-8
2244
2245 {
2246 "patch": {
2247 "patch": "new file mode 100644\n--- /dev/null\n+++ b/a_new_file.txt\n@@ -0,0 +1,2 @@ \
2248+Patch compatible `git diff` output \
2249+For example: `link:#get-patch[<gerrit patch>] | base64 -d | sed -z 's/\n/\\n/g'`"
2250 }
2251 }
2252----
2253
2254As response a link:#change-info[ChangeInfo] entity is returned that
2255describes the destination change after applying the patch.
2256
2257.Response
2258----
2259 HTTP/1.1 200 OK
2260 Content-Disposition: attachment
2261 Content-Type: application/json; charset=UTF-8
2262
2263 )]}'
2264 {
2265 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
2266 "project": "myProject",
2267 "branch": "release-branch",
2268 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
2269 "subject": "Original change subject",
2270 "status": "NEW",
2271 "created": "2013-02-01 09:59:32.126000000",
2272 "updated": "2013-02-21 11:16:36.775000000",
2273 "mergeable": true,
2274 "insertions": 12,
2275 "deletions": 11,
2276 "_number": 3965,
2277 "owner": {
2278 "name": "John Doe"
2279 },
2280 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c"
2281 }
2282----
2283
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002284[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002285=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002286--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002287'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002288--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002289
2290Retrieves the branches and tags in which a change is included. As result
2291an link:#included-in-info[IncludedInInfo] entity is returned.
2292
2293.Request
2294----
2295 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
2296----
2297
2298.Response
2299----
2300 HTTP/1.1 200 OK
2301 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002302 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002303
2304 )]}'
2305 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02002306 "branches": [
2307 "master"
2308 ],
2309 "tags": []
2310 }
2311----
2312
David Pursehouse4e38b972014-05-30 10:36:40 +09002313[[index-change]]
2314=== Index Change
2315--
2316'POST /changes/link:#change-id[\{change-id\}]/index'
2317--
2318
2319Adds or updates the change in the secondary index.
2320
2321.Request
2322----
2323 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
2324----
2325
2326.Response
2327----
2328 HTTP/1.1 204 No Content
2329----
2330
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002331[[list-change-comments]]
2332=== List Change Comments
2333--
2334'GET /changes/link:#change-id[\{change-id\}]/comments'
2335--
2336
2337Lists the published comments of all revisions of the change.
2338
2339Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2340entries. The entries in the map are sorted by file path, and the
2341comments for each path are sorted by patch set number. Each comment has
2342the `patch_set` and `author` fields set.
2343
Youssef Elghareeb68e87b62021-01-11 13:20:03 +01002344If the `enable-context` request parameter is set to true, the comment entries
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02002345will contain a list of link:#context-line[ContextLine] containing the lines of
2346the source file where the comment was written.
2347
Youssef Elghareeb87b74502021-02-05 18:53:05 +01002348The `context-padding` request parameter can be used to specify an extra number
2349of context lines to be added before and after the comment range. This parameter
2350only works if `enable-context` is set to true.
2351
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002352.Request
2353----
2354 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
2355----
2356
2357.Response
2358----
2359 HTTP/1.1 200 OK
2360 Content-Disposition: attachment
2361 Content-Type: application/json; charset=UTF-8
2362
2363 )]}'
2364 {
2365 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2366 {
2367 "patch_set": 1,
2368 "id": "TvcXrmjM",
2369 "line": 23,
2370 "message": "[nit] trailing whitespace",
2371 "updated": "2013-02-26 15:40:43.986000000"
2372 "author": {
2373 "_account_id": 1000096,
2374 "name": "John Doe",
2375 "email": "john.doe@example.com"
2376 }
2377 },
2378 {
2379 "patch_set": 2,
2380 "id": "TveXwFiA",
2381 "line": 49,
2382 "in_reply_to": "TfYX-Iuo",
2383 "message": "Done",
2384 "updated": "2013-02-26 15:40:45.328000000"
2385 "author": {
2386 "_account_id": 1000097,
2387 "name": "Jane Roe",
2388 "email": "jane.roe@example.com"
2389 }
2390 }
2391 ]
2392 }
2393----
2394
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002395[[list-change-robot-comments]]
2396=== List Change Robot Comments
2397--
2398'GET /changes/link:#change-id[\{change-id\}]/robotcomments'
2399--
2400
2401Lists the robot comments of all revisions of the change.
2402
2403Return a map that maps the file path to a list of
2404link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
2405map are sorted by file path.
2406
2407.Request
2408----
2409 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0
2410----
2411
2412.Response
2413----
2414 HTTP/1.1 200 OK
2415 Content-Disposition: attachment
2416 Content-Type: application/json; charset=UTF-8
2417
2418 )]}'
2419 {
2420 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2421 {
2422 "id": "TvcXrmjM",
2423 "line": 23,
2424 "message": "unused import",
2425 "updated": "2016-02-26 15:40:43.986000000",
2426 "author": {
2427 "_account_id": 1000110,
2428 "name": "Code Analyzer",
2429 "email": "code.analyzer@example.com"
2430 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09002431 "robot_id": "importChecker",
2432 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002433 },
2434 {
2435 "id": "TveXwFiA",
2436 "line": 49,
2437 "message": "wrong indention",
2438 "updated": "2016-02-26 15:40:45.328000000",
2439 "author": {
2440 "_account_id": 1000110,
2441 "name": "Code Analyzer",
2442 "email": "code.analyzer@example.com"
2443 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09002444 "robot_id": "styleChecker",
2445 "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b"
Changcheng Xiao9b04c042016-12-28 12:45:29 +01002446 }
2447 ]
2448 }
2449----
2450
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002451[[list-change-drafts]]
2452=== List Change Drafts
2453--
2454'GET /changes/link:#change-id[\{change-id\}]/drafts'
2455--
2456
2457Lists the draft comments of all revisions of the change that belong to
2458the calling user.
2459
2460Returns a map of file paths to lists of link:#comment-info[CommentInfo]
2461entries. The entries in the map are sorted by file path, and the
2462comments for each path are sorted by patch set number. Each comment has
2463the `patch_set` field set, and no `author`.
2464
Youssef Elghareeb59580cb2021-03-17 15:02:49 +01002465The `enable-context` and `context-padding` request parameters can be used to
2466request comment context. See link:#list-change-comments[List Change Comments]
2467for more details.
2468
Dave Borowitz23fec2b2015-04-28 17:40:07 -07002469.Request
2470----
2471 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0
2472----
2473
2474.Response
2475----
2476 HTTP/1.1 200 OK
2477 Content-Disposition: attachment
2478 Content-Type: application/json; charset=UTF-8
2479
2480 )]}'
2481 {
2482 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2483 {
2484 "patch_set": 1,
2485 "id": "TvcXrmjM",
2486 "line": 23,
2487 "message": "[nit] trailing whitespace",
2488 "updated": "2013-02-26 15:40:43.986000000"
2489 },
2490 {
2491 "patch_set": 2,
2492 "id": "TveXwFiA",
2493 "line": 49,
2494 "in_reply_to": "TfYX-Iuo",
2495 "message": "Done",
2496 "updated": "2013-02-26 15:40:45.328000000"
2497 }
2498 ]
2499 }
2500----
2501
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002502[[check-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002503=== Check Change
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002504--
2505'GET /changes/link:#change-id[\{change-id\}]/check'
2506--
2507
2508Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05002509link:#change-info[ChangeInfo] entity with the `problems` field set to a
2510list of link:#problem-info[ProblemInfo] entities.
2511
2512Depending on the type of problem, some fields not marked optional may be
2513missing from the result. At least `id`, `project`, `branch`, and
2514`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002515
2516.Request
2517----
2518 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2519----
2520
2521.Response
2522----
2523 HTTP/1.1 200 OK
2524 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002525 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002526
2527 )]}'
2528 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05002529 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2530 "project": "myProject",
2531 "branch": "master",
2532 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2533 "subject": "Implementing Feature X",
2534 "status": "NEW",
2535 "created": "2013-02-01 09:59:32.126000000",
2536 "updated": "2013-02-21 11:16:36.775000000",
2537 "mergeable": true,
2538 "insertions": 34,
2539 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05002540 "_number": 3965,
2541 "owner": {
2542 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002543 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05002544 "problems": [
2545 {
2546 "message": "Current patch set 1 not found"
2547 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002548 ]
2549 }
2550----
2551
Dave Borowitz3be39d02014-12-03 17:57:38 -08002552[[fix-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002553=== Fix Change
Dave Borowitz3be39d02014-12-03 17:57:38 -08002554--
2555'POST /changes/link:#change-id[\{change-id\}]/check'
2556--
2557
2558Performs consistency checks on the change as with link:#check-change[GET
2559/check], and additionally fixes any problems that can be fixed
2560automatically. The returned field values reflect any fixes.
2561
Dave Borowitzbad53ee2015-06-11 10:10:18 -04002562Some fixes have options controlling their behavior, which can be set in the
2563link:#fix-input[FixInput] entity body.
2564
Dave Borowitz3be39d02014-12-03 17:57:38 -08002565Only the change owner, a project owner, or an administrator may fix changes.
2566
2567.Request
2568----
2569 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2570----
2571
2572.Response
2573----
2574 HTTP/1.1 200 OK
2575 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002576 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08002577
2578 )]}'
2579 {
2580 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2581 "project": "myProject",
2582 "branch": "master",
2583 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2584 "subject": "Implementing Feature X",
2585 "status": "MERGED",
2586 "created": "2013-02-01 09:59:32.126000000",
2587 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08002588 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08002589 "mergeable": true,
2590 "insertions": 34,
2591 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08002592 "_number": 3965,
2593 "owner": {
2594 "name": "John Doe"
2595 },
2596 "problems": [
2597 {
2598 "message": "Current patch set 2 not found"
2599 },
2600 {
2601 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
2602 "status": FIXED,
2603 "outcome": "Marked change as merged"
2604 }
2605 ]
2606 }
2607----
2608
Alan Tokaev392cfca2017-04-28 11:11:31 +02002609[[set-work-in-pogress]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002610=== Set Work-In-Progress
Alan Tokaev392cfca2017-04-28 11:11:31 +02002611--
2612'POST /changes/link:#change-id[\{change-id\}]/wip'
2613--
2614
David Ostrovsky44242452018-06-09 20:25:13 +02002615Marks the change as not ready for review yet. Changes may only be marked not
2616ready by the owner, project owners or site administrators.
Alan Tokaev392cfca2017-04-28 11:11:31 +02002617
2618The request body does not need to include a
2619link:#work-in-progress-input[WorkInProgressInput] entity if no review comment
2620is added. Actions that create a new patch set in a WIP change default to
2621notifying *OWNER* instead of *ALL*.
2622
Gal Paikinc326de42020-06-16 18:49:00 +03002623Marking a change work in progress also removes all users from the
2624link:#attention-set[attention set].
2625
Alan Tokaev392cfca2017-04-28 11:11:31 +02002626.Request
2627----
2628 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0
2629 Content-Type: application/json; charset=UTF-8
2630
2631 {
2632 "message": "Refactoring needs to be done before we can proceed here."
2633 }
2634----
2635
2636.Response
2637----
2638 HTTP/1.1 200 OK
2639----
2640
2641[[set-ready-for-review]]
Aaron Gablece92bdd2017-06-28 15:36:32 -07002642=== Set Ready-For-Review
Alan Tokaev392cfca2017-04-28 11:11:31 +02002643--
2644'POST /changes/link:#change-id[\{change-id\}]/ready'
2645--
2646
David Ostrovsky44242452018-06-09 20:25:13 +02002647Marks the change as ready for review (set WIP property to false). Changes may
2648only be marked ready by the owner, project owners or site administrators.
Alan Tokaev392cfca2017-04-28 11:11:31 +02002649
2650Activates notifications of reviewer. The request body does not need
2651to include a link:#work-in-progress-input[WorkInProgressInput] entity
2652if no review comment is added.
2653
Gal Paikinc326de42020-06-16 18:49:00 +03002654Marking a change ready for review also adds all of the reviewers of the change
2655to the link:#attention-set[attention set].
2656
Alan Tokaev392cfca2017-04-28 11:11:31 +02002657.Request
2658----
2659 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0
2660 Content-Type: application/json;charset=UTF-8
2661
2662 {
2663 "message": "Refactoring is done."
2664 }
2665
2666----
2667
2668.Response
2669----
2670 HTTP/1.1 200 OK
2671----
2672
David Pursehouse7c5c3a52017-04-10 11:37:23 +09002673[[mark-private]]
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002674=== Mark Private
2675--
Edwin Kempin364a86b2017-04-27 12:34:00 +02002676'POST /changes/link:#change-id[\{change-id\}]/private'
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002677--
2678
Patrick Hiesel707e61a2019-02-13 18:28:48 +01002679Marks the change to be private. Only open changes can be marked private.
2680Changes may only be marked private by the owner or site administrators.
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002681
Edwin Kempin364a86b2017-04-27 12:34:00 +02002682A message can be specified in the request body inside a
2683link:#private-input[PrivateInput] entity.
2684
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002685.Request
2686----
Edwin Kempin364a86b2017-04-27 12:34:00 +02002687 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2688 Content-Type: application/json; charset=UTF-8
2689
2690 {
2691 "message": "After this security fix has been released we can make it public now."
2692 }
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002693----
2694
2695.Response
2696----
2697 HTTP/1.1 201 Created
2698----
2699
2700If the change was already private the response is "`200 OK`".
2701
2702[[unmark-private]]
2703=== Unmark Private
2704--
2705'DELETE /changes/link:#change-id[\{change-id\}]/private'
2706--
2707
2708Marks the change to be non-private. Note users can only unmark own private
2709changes.
2710
2711.Request
2712----
2713 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2714----
2715
2716.Response
2717----
2718 HTTP/1.1 204 No Content
2719----
2720
2721If the change was already not private, the response is "`409 Conflict`".
2722
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02002723A message can be specified in the request body inside a
2724link:#private-input[PrivateInput] entity. Historically, this method allowed
2725a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01002726link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02002727In this case, use a POST request instead:
Edwin Kempin364a86b2017-04-27 12:34:00 +02002728
2729.Request
2730----
2731 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0
2732 Content-Type: application/json; charset=UTF-8
2733
2734 {
2735 "message": "This is a security fix that must not be public."
2736 }
2737----
2738
David Pursehouse7c79b682017-08-25 13:18:32 +09002739[[get-hashtags]]
2740=== Get Hashtags
2741--
2742'GET /changes/link:#change-id[\{change-id\}]/hashtags'
2743--
2744
2745Gets the hashtags associated with a change.
2746
David Pursehouse7c79b682017-08-25 13:18:32 +09002747.Request
2748----
2749 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2750----
2751
2752As response the change's hashtags are returned as a list of strings.
2753
2754.Response
2755----
2756 HTTP/1.1 200 OK
2757 Content-Disposition: attachment
2758 Content-Type: application/json; charset=UTF-8
2759
2760 )]}'
2761 [
2762 "hashtag1",
2763 "hashtag2"
2764 ]
2765----
2766
2767[[set-hashtags]]
2768=== Set Hashtags
2769--
2770'POST /changes/link:#change-id[\{change-id\}]/hashtags'
2771--
2772
2773Adds and/or removes hashtags from a change.
2774
David Pursehouse7c79b682017-08-25 13:18:32 +09002775The hashtags to add or remove must be provided in the request body inside a
2776link:#hashtags-input[HashtagsInput] entity.
2777
2778.Request
2779----
2780 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2781 Content-Type: application/json; charset=UTF-8
2782
2783 {
2784 "add" : [
2785 "hashtag3"
2786 ],
2787 "remove" : [
2788 "hashtag2"
2789 ]
2790 }
2791----
2792
2793As response the change's hashtags are returned as a list of strings.
2794
2795.Response
2796----
2797 HTTP/1.1 200 OK
2798 Content-Disposition: attachment
2799 Content-Type: application/json; charset=UTF-8
2800
2801 )]}'
2802 [
2803 "hashtag1",
2804 "hashtag3"
2805 ]
2806----
2807
Changcheng Xiao7fb73292018-04-25 11:43:19 +02002808[[list-change-messages]]
2809=== List Change Messages
2810--
2811'GET /changes/link:#change-id[\{change-id\}]/messages'
2812--
2813
2814Lists all the messages of a change including link:#detailed-accounts[detailed account information].
2815
2816.Request
2817----
2818 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages
2819----
2820
2821As response a list of link:#change-message-info[ChangeMessageInfo] entities is returned.
2822
2823.Response
2824----
2825 HTTP/1.1 200 OK
2826 Content-Disposition: attachment
2827 Content-Type: application/json; charset=UTF-8
2828
2829 )]}'
2830 [
2831 {
2832 "id": "YH-egE",
2833 "author": {
2834 "_account_id": 1000096,
2835 "name": "John Doe",
2836 "email": "john.doe@example.com",
2837 "username": "jdoe"
2838 },
2839 "date": "2013-03-23 21:34:02.419000000",
2840 "message": "Patch Set 1:\n\nThis is the first message.",
2841 "_revision_number": 1
2842 },
2843 {
2844 "id": "WEEdhU",
2845 "author": {
2846 "_account_id": 1000097,
2847 "name": "Jane Roe",
2848 "email": "jane.roe@example.com",
2849 "username": "jroe"
2850 },
2851 "date": "2013-03-23 21:36:52.332000000",
2852 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
2853 "_revision_number": 1
2854 }
2855 ]
2856----
David Pursehousec32050d2017-08-25 16:27:47 +09002857
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002858[[get-change-message]]
2859=== Get Change Message
2860
2861Retrieves a change message including link:#detailed-accounts[detailed account information].
2862
2863--
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002864'GET /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]'
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002865--
2866
2867As response a link:#change-message-info[ChangeMessageInfo] entity is returned.
2868
2869.Response
2870----
2871 HTTP/1.1 200 OK
2872 Content-Disposition: attachment
2873 Content-Type: application/json; charset=UTF-8
2874
2875 )]}'
2876 {
2877 "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780",
2878 "author": {
2879 "_account_id": 1000096,
2880 "name": "John Doe",
2881 "email": "john.doe@example.com",
2882 "username": "jdoe"
2883 },
2884 "date": "2013-03-23 21:34:02.419000000",
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002885 "message": "a change message",
2886 "_revision_number": 1
2887 }
2888----
2889
2890[[delete-change-message]]
2891=== Delete Change Message
2892--
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002893'DELETE /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]' +
2894'POST /changes/link:#change-id[\{change-id\}]/messages/link:#change-message-id[\{change-message-id\}]/delete'
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002895--
2896
2897Deletes a change message by replacing the change message with a new message,
2898which contains the name of the user who deleted the change message and the
2899reason why it was deleted. The reason can be provided in the request body as a
2900link:#delete-change-message-input[DeleteChangeMessageInput] entity.
2901
2902Note that only users with the
2903link:access-control.html#capability_administrateServer[Administrate Server]
2904global capability are permitted to delete a change message.
2905
2906To delete a change message, send a DELETE request:
2907
2908.Request
2909----
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002910 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780 HTTP/1.0
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002911----
2912
2913To provide a reason for the deletion, use a POST request:
2914
2915.Request
2916----
Jonathan Nieder58c07cf2019-03-26 18:52:22 -07002917 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/messages/aaee04dcb46bafc8be24d8aa70b3b1beb7df5780/delete HTTP/1.0
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02002918 Content-Type: application/json; charset=UTF-8
2919
2920 {
2921 "reason": "spam"
2922 }
2923----
2924
2925As response a link:#change-message-info[ChangeMessageInfo] entity is returned that
2926describes the updated change message.
2927
2928.Response
2929----
2930 HTTP/1.1 200 OK
2931 Content-Disposition: attachment
2932 Content-Type: application/json; charset=UTF-8
2933
2934 )]}'
2935 {
2936 "id": "aaee04dcb46bafc8be24d8aa70b3b1beb7df5780",
2937 "author": {
2938 "_account_id": 1000096,
2939 "name": "John Doe",
2940 "email": "john.doe@example.com",
2941 "username": "jdoe"
2942 },
2943 "date": "2013-03-23 21:34:02.419000000",
2944 "message": "Change message removed by: Administrator\nReason: spam",
Changcheng Xiaod61590f2018-04-30 10:59:14 +02002945 "_revision_number": 1
2946 }
2947----
Gustaf Lundhe8647c62017-04-28 06:51:26 +02002948
Youssef Elghareebd5986932021-10-15 11:45:23 +02002949[[check-submit-requirement]]
2950=== Check Submit Requirement
2951--
2952'POST /changes/link:#change-id[\{change-id\}]/check.submit_requirement'
2953--
2954
2955Tests a submit requirement and returns the result as a
Youssef Elghareeb1a24df62022-06-24 17:52:28 +02002956link:#submit-requirement-result-info[SubmitRequirementResultInfo].
2957
2958The submit requirement can be specified in one of the following ways:
2959
2960 * In the request body as a link:#submit-requirement-input[SubmitRequirementInput].
2961 * By passing the two request parameters `sr-name` and
2962 `refs-config-change-id`. The submit requirement will then be loaded from
2963 the project config pointed to by the latest patchset of this change ID.
2964 The `sr-name` should point to an existing submit-requirement and the
2965 `refs-config-change-id` must be a valid change identifier for a change in the
2966 refs/meta/config branch, otherwise the request would fail with
2967 `400 Bad Request`.
Youssef Elghareebd5986932021-10-15 11:45:23 +02002968
2969Note that this endpoint does not modify the change resource.
2970
2971.Request
2972----
2973 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check.submit_requirement HTTP/1.0
2974 Content-Type: application/json; charset=UTF-8
2975
2976 {
2977 "name": "Code-Review",
2978 "submittability_expression": "label:Code-Review=+2"
2979 }
2980----
2981
2982As response a link:#submit-requirement-result-info[SubmitRequirementResultInfo]
2983entity is returned that describes the submit requirement result.
2984
2985.Response
2986----
2987 HTTP/1.1 200 OK
2988 Content-Disposition: attachment
2989 Content-Type: application/json; charset=UTF-8
2990
2991 )]}'
2992 {
2993 "name": "Code-Review",
2994 "status": "SATISFIED",
2995 "submittability_expression_result": {
2996 "expression": "label:Code-Review=+2",
2997 "fulfilled": true,
2998 "passingAtoms": [
2999 "label:Code-Review=+2"
3000 ]
3001 },
3002 "is_legacy": false
3003 }
3004----
3005
David Ostrovsky1a49f622014-07-29 00:40:02 +02003006[[edit-endpoints]]
3007== Change Edit Endpoints
3008
David Ostrovsky1a49f622014-07-29 00:40:02 +02003009[[get-edit-detail]]
3010=== Get Change Edit Details
3011--
3012'GET /changes/link:#change-id[\{change-id\}]/edit
3013--
3014
3015Retrieves a change edit details.
3016
3017.Request
3018----
3019 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
3020----
3021
3022As response an link:#edit-info[EditInfo] entity is returned that
3023describes the change edit, or "`204 No Content`" when change edit doesn't
3024exist for this change. Change edits are stored on special branches and there
3025can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02003026When request parameter `list` is provided the response also includes the file
3027list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02003028against this base revision. When request parameter `download-commands` is
3029provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02003030
3031.Response
3032----
3033 HTTP/1.1 200 OK
3034 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003035 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02003036
3037 )]}'
3038 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01003039 "commit": {
3040 "parents": [
David Ostrovsky1a49f622014-07-29 00:40:02 +02003041 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01003042 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
David Ostrovsky1a49f622014-07-29 00:40:02 +02003043 }
3044 ],
Edwin Kempine813c5a2019-03-13 09:51:12 +01003045 "author": {
3046 "name": "Shawn O. Pearce",
3047 "email": "sop@google.com",
3048 "date": "2012-04-24 18:08:08.000000000",
3049 "tz": -420
David Ostrovsky1a49f622014-07-29 00:40:02 +02003050 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01003051 "committer": {
3052 "name": "Shawn O. Pearce",
3053 "email": "sop@google.com",
3054 "date": "2012-04-24 18:08:08.000000000",
3055 "tz": -420
David Ostrovsky1a49f622014-07-29 00:40:02 +02003056 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01003057 "subject": "Use an EventBus to manage star icons",
3058 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
David Ostrovsky1a49f622014-07-29 00:40:02 +02003059 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01003060 "base_patch_set_number": 1,
3061 "base_revision": "c35558e0925e6985c91f3a16921537d5e572b7a3",
3062 "ref": "refs/users/01/1000001/edit-76482/1"
David Ostrovsky1a49f622014-07-29 00:40:02 +02003063 }
3064----
David Pursehouse4e38b972014-05-30 10:36:40 +09003065
David Ostrovskya5ab8292014-08-01 02:11:39 +02003066[[put-edit-file]]
3067=== Change file content in Change Edit
3068--
3069'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
3070--
3071
3072Put content of a file to a change edit.
3073
3074.Request
3075----
3076 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3077----
3078
Paladox none28920b42020-02-22 19:28:21 +00003079To upload a file as binary data in the request body:
3080
3081.Request
3082----
3083 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3084 Content-Type: application/json; charset=UTF-8
3085
3086 {
jtrinh4ca10412022-10-04 10:05:34 -07003087 "binary_content": "data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==",
3088 "file_mode": 100755
Paladox none28920b42020-02-22 19:28:21 +00003089 }
3090----
3091
3092Note that it must be base-64 encoded data uri.
3093
jtrinh4ca10412022-10-04 10:05:34 -07003094The "file_mode" field is optional, and if provided must be in octal format. The field
3095indicates whether the file is executable or not and has a value of either 100755
3096(executable) or 100644 (not executable). If it's unset, this indicates no change
3097has been made. New files default to not being executable if this parameter is not
3098provided
3099
David Ostrovskya5ab8292014-08-01 02:11:39 +02003100When change edit doesn't exist for this change yet it is created. When file
3101content isn't provided, it is wiped out for that file. As response
3102"`204 No Content`" is returned.
3103
3104.Response
3105----
3106 HTTP/1.1 204 No Content
3107----
3108
Gal Paikin68d217b2019-10-07 21:01:22 +02003109When the change edit is a no-op, for example when providing the same file
3110content that the file already has, '409 no changes were made' is returned.
3111
3112.Response
3113----
3114 HTTP/1.1 409 no changes were made
3115----
3116
David Ostrovsky138edb42014-08-15 21:31:43 +02003117[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01003118=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02003119--
3120'POST /changes/link:#change-id[\{change-id\}]/edit
3121--
3122
David Ostrovskya00c9532015-01-21 00:17:49 +01003123Creates empty change edit, restores file content or renames files in change
3124edit. The request body needs to include a
3125link:#change-edit-input[ChangeEditInput] entity when a file within change
3126edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02003127
3128.Request
3129----
3130 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003131 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02003132
3133 {
David Ostrovskybd12e172014-08-21 23:08:15 +02003134 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02003135 }
3136----
3137
David Ostrovskya00c9532015-01-21 00:17:49 +01003138or for rename:
3139
3140.Request
3141----
3142 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
3143 Content-Type: application/json; charset=UTF-8
3144
3145 {
3146 "old_path": "foo",
3147 "new_path": "bar"
3148 }
3149----
3150
David Ostrovsky138edb42014-08-15 21:31:43 +02003151When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01003152and restore flag are provided in request body, this file is restored. When
3153old and new file names are provided, the file is renamed. As response
3154"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02003155
3156.Response
3157----
3158 HTTP/1.1 204 No Content
3159----
3160
David Ostrovskyc967e152014-10-24 17:36:16 +02003161[[put-change-edit-message]]
3162=== Change commit message in Change Edit
3163--
3164'PUT /changes/link:#change-id[\{change-id\}]/edit:message
3165--
3166
3167Modify commit message. The request body needs to include a
3168link:#change-edit-message-input[ChangeEditMessageInput]
3169entity.
3170
3171.Request
3172----
3173 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003174 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02003175
3176 {
3177 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
3178 }
3179----
3180
3181If a change edit doesn't exist for this change yet, it is created. As
3182response "`204 No Content`" is returned.
3183
3184.Response
3185----
3186 HTTP/1.1 204 No Content
3187----
3188
David Ostrovsky2830c292014-08-01 02:24:31 +02003189[[delete-edit-file]]
3190=== Delete file in Change Edit
3191--
3192'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
3193--
3194
3195Deletes a file from a change edit. This deletes the file from the repository
3196completely. This is not the same as reverting or restoring a file to its
3197previous contents.
3198
3199.Request
3200----
3201 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3202----
3203
3204When change edit doesn't exist for this change yet it is created.
3205
3206.Response
3207----
3208 HTTP/1.1 204 No Content
3209----
3210
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003211[[get-edit-file]]
3212=== Retrieve file content from Change Edit
3213--
3214'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
3215--
3216
3217Retrieves content of a file from a change edit.
3218
3219.Request
3220----
3221 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
3222----
3223
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05003224The content of the file is returned as text encoded inside base64.
3225The Content-Type header will always be `text/plain` reflecting the
3226outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
3227can be examined to find the server detected content type of the file.
3228
3229When the specified file was deleted in the change edit
3230"`204 No Content`" is returned.
3231
3232If only the content type is required, callers should use HEAD to
3233avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003234
Michael Zhou551ad0c2016-04-26 01:21:42 -04003235If the `base` parameter is set to true, the returned content is from the
3236revision that the edit is based on.
3237
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003238.Response
3239----
3240 HTTP/1.1 200 OK
3241 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003242 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003243 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05003244 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02003245
3246 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
3247----
3248
David Ostrovskyd0078672015-02-06 21:51:04 +01003249Alternatively, if the only value of the Accept request header is
3250`application/json` the content is returned as JSON string and
3251`X-FYI-Content-Encoding` is set to `json`.
3252
David Ostrovsky9ea9c112015-01-25 00:12:38 +01003253[[get-edit-meta-data]]
3254=== Retrieve meta data of a file from Change Edit
3255--
3256'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
3257--
3258
3259Retrieves meta data of a file from a change edit. Currently only
3260web links are returned.
3261
3262.Request
3263----
3264 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
3265----
3266
3267This REST endpoint retrieves additional information for a file in a
3268change edit. As result an link:#edit-file-info[EditFileInfo] entity is
3269returned.
3270
3271.Response
3272----
3273 HTTP/1.1 200 OK
3274 Content-Disposition: attachment
3275 Content-Type: application/json; charset=UTF-8
3276
3277 )]}'
3278 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01003279 "web_links": [
David Ostrovsky9ea9c112015-01-25 00:12:38 +01003280 {
3281 "show_on_side_by_side_diff_view": true,
3282 "name": "side-by-side preview diff",
3283 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
3284 "url": "#/x/xdocs/c/42/1..0/README.md",
3285 "target": "_self"
3286 },
3287 {
3288 "show_on_unified_diff_view": true,
3289 "name": "unified preview diff",
3290 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
3291 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
3292 "target": "_self"
3293 }
3294 ]}
3295----
3296
David Ostrovsky3d2c0702014-10-28 23:44:27 +01003297[[get-edit-message]]
3298=== Retrieve commit message from Change Edit or current patch set of the change
3299--
3300'GET /changes/link:#change-id[\{change-id\}]/edit:message
3301--
3302
David Ostrovsky25ad15e2014-12-15 21:18:59 +01003303Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01003304
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02003305If the `base` parameter is set to true, the returned message is from the
3306revision that the edit is based on.
3307
David Ostrovsky3d2c0702014-10-28 23:44:27 +01003308.Request
3309----
3310 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
3311----
3312
3313The commit message is returned as base64 encoded string.
3314
3315.Response
3316----
3317 HTTP/1.1 200 OK
3318
3319 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
3320M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
3321----
3322
David Ostrovskyd0078672015-02-06 21:51:04 +01003323Alternatively, if the only value of the Accept request header is
3324`application/json` the commit message is returned as JSON string:
3325
3326.Response
3327----
3328 HTTP/1.1 200 OK
3329
3330)]}'
3331"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
3332----
3333
3334
David Ostrovskye9988f92014-08-01 09:56:34 +02003335[[publish-edit]]
3336=== Publish Change Edit
3337--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003338'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02003339--
3340
3341Promotes change edit to a regular patch set.
3342
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02003343Options can be provided in the request body as a
3344link:#publish-change-edit-input[PublishChangeEditInput] entity.
3345
David Ostrovskye9988f92014-08-01 09:56:34 +02003346.Request
3347----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003348 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02003349 Content-Type: application/json; charset=UTF-8
3350
3351 {
3352 "notify": "NONE"
3353 }
David Ostrovskye9988f92014-08-01 09:56:34 +02003354----
3355
3356As response "`204 No Content`" is returned.
3357
3358.Response
3359----
3360 HTTP/1.1 204 No Content
3361----
3362
David Ostrovsky46999d22014-08-16 02:19:13 +02003363[[rebase-edit]]
3364=== Rebase Change Edit
3365--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003366'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02003367--
3368
3369Rebases change edit on top of latest patch set.
3370
3371.Request
3372----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01003373 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02003374----
3375
3376When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09003377"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02003378based on top of the latest patch set, the response
3379"`409 Conflict`" is returned.
3380
3381.Response
3382----
3383 HTTP/1.1 204 No Content
3384----
3385
David Ostrovsky8e75f502014-08-10 00:36:31 +02003386[[delete-edit]]
3387=== Delete Change Edit
3388--
3389'DELETE /changes/link:#change-id[\{change-id\}]/edit'
3390--
3391
3392Deletes change edit.
3393
3394.Request
3395----
3396 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
3397----
3398
3399As response "`204 No Content`" is returned.
3400
3401.Response
3402----
3403 HTTP/1.1 204 No Content
3404----
3405
Edwin Kempin9a9f1c02017-01-02 15:10:49 +01003406
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003407[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003408== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003409
3410[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003411=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003412--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003413'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003414--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003415
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003416Lists the reviewers of a change.
3417
3418As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
3419
3420.Request
3421----
3422 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0
3423----
3424
3425.Response
3426----
3427 HTTP/1.1 200 OK
3428 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003429 Content-Type: application/json; charset=UTF-8
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003430
3431 )]}'
3432 [
3433 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003434 "approvals": {
3435 "Verified": "+1",
3436 "Code-Review": "+2"
3437 },
3438 "_account_id": 1000096,
3439 "name": "John Doe",
3440 "email": "john.doe@example.com"
3441 },
3442 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01003443 "approvals": {
3444 "Verified": " 0",
3445 "Code-Review": "-1"
3446 },
3447 "_account_id": 1000097,
3448 "name": "Jane Roe",
3449 "email": "jane.roe@example.com"
3450 }
3451 ]
3452----
3453
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003454[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003455=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003456--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003457'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003458--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003459
3460Suggest the reviewers for a given query `q` and result limit `n`. If result
3461limit is not passed, then the default 10 is used.
3462
Edwin Kempin2639eaa2019-08-27 09:47:27 +02003463This REST endpoint only suggests accounts that
3464
3465* are active
3466* can see the change
3467* are visible to the calling user
3468* are not already reviewer on the change
3469* don't own the change
Edwin Kempinad55dde2021-09-28 11:30:55 +02003470* are not service users (unless
3471 link:config.html#suggest.skipServiceUsers[skipServiceUsers] is set to `false`)
Edwin Kempin2639eaa2019-08-27 09:47:27 +02003472
Edwin Kempinec02a552019-08-27 09:30:15 +02003473Groups can be excluded from the results by specifying the 'exclude-groups'
3474request parameter:
3475
3476--
3477'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5&exclude-groups'
3478--
Patrick Hieselc79ae0e2017-06-28 14:50:53 +02003479
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003480As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
3481
3482.Request
3483----
3484 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0
3485----
3486
3487.Response
3488----
3489 HTTP/1.1 200 OK
3490 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003491 Content-Type: application/json; charset=UTF-8
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003492
3493 )]}'
3494 [
3495 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003496 "account": {
3497 "_account_id": 1000097,
3498 "name": "Jane Roe",
3499 "email": "jane.roe@example.com"
Logan Hanksab3c81e2016-07-20 15:42:52 -07003500 },
3501 "count": 1
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003502 },
3503 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003504 "group": {
3505 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
3506 "name": "Joiner"
Logan Hanksab3c81e2016-07-20 15:42:52 -07003507 },
3508 "count": 5
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02003509 }
3510 ]
3511----
3512
Edwin Kempin0ca3f722019-08-27 09:43:31 +02003513To suggest CCs `reviewer-state=CC` can be specified as additional URL
3514parameter. This includes existing reviewers in the result, but excludes
3515existing CCs.
3516
3517--
3518'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&reviewer-state=CC'
3519--
3520
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003521[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003522=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003523--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003524'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 -08003525--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003526
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003527Retrieves a reviewer of a change.
3528
3529As response a link:#reviewer-info[ReviewerInfo] entity is returned that
3530describes the reviewer.
3531
3532.Request
3533----
3534 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
3535----
3536
3537.Response
3538----
3539 HTTP/1.1 200 OK
3540 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003541 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003542
3543 )]}'
3544 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01003545 "approvals": {
3546 "Verified": "+1",
3547 "Code-Review": "+2"
3548 },
3549 "_account_id": 1000096,
3550 "name": "John Doe",
3551 "email": "john.doe@example.com"
3552 }
3553----
3554
Edwin Kempin392328e2013-02-25 12:50:03 +01003555[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003556=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003557--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003558'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003559--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003560
Edwin Kempin392328e2013-02-25 12:50:03 +01003561Adds one user or all members of one group as reviewer to the change.
3562
3563The reviewer to be added to the change must be provided in the request
3564body as a link:#reviewer-input[ReviewerInput] entity.
3565
Edwin Kempinf9f19412019-08-28 09:28:51 +02003566Users can be moved from reviewer to CC and vice versa. This means if a
3567user is added as CC that is already a reviewer on the change, the
3568reviewer state of that user is updated to CC. If a user that is already
3569a CC on the change is added as reviewer, the reviewer state of that
3570user is updated to reviewer.
3571
Gal Paikinc326de42020-06-16 18:49:00 +03003572Adding a new reviewer also adds that reviewer to the attention set, unless
3573the change is work in progress.
3574Also, moving a reviewer to CC removes that user from the attention set.
3575
Edwin Kempin392328e2013-02-25 12:50:03 +01003576.Request
3577----
3578 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003579 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003580
3581 {
3582 "reviewer": "john.doe@example.com"
3583 }
3584----
3585
Gal Paikin721a40b2021-04-15 09:30:00 +02003586As response an link:#reviewer-result[ReviewerResult] entity is
Edwin Kempin392328e2013-02-25 12:50:03 +01003587returned that describes the newly added reviewers.
3588
3589.Response
3590----
3591 HTTP/1.1 200 OK
3592 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003593 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003594
3595 )]}'
3596 {
Aaron Gable8c650212017-04-25 12:03:37 -07003597 "input": "john.doe@example.com",
Edwin Kempin392328e2013-02-25 12:50:03 +01003598 "reviewers": [
3599 {
Aaron Gable8c650212017-04-25 12:03:37 -07003600 "_account_id": 1000096,
3601 "name": "John Doe",
3602 "email": "john.doe@example.com"
Edwin Kempin392328e2013-02-25 12:50:03 +01003603 "approvals": {
3604 "Verified": " 0",
3605 "Code-Review": " 0"
3606 },
Edwin Kempin392328e2013-02-25 12:50:03 +01003607 }
3608 ]
3609 }
3610----
3611
3612If a group is specified, adding the group members as reviewers is an
3613atomic operation. This means if an error is returned, none of the
3614members are added as reviewer.
3615
3616If a group with many members is added as reviewer a confirmation may be
3617required.
3618
Edwin Kempinf9f19412019-08-28 09:28:51 +02003619If a group is added as CC and members of this group are already
3620reviewers on the change, these members stay reviewers on the change
3621(they are not downgraded to CC). However if a group is added as
3622reviewer, all group members become reviewer of the change, even if they
3623have been added as CC before.
3624
Edwin Kempin392328e2013-02-25 12:50:03 +01003625.Request
3626----
3627 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003628 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003629
3630 {
3631 "reviewer": "MyProjectVerifiers"
3632 }
3633----
3634
3635.Response
3636----
3637 HTTP/1.1 200 OK
3638 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003639 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003640
3641 )]}'
3642 {
Logan Hanks23e70282016-07-06 14:31:56 -07003643 "input": "MyProjectVerifiers",
Edwin Kempin392328e2013-02-25 12:50:03 +01003644 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
3645 "confirm": true
3646 }
3647----
3648
3649To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01003650`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01003651
3652.Request
3653----
3654 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003655 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01003656
3657 {
Logan Hanks23e70282016-07-06 14:31:56 -07003658 "input": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01003659 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01003660 }
3661----
3662
Patrick Hiesel11873ef2017-03-17 17:36:05 +01003663If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set
3664for the project, reviewers and CCs are not required to have a Gerrit account. If you POST
3665an email address of a reviewer or CC then, they will be added to the change even if they
3666don't have a Gerrit account.
3667
3668If this option is disabled, the request would fail with `400 Bad Request` if the email
3669address can't be resolved to an active Gerrit account.
3670
3671Note that the name is optional so both "un.registered@reviewer.com" and
3672"John Doe <un.registered@reviewer.com>" are valid inputs.
3673
3674Reviewers without Gerrit accounts can only be added on changes visible to anonymous users.
3675
3676.Request
3677----
3678 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
3679 Content-Type: application/json; charset=UTF-8
3680
3681 {
3682 "reviewer": "John Doe <un.registered@reviewer.com>"
3683 }
3684----
3685
3686.Response
3687----
3688 HTTP/1.1 200 OK
3689 Content-Disposition: attachment
3690 Content-Type: application/json; charset=UTF-8
3691
3692 )]}'
3693 {
3694 "input": "John Doe <un.registered@reviewer.com>"
3695 }
3696----
3697
Logan Hanksf03040e2017-05-03 09:40:56 -07003698.Notifications
3699
3700An email will be sent using the "newchange" template.
3701
3702[options="header",cols="1,1,1"]
3703|=============================
3704|WIP State |Default|notify=ALL
3705|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
3706|Work in progress|not sent|owner, reviewers, CCs
3707|=============================
3708
Edwin Kempin53301072013-02-25 12:57:07 +01003709[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003710=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003711--
Edwin Kempin407fca32016-08-29 12:01:00 +02003712'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' +
3713'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 -08003714--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003715
Edwin Kempin53301072013-02-25 12:57:07 +01003716Deletes a reviewer from a change.
Gal Paikinc326de42020-06-16 18:49:00 +03003717Deleting a reviewer also removes that user from the attention set.
Edwin Kempin53301072013-02-25 12:57:07 +01003718
3719.Request
3720----
3721 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
Edwin Kempin407fca32016-08-29 12:01:00 +02003722 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3723----
3724
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003725Options can be provided in the request body as a
3726link:#delete-reviewer-input[DeleteReviewerInput] entity.
3727Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01003728link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003729In this case, use a POST request instead:
Edwin Kempin407fca32016-08-29 12:01:00 +02003730
3731.Request
3732----
3733 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3734 Content-Type: application/json; charset=UTF-8
3735
3736 {
3737 "notify": "NONE"
3738 }
Edwin Kempin53301072013-02-25 12:57:07 +01003739----
3740
3741.Response
3742----
3743 HTTP/1.1 204 No Content
3744----
3745
Logan Hanks87607412017-05-30 13:49:04 -07003746.Notifications
3747
3748An email will be sent using the "deleteReviewer" template. If deleting the
3749reviewer resulted in one or more approvals being removed, then the deleted
3750reviewer will also receive a notification (unless notify=NONE).
3751
3752[options="header",cols="1,5"]
3753|=============================
3754|WIP State |Default Recipients
3755|Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers
3756|Work in progress|notify=NONE: deleted reviewer (if voted)
3757|=============================
3758
David Ostrovskybeb0b842014-12-13 00:24:29 +01003759[[list-votes]]
3760=== List Votes
3761--
3762'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
3763--
3764
3765Lists the votes for a specific reviewer of the change.
3766
3767.Request
3768----
Edwin Kempin314f10a2016-07-11 11:39:05 +02003769 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0
David Ostrovskybeb0b842014-12-13 00:24:29 +01003770----
3771
3772As result a map is returned that maps the label name to the label value.
3773The entries in the map are sorted by label name.
3774
3775.Response
3776----
3777 HTTP/1.1 200 OK
3778 Content-Disposition: attachment
3779 Content-Type: application/json;charset=UTF-8
3780
3781 )]}'
3782 {
3783 "Code-Review": -1,
3784 "Verified": 1
3785 "Work-In-Progress": 1,
3786 }
3787----
3788
3789[[delete-vote]]
3790=== Delete Vote
3791--
Edwin Kempin5488dc12016-08-29 11:13:31 +02003792'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 +02003793'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 +01003794--
3795
3796Deletes a single vote from a change. Note, that even when the last vote of
3797a reviewer is removed the reviewer itself is still listed on the change.
3798
Gal Paikin6ce56dc2021-03-29 12:28:43 +02003799If another user removed a user's vote, the user with the deleted vote will be
3800added to the attention set.
3801
Dmitrii Filippov3e0bbb72023-02-22 12:57:00 +01003802The request returns:
3803 * '204 No Content' if the vote is deleted successfully;
3804 * '404 Not Found' when the vote to be deleted is zero or not present.
3805
David Ostrovskybeb0b842014-12-13 00:24:29 +01003806.Request
3807----
3808 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003809 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3810----
3811
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003812Options can be provided in the request body as a
3813link:#delete-vote-input[DeleteVoteInput] entity.
3814Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01003815link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02003816In this case, use a POST request instead:
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003817
3818.Request
3819----
3820 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3821 Content-Type: application/json; charset=UTF-8
3822
3823 {
3824 "notify": "NONE"
3825 }
David Ostrovskybeb0b842014-12-13 00:24:29 +01003826----
3827
3828.Response
3829----
3830 HTTP/1.1 204 No Content
3831----
3832
Logan Hanksa1e68dc2017-06-29 15:13:27 -07003833
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003834[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003835== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003836
Shawn Pearce728ba882013-07-08 23:13:08 -07003837[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003838=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003839--
Shawn Pearce728ba882013-07-08 23:13:08 -07003840'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003841--
Shawn Pearce728ba882013-07-08 23:13:08 -07003842
3843Retrieves a parsed commit of a revision.
3844
3845.Request
3846----
3847 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
3848----
3849
3850As response a link:#commit-info[CommitInfo] entity is returned that
3851describes the revision.
3852
3853.Response
3854----
3855 HTTP/1.1 200 OK
3856 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003857 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07003858
3859 )]}'
3860 {
Edwin Kempinc8237402015-07-15 18:27:55 +02003861 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07003862 "parents": [
3863 {
3864 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3865 "subject": "Migrate contributor agreements to All-Projects."
3866 }
3867 ],
3868 "author": {
3869 "name": "Shawn O. Pearce",
3870 "email": "sop@google.com",
3871 "date": "2012-04-24 18:08:08.000000000",
3872 "tz": -420
3873 },
3874 "committer": {
3875 "name": "Shawn O. Pearce",
3876 "email": "sop@google.com",
3877 "date": "2012-04-24 18:08:08.000000000",
3878 "tz": -420
3879 },
3880 "subject": "Use an EventBus to manage star icons",
3881 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3882 }
3883----
3884
Sven Selbergd26bd542014-11-21 16:28:10 +01003885Adding query parameter `links` (for example `/changes/.../commit?links`)
3886returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07003887
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08003888[[get-description]]
3889=== Get Description
3890--
3891'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3892--
3893
3894Retrieves the description of a patch set.
3895
3896.Request
3897----
3898 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3899----
3900
3901.Response
3902----
3903 HTTP/1.1 200 OK
3904 Content-Disposition: attachment
3905 Content-Type: application/json; charset=UTF-8
3906
3907 )]}'
3908 "Added Documentation"
3909----
3910
3911If the patch set does not have a description an empty string is returned.
3912
3913[[set-description]]
3914=== Set Description
3915--
3916'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3917--
3918
3919Sets the description of a patch set.
3920
3921The new description must be provided in the request body inside a
3922link:#description-input[DescriptionInput] entity.
3923
3924.Request
3925----
3926 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3927 Content-Type: application/json; charset=UTF-8
3928
3929 {
3930 "description": "Added Documentation"
3931 }
3932----
3933
3934As response the new description is returned.
3935
3936.Response
3937----
3938 HTTP/1.1 200 OK
3939 Content-Disposition: attachment
3940 Content-Type: application/json; charset=UTF-8
3941
3942 )]}'
3943 "Added Documentation"
3944----
3945
Edwin Kempin0f229442016-09-09 13:06:12 +02003946[[get-merge-list]]
3947=== Get Merge List
3948--
3949'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist'
3950--
3951
3952Returns the list of commits that are being integrated into a target
3953branch by a merge commit. By default the first parent is assumed to be
3954uninteresting. By using the `parent` option another parent can be set
3955as uninteresting (parents are 1-based).
3956
3957The list of commits is returned as a list of
3958link:#commit-info[CommitInfo] entities. Web links are only included if
3959the `links` option was set.
3960
3961.Request
3962----
3963 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0
3964----
3965
3966.Response
3967----
3968HTTP/1.1 200 OK
3969 Content-Disposition: attachment
3970 Content-Type: application/json; charset=UTF-8
3971
3972 )]}'
3973 [
3974 {
3975 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
3976 "parents": [
3977 {
3978 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3979 "subject": "Migrate contributor agreements to All-Projects."
3980 }
3981 ],
3982 "author": {
3983 "name": "Shawn O. Pearce",
3984 "email": "sop@google.com",
3985 "date": "2012-04-24 18:08:08.000000000",
3986 "tz": -420
3987 },
3988 "committer": {
3989 "name": "Shawn O. Pearce",
3990 "email": "sop@google.com",
3991 "date": "2012-04-24 18:08:08.000000000",
3992 "tz": -420
3993 },
3994 "subject": "Use an EventBus to manage star icons",
3995 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3996 }
3997 ]
3998----
3999
Stefan Bellerc7259662015-02-12 17:23:05 -08004000[[get-revision-actions]]
4001=== Get Revision Actions
4002--
4003'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
4004--
4005
4006Retrieves revision link:#action-info[actions] of the revision of a change.
4007
4008.Request
4009----
4010 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
4011----
4012
4013.Response
4014----
4015 HTTP/1.1 200 OK
4016 Content-Disposition: attachment
4017 Content-Type: application/json; charset=UTF-8
4018
4019 )]}'
4020
4021{
4022 "submit": {
4023 "method": "POST",
4024 "label": "Submit",
4025 "title": "Submit patch set 1 into master",
4026 "enabled": true
4027 },
4028 "cherrypick": {
4029 "method": "POST",
4030 "label": "Cherry Pick",
4031 "title": "Cherry pick change to a different branch",
4032 "enabled": true
4033 }
4034}
4035----
4036
Han-Wen Nienhuys86db7672021-08-10 12:45:58 +02004037The response is a flat map of possible revision REST endpoint names
4038mapped to their link:#action-info[ActionInfo].
Stefan Bellerc7259662015-02-12 17:23:05 -08004039
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004040[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004041=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004042--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004043'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004044--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004045
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004046Retrieves a review of a revision.
4047
4048.Request
4049----
4050 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
4051----
4052
4053As response a link:#change-info[ChangeInfo] entity with
4054link:#detailed-labels[detailed labels] and link:#detailed-accounts[
4055detailed accounts] is returned that describes the review of the
4056revision. The revision for which the review is retrieved is contained
4057in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05004058set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004059revision of the change. Please note that the returned labels are always
4060for the current patch set.
4061
4062.Response
4063----
4064 HTTP/1.1 200 OK
4065 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004066 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004067
4068 )]}'
4069 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004070 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
4071 "project": "myProject",
4072 "branch": "master",
4073 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
4074 "subject": "Implementing Feature X",
4075 "status": "NEW",
4076 "created": "2013-02-01 09:59:32.126000000",
4077 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004078 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004079 "insertions": 34,
4080 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004081 "_number": 3965,
4082 "owner": {
4083 "_account_id": 1000096,
4084 "name": "John Doe",
4085 "email": "john.doe@example.com"
4086 },
4087 "labels": {
4088 "Verified": {
4089 "all": [
4090 {
4091 "value": 0,
4092 "_account_id": 1000096,
4093 "name": "John Doe",
4094 "email": "john.doe@example.com"
4095 },
4096 {
4097 "value": 0,
4098 "_account_id": 1000097,
4099 "name": "Jane Roe",
4100 "email": "jane.roe@example.com"
4101 }
4102 ],
4103 "values": {
4104 "-1": "Fails",
4105 " 0": "No score",
4106 "+1": "Verified"
4107 }
4108 },
4109 "Code-Review": {
4110 "all": [
4111 {
4112 "value": -1,
4113 "_account_id": 1000096,
4114 "name": "John Doe",
4115 "email": "john.doe@example.com"
4116 },
4117 {
4118 "value": 1,
4119 "_account_id": 1000097,
4120 "name": "Jane Roe",
4121 "email": "jane.roe@example.com"
4122 }
4123 ]
4124 "values": {
Oswald Buddenhagenf8877702022-02-15 14:01:34 +01004125 "-2": "This shall not be submitted",
4126 "-1": "I would prefer this is not submitted as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004127 " 0": "No score",
4128 "+1": "Looks good to me, but someone else must approve",
4129 "+2": "Looks good to me, approved"
4130 }
4131 }
4132 },
4133 "permitted_labels": {
4134 "Verified": [
4135 "-1",
4136 " 0",
4137 "+1"
4138 ],
4139 "Code-Review": [
4140 "-2",
4141 "-1",
4142 " 0",
4143 "+1",
4144 "+2"
4145 ]
4146 },
4147 "removable_reviewers": [
4148 {
4149 "_account_id": 1000096,
4150 "name": "John Doe",
4151 "email": "john.doe@example.com"
4152 },
4153 {
4154 "_account_id": 1000097,
4155 "name": "Jane Roe",
4156 "email": "jane.roe@example.com"
4157 }
4158 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08004159 "reviewers": {
4160 "REVIEWER": [
4161 {
4162 "_account_id": 1000096,
4163 "name": "John Doe",
4164 "email": "john.doe@example.com"
4165 },
4166 {
4167 "_account_id": 1000097,
4168 "name": "Jane Roe",
4169 "email": "jane.roe@example.com"
4170 }
4171 ]
4172 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004173 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
4174 "revisions": {
4175 "674ac754f91e64a0efb8087e59a176484bd534d1": {
David Pursehouse4de41112016-06-28 09:24:08 +09004176 "kind": "REWORK",
4177 "_number": 2,
4178 "ref": "refs/changes/65/3965/2",
4179 "fetch": {
4180 "http": {
4181 "url": "http://gerrit/myProject",
4182 "ref": "refs/changes/65/3965/2"
4183 }
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004184 }
4185 }
4186 }
4187 }
4188----
4189
David Pursehouse669f2512014-07-18 11:41:42 +09004190[[get-related-changes]]
4191=== Get Related Changes
4192--
4193'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
4194--
4195
4196Retrieves related changes of a revision. Related changes are changes that either
4197depend on, or are dependencies of the revision.
4198
Joerg Zieren75e95382022-07-08 11:30:35 +02004199Additional fields can be obtained by adding `o` parameters. Since these may slow
4200down processing they are disabled by default. Currently a single parameter is
4201supported:
4202
4203[[get-related-changes-submittable]]
4204--
4205* `SUBMITTABLE`: Compute the `submittable` field in the returned
4206 link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities.
4207--
4208
David Pursehouse669f2512014-07-18 11:41:42 +09004209.Request
4210----
4211 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
4212----
4213
4214As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
4215describing the related changes.
4216
4217.Response
4218----
4219 HTTP/1.1 200 OK
4220 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004221 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09004222
4223 )]}'
4224 {
4225 "changes": [
4226 {
Patrick Hieselcab63512017-07-28 10:25:42 +02004227 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09004228 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
4229 "commit": {
4230 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
4231 "parents": [
4232 {
4233 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
4234 }
4235 ],
4236 "author": {
4237 "name": "David Ostrovsky",
4238 "email": "david@ostrovsky.org",
4239 "date": "2014-07-12 15:04:24.000000000",
4240 "tz": 120
4241 },
4242 "subject": "Remove Solr"
4243 },
4244 "_change_number": 58478,
4245 "_revision_number": 2,
4246 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07004247 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09004248 },
4249 {
Patrick Hieselcab63512017-07-28 10:25:42 +02004250 "project": "gerrit",
David Pursehouse669f2512014-07-18 11:41:42 +09004251 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
4252 "commit": {
4253 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
4254 "parents": [
4255 {
4256 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
4257 }
4258 ],
4259 "author": {
4260 "name": "David Pursehouse",
4261 "email": "david.pursehouse@sonymobile.com",
4262 "date": "2014-06-24 02:01:28.000000000",
4263 "tz": 540
4264 },
4265 "subject": "Add support for secondary index with Elasticsearch"
4266 },
4267 "_change_number": 58081,
4268 "_revision_number": 10,
4269 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07004270 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09004271 }
4272 ]
4273 }
4274----
4275
4276
Edwin Kempin67498de2013-02-25 16:15:34 +01004277[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004278=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004279--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004280'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004281--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004282
Logan Hanksf03040e2017-05-03 09:40:56 -07004283Sets a review on a revision, optionally also publishing draft comments, setting
Logan Hanks53c36012017-06-30 13:47:54 -07004284labels, adding reviewers or CCs, and modifying the work in progress property.
Edwin Kempin67498de2013-02-25 16:15:34 +01004285
4286The review must be provided in the request body as a
4287link:#review-input[ReviewInput] entity.
4288
Youssef Elghareeb12add162019-12-18 18:43:23 +01004289If the labels are set, the user sending the request will automatically be
4290added as a reviewer, otherwise (if they only commented) they are added to
4291the CC list.
4292
Gal Paikinc326de42020-06-16 18:49:00 +03004293Some updates to the attention set occur here. If more than one update should
4294occur, only the first update in the order of the below documentation occurs:
4295
4296If a user is part of remove_from_attention_set, the user will be explicitly
4297removed from the attention set.
4298
4299If a user is part of add_to_attention_set, the user will be explicitly
4300added to the attention set.
4301
4302If the boolean ignore_default_attention_set_rules is set to true, all
4303other rules below will be ignored:
4304
4305The user who created the review is removed from the attention set.
4306
4307If the change is ready for review, the following also apply:
4308
4309When the uploader replies, the owner is added to the attention set.
4310
4311When the owner or uploader replies, all the reviewers are added to
4312the attention set.
4313
4314When neither the owner nor the uploader replies, add the owner and the
4315uploader to the attention set.
4316
4317Then, new reviewers are added to the attention set, and removed reviewers
4318(by becoming CC) are removed from the attention set.
4319
Aaron Gable8c650212017-04-25 12:03:37 -07004320A review cannot be set on a change edit. Trying to post a review for a
4321change edit fails with `409 Conflict`.
4322
Logan Hanksf03040e2017-05-03 09:40:56 -07004323Here is an example of using this method to set labels:
Aaron Gable8c650212017-04-25 12:03:37 -07004324
Edwin Kempin67498de2013-02-25 16:15:34 +01004325.Request
4326----
4327 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004328 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01004329
4330 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01004331 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01004332 "message": "Some nits need to be fixed.",
4333 "labels": {
4334 "Code-Review": -1
4335 },
4336 "comments": {
4337 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4338 {
4339 "line": 23,
4340 "message": "[nit] trailing whitespace"
4341 },
4342 {
4343 "line": 49,
4344 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09004345 },
4346 {
4347 "range": {
4348 "start_line": 50,
4349 "start_character": 0,
4350 "end_line": 55,
4351 "end_character": 20
4352 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09004353 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01004354 }
4355 ]
4356 }
4357 }
4358----
4359
Aaron Gable843b0c12017-04-21 08:25:27 -07004360As response a link:#review-result[ReviewResult] entity is returned that
Aaron Gable8c650212017-04-25 12:03:37 -07004361describes the applied labels and any added reviewers (e.g. yourself,
4362if you set a label but weren't previously a reviewer on this CL).
Edwin Kempin67498de2013-02-25 16:15:34 +01004363
4364.Response
4365----
4366 HTTP/1.1 200 OK
4367 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004368 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01004369
4370 )]}'
4371 {
4372 "labels": {
4373 "Code-Review": -1
4374 }
4375 }
4376----
4377
Aaron Gable8c650212017-04-25 12:03:37 -07004378It is also possible to add one or more reviewers or CCs
Logan Hanksf03040e2017-05-03 09:40:56 -07004379to a change simultaneously with a review:
Logan Hanks5f1c7592016-07-06 14:39:33 -07004380
4381.Request
4382----
4383 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
4384 Content-Type: application/json; charset=UTF-8
4385
4386 {
Aaron Gable8c650212017-04-25 12:03:37 -07004387 "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 -07004388 "reviewers": [
4389 {
4390 "reviewer": "jane.roe@example.com"
4391 },
4392 {
Aaron Gable8c650212017-04-25 12:03:37 -07004393 "reviewer": "john.doe@example.com",
4394 "state": "CC"
4395 }
4396 {
4397 "reviewer": "MyProjectVerifiers",
Logan Hanks5f1c7592016-07-06 14:39:33 -07004398 }
4399 ]
4400 }
4401----
4402
4403Each element of the `reviewers` list is an instance of
4404link:#reviewer-input[ReviewerInput]. The corresponding result of
Aaron Gable8c650212017-04-25 12:03:37 -07004405adding each reviewer will be returned in a map of inputs to
Gal Paikin721a40b2021-04-15 09:30:00 +02004406link:#reviewer-result[ReviewerResult]s.
Logan Hanks5f1c7592016-07-06 14:39:33 -07004407
4408.Response
4409----
4410 HTTP/1.1 200 OK
4411 Content-Disposition: attachment
4412 Content-Type: application/json; charset=UTF-8
4413
4414 )]}'
4415 {
Aaron Gable8c650212017-04-25 12:03:37 -07004416 "reviewers": {
4417 "jane.roe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07004418 "input": "jane.roe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07004419 "reviewers": [
4420 {
4421 "_account_id": 1000097,
4422 "name": "Jane Roe",
4423 "email": "jane.roe@example.com"
4424 "approvals": {
4425 "Verified": " 0",
4426 "Code-Review": " 0"
4427 },
4428 },
4429 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07004430 },
Aaron Gable8c650212017-04-25 12:03:37 -07004431 "john.doe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07004432 "input": "john.doe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07004433 "ccs": [
4434 {
4435 "_account_id": 1000096,
4436 "name": "John Doe",
4437 "email": "john.doe@example.com"
4438 "approvals": {
4439 "Verified": " 0",
4440 "Code-Review": " 0"
4441 },
4442 }
4443 ]
4444 },
4445 "MyProjectVerifiers": {
4446 "input": "MyProjectVerifiers",
4447 "reviewers": [
4448 {
4449 "_account_id": 1000098,
4450 "name": "Alice Ansel",
4451 "email": "alice.ansel@example.com"
4452 "approvals": {
4453 "Verified": " 0",
4454 "Code-Review": " 0"
4455 },
4456 },
4457 {
4458 "_account_id": 1000099,
4459 "name": "Bob Bollard",
4460 "email": "bob.bollard@example.com"
4461 "approvals": {
4462 "Verified": " 0",
4463 "Code-Review": " 0"
4464 },
4465 },
4466 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07004467 }
Aaron Gable8c650212017-04-25 12:03:37 -07004468 }
Logan Hanks5f1c7592016-07-06 14:39:33 -07004469 }
4470----
4471
Logan Hankse2aacef2016-07-22 15:54:52 -07004472If there are any errors returned for reviewers, the entire review request will
Aaron Gable8c650212017-04-25 12:03:37 -07004473be rejected with `400 Bad Request`. None of the entries will have the
4474`reviewers` or `ccs` field set, and those which specifically failed will have
4475the `errors` field set containing details of why they failed.
Logan Hankse2aacef2016-07-22 15:54:52 -07004476
4477.Error Response
4478----
4479 HTTP/1.1 400 Bad Request
4480 Content-Disposition: attachment
4481 Content-Type: application/json; charset=UTF-8
4482
4483 )]}'
4484 {
4485 "reviewers": {
Aaron Gable8c650212017-04-25 12:03:37 -07004486 "jane.roe@example.com": {
4487 "input": "jane.roe@example.com",
4488 "error": "Account of jane.roe@example.com is inactive."
4489 },
4490 "john.doe@example.com": {
4491 "input": "john.doe@example.com"
4492 },
Logan Hankse2aacef2016-07-22 15:54:52 -07004493 "MyProjectVerifiers": {
4494 "input": "MyProjectVerifiers",
4495 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
4496 "confirm": true
4497 }
4498 }
4499 }
4500----
4501
Dave Borowitzd2e41452017-10-26 08:06:23 -04004502[[set-review-notifications]]
Logan Hanksfc055962017-06-12 14:20:53 -07004503.Notifications
4504
4505An email will be sent using the "comment" template.
4506
4507If the top-level notify property is null or not set, then notification behavior
4508depends on whether the change is WIP, whether it has started review, and whether
4509the tag property is null.
4510
4511NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*.
4512Use the notify property of the top-level link:#review-input[ReviewInput] instead.
4513
4514For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS
4515watchers*.
4516
Logan Hanksea3e3b72017-06-12 14:21:47 -07004517[options="header",cols="2,1,1,2,2"]
Logan Hanksfc055962017-06-12 14:20:53 -07004518|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07004519|WIP State |Review Started|Tag Given|Default |notify=ALL
4520|Ready for review|N/A |N/A |everyone|everyone
4521|Work in progress|no |no |not sent|everyone
4522|Work in progress|no |yes |owner |everyone
4523|Work in progress|yes |no |everyone|everyone
4524|Work in progress|yes |yes |owner |everyone
4525
Logan Hanksfc055962017-06-12 14:20:53 -07004526|=============================
4527
4528If reviewers are added, then a second email will be sent using the "newchange"
4529template. The notification logic for this email is the same as for
4530link:#add-reviewer[Add Reviewer].
4531
Logan Hanksea3e3b72017-06-12 14:21:47 -07004532[options="header",cols="1,1,1"]
Logan Hanksfc055962017-06-12 14:20:53 -07004533|=============================
Logan Hanksea3e3b72017-06-12 14:21:47 -07004534|WIP State |Default |notify=ALL
4535|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
4536|Work in progress|not sent |owner, reviewers, CCs
Logan Hanksfc055962017-06-12 14:20:53 -07004537|=============================
4538
4539
Edwin Kempincdae63b2013-03-15 15:06:59 +01004540[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004541=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004542--
Edwin Kempincdae63b2013-03-15 15:06:59 +01004543'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004544--
Edwin Kempincdae63b2013-03-15 15:06:59 +01004545
4546Rebases a revision.
4547
Zalan Blenessy874aed72015-01-12 13:26:18 +01004548Optionally, the parent revision can be changed to another patch set through the
4549link:#rebase-input[RebaseInput] entity.
4550
Edwin Kempincdae63b2013-03-15 15:06:59 +01004551.Request
4552----
4553 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01004554 Content-Type: application/json;charset=UTF-8
4555
4556 {
4557 "base" : "1234",
4558 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01004559----
4560
4561As response a link:#change-info[ChangeInfo] entity is returned that
4562describes the rebased change. Information about the current patch set
4563is included.
4564
4565.Response
4566----
4567 HTTP/1.1 200 OK
4568 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004569 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01004570
4571 )]}'
4572 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01004573 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
4574 "project": "myProject",
4575 "branch": "master",
4576 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
4577 "subject": "Implement Feature X",
4578 "status": "NEW",
4579 "created": "2013-02-01 09:59:32.126000000",
4580 "updated": "2013-02-21 11:16:36.775000000",
4581 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004582 "insertions": 21,
4583 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01004584 "_number": 4799,
4585 "owner": {
4586 "name": "John Doe"
4587 },
4588 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
4589 "revisions": {
4590 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09004591 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01004592 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01004593 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01004594 "fetch": {
4595 "http": {
4596 "url": "http://gerrit:8080/myProject",
4597 "ref": "refs/changes/99/4799/2"
4598 }
4599 },
4600 "commit": {
4601 "parents": [
4602 {
4603 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
4604 "subject": "Implement Feature A"
4605 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00004606 ],
4607 "author": {
4608 "name": "John Doe",
4609 "email": "john.doe@example.com",
4610 "date": "2013-05-07 15:21:27.000000000",
4611 "tz": 120
4612 },
4613 "committer": {
4614 "name": "Gerrit Code Review",
4615 "email": "gerrit-server@example.com",
4616 "date": "2013-05-07 15:35:43.000000000",
4617 "tz": 120
4618 },
4619 "subject": "Implement Feature X",
4620 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01004621 }
4622 }
4623 }
4624----
4625
4626If the revision cannot be rebased, e.g. due to conflicts, the response is
4627"`409 Conflict`" and the error message is contained in the response
4628body.
4629
4630.Response
4631----
4632 HTTP/1.1 409 Conflict
4633 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004634 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01004635
4636 The change could not be rebased due to a path conflict during merge.
4637----
4638
Edwin Kempin14b58112013-02-26 16:30:19 +01004639[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004640=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004641--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004642'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004643--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004644
Edwin Kempin14b58112013-02-26 16:30:19 +01004645Submits a revision.
Gal Paikinc85d3522021-04-19 13:34:54 +02004646Submitting a change also removes all users from the link:#attention-set[attention set].
Edwin Kempin14b58112013-02-26 16:30:19 +01004647
Edwin Kempin14b58112013-02-26 16:30:19 +01004648.Request
4649----
4650 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
Edwin Kempin14b58112013-02-26 16:30:19 +01004651----
4652
Gal Paikin3d6cdec2021-04-19 13:32:13 +02004653As response a link:#change-info[ChangeInfo] entity is returned that
4654describes the submitted/merged change.
4655
Gal Paikine2849a82021-04-19 13:41:10 +02004656Submission may submit multiple changes, but we still only return one ChangeInfo
4657object. To query for all submitted changes, please use the submission_id that is
4658part of the response.
4659
4660Changes that will also be submitted:
46611. All changes of the same topic if
4662link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
4663configuration is set to true.
46642. All dependent changes.
46653. The closure of the above (e.g if a dependent change has a topic, all changes
4666of *that* topic will also be submitted).
4667
Gal Paikin3d6cdec2021-04-19 13:32:13 +02004668.Response
4669----
4670 HTTP/1.1 200 OK
4671 Content-Disposition: attachment
4672 Content-Type: application/json; charset=UTF-8
4673
4674 )]}'
4675 {
4676 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
4677 "project": "myProject",
4678 "branch": "master",
4679 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
4680 "subject": "Implementing Feature X",
4681 "status": "MERGED",
4682 "created": "2013-02-01 09:59:32.126000000",
4683 "updated": "2013-02-21 11:16:36.775000000",
4684 "submitted": "2013-02-21 11:16:36.615000000",
4685 "_number": 3965,
4686 "owner": {
4687 "name": "John Doe"
4688 }
4689 }
4690----
4691
Edwin Kempin14b58112013-02-26 16:30:19 +01004692If the revision cannot be submitted, e.g. because the submit rule
4693doesn't allow submitting the revision or the revision is not the
4694current revision, the response is "`409 Conflict`" and the error
4695message is contained in the response body.
4696
4697.Response
4698----
4699 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004700 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01004701
4702 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
4703----
4704
Edwin Kempin257d70f2013-03-28 14:31:14 +01004705[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004706=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004707--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004708'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004709--
Edwin Kempin257d70f2013-03-28 14:31:14 +01004710
4711Gets the formatted patch for one revision.
4712
4713.Request
4714----
4715 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
4716----
4717
Shawn Pearce98361f72013-05-10 16:27:36 -07004718The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01004719
4720.Response
4721----
4722 HTTP/1.1 200 OK
4723 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004724 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07004725 X-FYI-Content-Encoding: base64
4726 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01004727
Shawn Pearce98361f72013-05-10 16:27:36 -07004728 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01004729----
4730
David Ostrovsky973f38b2013-08-22 00:24:51 -07004731Adding query parameter `zip` (for example `/changes/.../patch?zip`)
4732returns the patch as a single file inside of a ZIP archive. Clients
4733can expand the ZIP to obtain the plain text patch, avoiding the
4734need for a base64 decoding step. This option implies `download`.
4735
4736Query parameter `download` (e.g. `/changes/.../patch?download`)
4737will suggest the browser save the patch as `commitsha1.diff.base64`,
4738for later processing by command line tools.
4739
Kasper Nilsson81448072016-10-17 15:04:33 -07004740If the `path` parameter is set, the returned content is a diff of the single
4741file that the path refers to.
4742
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004743[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004744=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004745--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004746'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004747--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004748
4749Gets the method the server will use to submit (merge) the change and
4750an indicator if the change is currently mergeable.
4751
4752.Request
4753----
4754 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
4755----
4756
Saša Živkov499873f2014-05-05 13:34:18 +02004757As response a link:#mergeable-info[MergeableInfo] entity is returned.
4758
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004759.Response
4760----
4761 HTTP/1.1 200 OK
4762 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004763 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004764
4765 )]}'
4766 {
4767 submit_type: "MERGE_IF_NECESSARY",
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004768 strategy: "recursive",
4769 mergeable: true
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004770 }
4771----
4772
Saša Živkov697cab22014-04-29 16:46:50 +02004773If the `other-branches` parameter is specified, the mergeability will also be
Zhen Chen6729b632016-11-11 17:32:32 -08004774checked for all other branches which are listed in the
4775link:config-project-config.html#branchOrder-section[branchOrder] section in the
4776project.config file.
Saša Živkov697cab22014-04-29 16:46:50 +02004777
4778.Request
4779----
4780 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
4781----
4782
4783The response will then contain a list of all other branches where this changes
4784could merge cleanly.
4785
4786.Response
4787----
4788 HTTP/1.1 200 OK
4789 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004790 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02004791
4792 )]}'
4793 {
4794 submit_type: "MERGE_IF_NECESSARY",
4795 mergeable: true,
4796 mergeable_into: [
4797 "refs/heads/stable-2.7",
4798 "refs/heads/stable-2.8",
4799 ]
4800 }
4801----
4802
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004803[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004804=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004805--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004806'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004807--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004808
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004809Gets the method the server will use to submit (merge) the change.
4810
4811.Request
4812----
4813 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
4814----
4815
4816.Response
4817----
4818 HTTP/1.1 200 OK
4819 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004820 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004821
4822 )]}'
4823 "MERGE_IF_NECESSARY"
4824----
4825
4826[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004827=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004828--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004829'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004830--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004831
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004832Tests the submit_type Prolog rule in the project, or the one given.
4833
4834Request body may be either the Prolog code as `text/plain` or a
4835link:#rule-input[RuleInput] object. The query parameter `filters`
4836may be set to `SKIP` to bypass parent project filters while testing
4837a project-specific rule.
4838
4839.Request
4840----
4841 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse4d7f9912020-06-18 13:02:56 +09004842 Content-Type: text/plain; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004843
4844 submit_type(cherry_pick).
4845----
4846
4847.Response
4848----
4849 HTTP/1.1 200 OK
4850 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004851 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004852
4853 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07004854 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004855----
4856
4857[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004858=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004859--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004860'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004861--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004862
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004863Tests the submit_rule Prolog rule in the project, or the one given.
4864
4865Request body may be either the Prolog code as `text/plain` or a
4866link:#rule-input[RuleInput] object. The query parameter `filters`
4867may be set to `SKIP` to bypass parent project filters while testing
4868a project-specific rule.
4869
4870.Request
4871----
Shawn Pearcea3cce712014-03-21 08:16:11 -07004872 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse4d7f9912020-06-18 13:02:56 +09004873 Content-Type: text/plain; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004874
4875 submit_rule(submit(R)) :-
4876 R = label('Any-Label-Name', reject(_)).
4877----
4878
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004879The response is a link:#submit-record[SubmitRecord] describing the
4880permutations that satisfy the tested submit rule.
4881
David Pursehouse87a3fb02019-10-29 16:01:27 +09004882If the submit rule was a no-op, the response is "`204 No Content`".
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004883
4884.Response
4885----
4886 HTTP/1.1 200 OK
4887 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004888 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004889
4890 )]}'
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004891 {
4892 "status": "NOT_READY",
4893 "reject": {
4894 "Any-Label-Name": {}
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004895 }
Patrick Hiesel7ab1b182019-08-13 15:29:27 +02004896 }
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004897----
4898
Shawn Pearceb42e3032015-04-02 10:28:10 -07004899When testing with the `curl` command line client the
4900`--data-binary @rules.pl` flag should be used to ensure
4901all LFs are included in the Prolog code:
4902
4903----
4904 curl -X POST \
4905 -H 'Content-Type: text/plain; charset=UTF-8' \
4906 --data-binary @rules.pl \
4907 http://.../test.submit_rule
4908----
4909
Edwin Kempincb6724a2013-02-26 16:58:51 +01004910[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004911=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004912--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004913'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004914--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004915
Edwin Kempin3ca57192013-02-27 07:44:01 +01004916Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01004917user.
4918
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004919Returns a map of file paths to lists of link:#comment-info[CommentInfo]
4920entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004921
4922.Request
4923----
4924 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
4925----
4926
4927.Response
4928----
4929 HTTP/1.1 200 OK
4930 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004931 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01004932
4933 )]}'
4934 {
4935 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4936 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004937 "id": "TvcXrmjM",
4938 "line": 23,
4939 "message": "[nit] trailing whitespace",
4940 "updated": "2013-02-26 15:40:43.986000000"
4941 },
4942 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004943 "id": "TveXwFiA",
4944 "line": 49,
4945 "in_reply_to": "TfYX-Iuo",
4946 "message": "Done",
4947 "updated": "2013-02-26 15:40:45.328000000"
4948 }
4949 ]
4950 }
4951----
4952
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004953[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004954=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004955--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004956'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004957--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004958
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004959Creates a draft comment on a revision.
4960
4961The new draft comment must be provided in the request body inside a
4962link:#comment-input[CommentInput] entity.
4963
4964.Request
4965----
4966 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004967 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004968
4969 {
4970 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4971 "line": 23,
4972 "message": "[nit] trailing whitespace"
4973 }
4974----
4975
4976As response a link:#comment-info[CommentInfo] entity is returned that
4977describes the draft comment.
4978
4979.Response
4980----
4981 HTTP/1.1 200 OK
4982 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004983 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004984
4985 )]}'
4986 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004987 "id": "TvcXrmjM",
4988 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4989 "line": 23,
4990 "message": "[nit] trailing whitespace",
4991 "updated": "2013-02-26 15:40:43.986000000"
4992 }
4993----
4994
Edwin Kempin3ca57192013-02-27 07:44:01 +01004995[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004996=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004997--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004998'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 -08004999--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005000
Edwin Kempin3ca57192013-02-27 07:44:01 +01005001Retrieves a draft comment of a revision that belongs to the calling
5002user.
5003
5004.Request
5005----
5006 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
5007----
5008
5009As response a link:#comment-info[CommentInfo] entity is returned that
5010describes the draft comment.
5011
5012.Response
5013----
5014 HTTP/1.1 200 OK
5015 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005016 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01005017
5018 )]}'
5019 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01005020 "id": "TvcXrmjM",
5021 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5022 "line": 23,
5023 "message": "[nit] trailing whitespace",
5024 "updated": "2013-02-26 15:40:43.986000000"
5025 }
5026----
5027
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005028[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005029=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005030--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005031'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 -08005032--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005033
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005034Updates a draft comment on a revision.
5035
5036The new draft comment must be provided in the request body inside a
5037link:#comment-input[CommentInput] entity.
5038
5039.Request
5040----
5041 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005042 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005043
5044 {
5045 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5046 "line": 23,
5047 "message": "[nit] trailing whitespace"
5048 }
5049----
5050
5051As response a link:#comment-info[CommentInfo] entity is returned that
5052describes the draft comment.
5053
5054.Response
5055----
5056 HTTP/1.1 200 OK
5057 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005058 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005059
5060 )]}'
5061 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005062 "id": "TvcXrmjM",
5063 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5064 "line": 23,
5065 "message": "[nit] trailing whitespace",
5066 "updated": "2013-02-26 15:40:43.986000000"
5067 }
5068----
5069
5070[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005071=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005072--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005073'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 -08005074--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005075
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005076Deletes a draft comment from a revision.
5077
5078.Request
5079----
5080 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
5081----
5082
5083.Response
5084----
5085 HTTP/1.1 204 No Content
5086----
5087
John Spurlock5e402f02013-03-24 11:35:04 -04005088[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07005089=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005090--
John Spurlock5e402f02013-03-24 11:35:04 -04005091'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005092--
John Spurlock5e402f02013-03-24 11:35:04 -04005093
5094Lists the published comments of a revision.
5095
5096As result a map is returned that maps the file path to a list of
5097link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07005098sorted by file path and only include file (or inline) comments. Use
5099the link:#get-change-detail[Get Change Detail] endpoint to retrieve
5100the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04005101
5102.Request
5103----
5104 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
5105----
5106
5107.Response
5108----
5109 HTTP/1.1 200 OK
5110 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005111 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04005112
5113 )]}'
5114 {
5115 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5116 {
John Spurlock5e402f02013-03-24 11:35:04 -04005117 "id": "TvcXrmjM",
5118 "line": 23,
5119 "message": "[nit] trailing whitespace",
5120 "updated": "2013-02-26 15:40:43.986000000",
5121 "author": {
5122 "_account_id": 1000096,
5123 "name": "John Doe",
5124 "email": "john.doe@example.com"
5125 }
5126 },
5127 {
John Spurlock5e402f02013-03-24 11:35:04 -04005128 "id": "TveXwFiA",
5129 "line": 49,
5130 "in_reply_to": "TfYX-Iuo",
5131 "message": "Done",
5132 "updated": "2013-02-26 15:40:45.328000000",
5133 "author": {
5134 "_account_id": 1000097,
5135 "name": "Jane Roe",
5136 "email": "jane.roe@example.com"
5137 }
5138 }
5139 ]
5140 }
5141----
5142
5143[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005144=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005145--
John Spurlock5e402f02013-03-24 11:35:04 -04005146'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 -08005147--
John Spurlock5e402f02013-03-24 11:35:04 -04005148
5149Retrieves a published comment of a revision.
5150
5151.Request
5152----
5153 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
5154----
5155
5156As response a link:#comment-info[CommentInfo] entity is returned that
5157describes the published comment.
5158
5159.Response
5160----
5161 HTTP/1.1 200 OK
5162 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005163 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04005164
5165 )]}'
5166 {
John Spurlock5e402f02013-03-24 11:35:04 -04005167 "id": "TvcXrmjM",
5168 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5169 "line": 23,
5170 "message": "[nit] trailing whitespace",
5171 "updated": "2013-02-26 15:40:43.986000000",
5172 "author": {
5173 "_account_id": 1000096,
5174 "name": "John Doe",
5175 "email": "john.doe@example.com"
5176 }
5177 }
5178----
5179
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005180[[delete-comment]]
5181=== Delete Comment
5182--
5183'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' +
5184'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete'
5185--
5186
5187Deletes a published comment of a revision. Instead of deleting the
5188whole comment, this endpoint just replaces the comment's message
5189with a new message, which contains the name of the user who deletes
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005190the comment and the reason why it's deleted.
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005191
Gal Paikin8d027232021-12-09 12:39:19 +01005192This endpoint also marks the comment as resolved since deleted comments are not
5193actionable.
5194
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005195Note that only users with the
5196link:access-control.html#capability_administrateServer[Administrate Server]
5197global capability are permitted to delete a comment.
5198
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005199Deletion reason can be provided in the request body as a
5200link:#delete-comment-input[DeleteCommentInput] entity.
5201Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01005202link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02005203In this case, use a POST request instead:
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005204
5205.Request
5206----
5207 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0
5208 Content-Type: application/json; charset=UTF-8
5209
5210 {
5211 "reason": "contains confidential information"
5212 }
5213----
5214
5215As response a link:#comment-info[CommentInfo] entity is returned that
5216describes the updated comment.
5217
5218.Response
5219----
5220 HTTP/1.1 200 OK
5221 Content-Disposition: attachment
5222 Content-Type: application/json; charset=UTF-8
5223
5224 )]}'
5225 {
5226 "id": "TvcXrmjM",
5227 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5228 "line": 23,
5229 "message": "Comment removed by: Administrator; Reason: contains confidential information",
5230 "updated": "2013-02-26 15:40:43.986000000",
5231 "author": {
5232 "_account_id": 1000096,
5233 "name": "John Doe",
5234 "email": "john.doe@example.com"
5235 }
5236 }
5237----
5238
Edwin Kempinb050a482016-12-01 09:11:19 +01005239[[list-robot-comments]]
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005240=== List Robot Comments
5241--
5242'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/'
5243--
5244
5245Lists the link:config-robot-comments.html[robot comments] of a
5246revision.
5247
5248As result a map is returned that maps the file path to a list of
5249link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
5250map are sorted by file path.
5251
5252.Request
5253----
5254 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0
5255----
5256
5257.Response
5258----
5259 HTTP/1.1 200 OK
5260 Content-Disposition: attachment
5261 Content-Type: application/json; charset=UTF-8
5262
5263 )]}'
5264 {
5265 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5266 {
5267 "id": "TvcXrmjM",
5268 "line": 23,
5269 "message": "unused import",
5270 "updated": "2016-02-26 15:40:43.986000000",
5271 "author": {
5272 "_account_id": 1000110,
5273 "name": "Code Analyzer",
5274 "email": "code.analyzer@example.com"
5275 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005276 "robot_id": "importChecker",
5277 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005278 },
5279 {
5280 "id": "TveXwFiA",
5281 "line": 49,
5282 "message": "wrong indention",
5283 "updated": "2016-02-26 15:40:45.328000000",
5284 "author": {
5285 "_account_id": 1000110,
5286 "name": "Code Analyzer",
5287 "email": "code.analyzer@example.com"
5288 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005289 "robot_id": "styleChecker",
5290 "robot_run_id": "5c606c425dd45184484f9d0a2ffd725a7607839b"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005291 }
5292 ]
5293 }
5294----
5295
5296[[get-robot-comment]]
5297=== Get Robot Comment
5298--
5299'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]'
5300--
5301
5302Retrieves a link:config-robot-comments.html[robot comment] of a
5303revision.
5304
5305.Request
5306----
5307 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0
5308----
5309
5310As response a link:#robot-comment-info[RobotCommentInfo] entity is
5311returned that describes the robot comment.
5312
5313.Response
5314----
5315 HTTP/1.1 200 OK
5316 Content-Disposition: attachment
5317 Content-Type: application/json; charset=UTF-8
5318
5319 )]}'
5320 {
5321 "id": "TvcXrmjM",
5322 "line": 23,
5323 "message": "unused import",
5324 "updated": "2016-02-26 15:40:43.986000000",
5325 "author": {
5326 "_account_id": 1000110,
5327 "name": "Code Analyzer",
5328 "email": "code.analyzer@example.com"
5329 },
David Pursehouseb23a5ae2020-01-27 13:53:11 +09005330 "robot_id": "importChecker",
5331 "robot_run_id": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005332 }
5333----
5334
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005335[[list-ported-comments]]
5336=== List Ported Comments
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005337--
5338'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_comments'
5339--
5340
5341Ports comments of other revisions to the requested revision.
5342
5343Only comments added on earlier patchsets are ported. That set of comments is filtered even further
5344due to some additional rules. Callers of this endpoint shouldn't rely on the exact logic of which
5345comments are ported as that logic might change in the future. Instead, callers must be able to
5346handle any smaller/larger set of comments returned by this endpoint.
5347
5348Typically, a comment thread is returned fully or excluded fully. However, draft comments and
5349robot comments are ignored and not returned via this endpoint. Hence, it's possible to get ported
5350comments from this endpoint which are a reply to a non-ported robot comment. Callers must be
5351able to deal with this situation.
5352
5353The returned comments are organized in a map of file path to link:#comment-info[CommentInfo] entries
5354in the same fashion as for the link:#list-comments[List Revision Comments] endpoint.
5355The map is filled with the original comment attributes except for these attributes: `path`, `line`,
5356and `range` point to the computed position in the target revision. If the exactly correct position
5357can't be determined, those fields will be filled with the next best position. That can also mean
5358not filling the `line` or `range` attribute anymore and thus converting the comment to a file
5359comment (or even moving the comment to a different file or the patchset level). Callers of this
5360endpoint must be able to deal with this and not rely on the original comment position.
5361
5362It's possible that this endpoint returns different link:#comment-info[CommentInfo] entries with
5363the same comment UUID. This is not a bug but a feature. If a comment appears on a file which Gerrit
5364recognizes as copied between patchsets, the ported version of this comment consists of two ported
5365instances having the same UUID but different `file`/`line`/`range` positions. Callers must be able
5366to handle this situation.
5367
5368Repeated calls of this endpoint might produce different results. Internal errors during the
5369position computation are mapped to fallback locations for affected comments. Those errors might
5370have vanished on later calls, upon which this endpoint returns the actually mapped position. In
5371addition, comments can be deleted and draft comments can be published, upon which the set of ported
5372comments may change.
5373
5374.Request
5375----
5376 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/4/ported_comments/ HTTP/1.0
5377----
5378
5379.Response
5380----
5381 HTTP/1.1 200 OK
5382 Content-Disposition: attachment
5383 Content-Type: application/json; charset=UTF-8
5384
5385 )]}'
5386 {
5387 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5388 {
5389 "id": "TvcXrmjM",
5390 "patch_set": 2,
5391 "line": 23,
5392 "message": "[nit] trailing whitespace",
5393 "updated": "2013-02-26 15:40:43.986000000",
5394 "author": {
5395 "_account_id": 1000096,
5396 "name": "John Doe",
5397 "email": "john.doe@example.com"
5398 },
5399 "unresolved": true
5400 },
5401 {
5402 "id": "TveXwFiA",
5403 "patch_set": 2,
5404 "line": 23,
5405 "in_reply_to": "TvcXrmjM",
5406 "message": "Done",
5407 "updated": "2013-02-26 15:40:45.328000000",
5408 "author": {
5409 "_account_id": 1000097,
5410 "name": "Jane Roe",
5411 "email": "jane.roe@example.com"
5412 },
5413 "unresolved": true
5414 }
5415 ]
5416 }
5417----
5418
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005419[[list-ported-drafts]]
5420=== List Ported Drafts
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005421--
5422'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/ported_drafts'
5423--
5424
5425Ports draft comments of other revisions to the requested revision.
5426
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005427This endpoint behaves similarly to the link:#list-ported-comments[List Ported Comments] endpoint.
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005428With this endpoint, only draft comments of the calling user are ported, though. If a draft comment
5429is a reply to a published comment, only the ported draft comment is returned.
5430
5431Depending on the filtering rules, it's possible that this endpoint returns a draft comment which is
5432a reply to a comment thread which is not returned by the
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005433link:#list-ported-comments[List Ported Comments] endpoint. That's intended behavior. Callers must be
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005434able to handle this situation. The same holds for drafts which are a reply to a robot comment.
5435
Youssef Elghareebcdc33b92021-04-29 18:18:35 +02005436Different than the link:#list-ported-comments[List Ported Comments] endpoint, the `author` of the
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005437returned comments is not filled for this endpoint as only comments of the calling user are returned.
5438
Patrick Hieselafd6c702020-11-06 10:21:47 +01005439This endpoint requires authentication.
5440
Alice Kober-Sotzek342da962020-09-11 11:27:00 +02005441.Request
5442----
5443 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/ported_drafts/ HTTP/1.0
5444----
5445
5446.Response
5447----
5448 HTTP/1.1 200 OK
5449 Content-Disposition: attachment
5450 Content-Type: application/json; charset=UTF-8
5451
5452 )]}'
5453 {
5454 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
5455 {
5456 "id": "TveXwFiA",
5457 "patch_set": 2,
5458 "line": 23,
5459 "in_reply_to": "TvcXrmjM",
5460 "message": "Done",
5461 "updated": "2013-02-26 15:40:45.328000000",
5462 "unresolved": true
5463 }
5464 ]
5465 }
5466----
5467
Sharad Bagri3f6ed642022-06-06 12:41:57 -07005468[[apply-stored-fix]]
5469=== Apply Stored Fix
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005470--
5471'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply'
5472--
5473
5474Applies a suggested fix by creating a change edit which includes the
5475modifications indicated by the fix suggestion. If a change edit already exists,
5476it will be updated accordingly. A fix can only be applied if no change edit
5477exists and the fix refers to the current patch set, or the fix refers to the
5478patch set on which the change edit is based.
5479
5480.Request
5481----
5482 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0
5483----
5484
5485If the fix was successfully applied, an <<edit-info,EditInfo>> describing the
5486resulting change edit is returned.
5487
5488.Response
5489----
5490 HTTP/1.1 200 OK
5491 Content-Disposition: attachment
5492 Content-Type: application/json; charset=UTF-8
5493
5494 )]}'
5495 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01005496 "commit": {
5497 "parents": [
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005498 {
Edwin Kempine813c5a2019-03-13 09:51:12 +01005499 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005500 }
5501 ],
Edwin Kempine813c5a2019-03-13 09:51:12 +01005502 "author": {
5503 "name": "John Doe",
5504 "email": "john.doe@example.com",
5505 "date": "2013-05-07 15:21:27.000000000",
5506 "tz": 120
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005507 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005508 "committer": {
5509 "name": "Jane Doe",
5510 "email": "jane.doe@example.com",
5511 "date": "2013-05-07 15:35:43.000000000",
5512 "tz": 120
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005513 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005514 "subject": "Implement feature X",
5515 "message": "Implement feature X\n\nWith this feature ..."
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005516 },
Edwin Kempine813c5a2019-03-13 09:51:12 +01005517 "base_patch_set_number": 1,
5518 "base_revision": "674ac754f91e64a0efb8087e59a176484bd534d1"
5519 "ref": "refs/users/01/1000001/edit-42622/1"
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005520 }
5521----
5522
5523If the application failed e.g. due to conflicts with an existing change edit,
5524the response "`409 Conflict`" including an error message in the response body
5525is returned.
5526
5527.Response
5528----
5529 HTTP/1.1 409 Conflict
5530 Content-Disposition: attachment
5531 Content-Type: text/plain; charset=UTF-8
5532
5533 The existing change edit could not be merged with another tree.
5534----
5535
Sharad Bagribdb582d2022-03-26 01:32:35 -07005536[[apply-provided-fix]]
5537==== Apply Provided Fix
5538--
5539'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fix:apply'
5540--
5541Applies a list of <<fix-replacement-info,FixReplacementInfo>> loaded from the
5542<<apply-provided-fix-input,ApplyProvidedFixInput>> entity. The fixes are passed as part of the request body. The
5543application of the fixes creates a new change edit. `Apply Provided Fix` can only be applied on the current
5544patchset.
5545
5546.Request
5547----
5548 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fix:apply HTTP/1.0
5549 Content-Type: application/json; charset=UTF-8
5550
5551 {
5552 "fix_replacement_infos": [
5553 {
5554 "path": "abcd.txt",
5555 "range": {
5556 "start_line": 2,
5557 "start_character": 2,
5558 "end_line": 2,
5559 "end_character": 5
5560 },
5561 "replacement": "abcdefg"
5562 }
5563 ]
5564 }
5565----
5566
5567If the `ApplyProvidedFixInput` was successfully applied, an link:#edit-info[EditInfo] describing the
5568resulting change edit is returned.
5569
5570.Response
5571----
5572 HTTP/1.1 200 OK
5573 Content-Disposition: attachment
5574 Content-Type: application/json; charset=UTF-8
5575
5576 )]}'
5577 {
5578 "commit": {
5579 "commit": "bd43e48c33d2b1a03485040eba38cefc505f7997",
5580 "parents": [
5581 {
5582 "commit": "9825962f8ab6da89afebad3f5034db05fb4b7560"
5583 }
5584 ],
5585 "author": {
5586 "name": "John Doe",
5587 "email": "john.doe@example.com",
5588 "date": "2022-05-07 15:21:27.000000000",
5589 "tz": 120
5590 },
5591 "committer": {
5592 "name": "Jane Doe",
5593 "email": "jane.doe@example.com",
5594 "date": "2022-05-07 15:35:43.000000000",
5595 "tz": 120
5596 },
5597 "subject": "Implement feature X",
5598 "message": "Implement feature X\n\nWith this feature ..."
5599 },
5600 "base_patch_set_number": 1,
5601 "base_revision": "86d87686ce0ef7f7c536bfc7e9a66f5a6fa5d658",
5602 "ref": "refs/users/01/1000001/edit-1/1"
5603 }
5604----
5605
5606If the application failed due to presence of an existing change edit,
5607the response "`400 Bad Request`" including an error message in the response body
5608is returned.
5609
5610.Response
5611----
5612 HTTP/1.1 400 Bad Request
5613 Content-Disposition: attachment
5614 Content-Type: text/plain; charset=UTF-8
5615
5616 Change edit already exists. A new change edit can't be created
5617----
5618
5619If the application failed due to application on a previous patch set, the response
5620"`409 Conflict`" including an error message in the response body is returned.
5621
5622.Response
5623----
5624 HTTP/1.1 409 Conflict
5625 Content-Disposition: attachment
5626 Content-Type: text/plain; charset=UTF-8
5627
5628 A change edit may only be created for the current patch set 1,2 (and not for 1,1)
5629----
5630
Edwin Kempin682ac712013-05-14 13:40:46 +02005631[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005632=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005633--
Edwin Kempin682ac712013-05-14 13:40:46 +02005634'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005635--
Edwin Kempin682ac712013-05-14 13:40:46 +02005636
5637Lists the files that were modified, added or deleted in a revision.
5638
5639.Request
5640----
5641 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
5642----
5643
Makson Leefaf05c22018-07-26 22:42:59 +00005644As result a map is returned that maps the link:#file-id[file path] to a
5645link:#file-info[FileInfo] entry. The entries in the map are
Edwin Kempin682ac712013-05-14 13:40:46 +02005646sorted by file path.
5647
5648.Response
5649----
5650 HTTP/1.1 200 OK
5651 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005652 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02005653
5654 )]}'
5655 {
5656 "/COMMIT_MSG": {
5657 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02005658 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01005659 "size_delta": 551,
5660 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02005661 },
5662 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
5663 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02005664 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01005665 "size_delta": 98,
5666 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02005667 }
5668 }
5669----
5670
Shawn Pearce984747d2013-07-18 00:42:16 -07005671The request parameter `reviewed` changes the response to return a list
5672of the paths the caller has marked as reviewed. Clients that also
5673need the FileInfo should make two requests.
5674
Shawn Pearce8ca03a62015-01-02 22:03:20 -08005675The request parameter `q` changes the response to return a list
5676of all files (modified or unmodified) that contain that substring
5677in the path name. This is useful to implement suggestion services
David Pursehousefcfb29d2019-08-01 12:55:16 +09005678finding a file by partial name. Clients that also need the FileInfo
5679should make two requests.
Shawn Pearce8ca03a62015-01-02 22:03:20 -08005680
David Pursehouse89c00ca2019-08-03 13:47:29 +09005681For merge commits only, the integer-valued request parameter `parent`
5682changes the response to return a map of the files which are different
5683in this commit compared to the given parent commit. The value is the
Andrii Shyshkalov350a4512019-09-23 02:26:33 -070056841-based index of the parent's position in the commit object,
5685with the first parent always belonging to the target branch. If not
David Pursehouse89c00ca2019-08-03 13:47:29 +09005686specified, the response contains a map of the files different in the
5687auto merge result.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005688
David Pursehousefcfb29d2019-08-01 12:55:16 +09005689The request parameter `base` changes the response to return a map of the
5690files which are different in this commit compared to the given revision. The
5691revision must correspond to a patch set in the change.
5692
5693The `reviewed`, `q`, `parent`, and `base` options are mutually exclusive.
5694That is, only one of them may be used at a time.
Shawn Pearce984747d2013-07-18 00:42:16 -07005695
5696.Request
5697----
5698 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
5699----
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005700
Shawn Pearce984747d2013-07-18 00:42:16 -07005701.Response
5702----
5703 HTTP/1.1 200 OK
5704 Content-Disposition: attachment
5705 Content-Type: application/json; charset=UTF-8
5706
5707 )]}'
5708 [
Edwin Kempinaef44b02013-05-07 16:15:55 +02005709 "/COMMIT_MSG",
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005710 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005711 ]
Edwin Kempinbea55a52013-05-14 13:53:39 +02005712----
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005713
Edwin Kempinaef44b02013-05-07 16:15:55 +02005714[[get-content]]
5715=== Get Content
5716--
5717'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content'
5718--
5719
5720Gets the content of a file from a certain revision.
5721
Patrick Hiesel38667d42017-05-02 13:12:48 +02005722The optional, integer-valued `parent` parameter can be specified to request
5723the named file from a parent commit of the specified revision. The value is
5724the 1-based index of the parent's position in the commit object. If the
5725parameter is omitted or the value is non-positive, the patch set is referenced.
5726
Edwin Kempinaef44b02013-05-07 16:15:55 +02005727.Request
5728----
5729 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
5730----
5731
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05005732The content is returned as base64 encoded string. The HTTP response
5733Content-Type is always `text/plain`, reflecting the base64 wrapping.
5734A Gerrit-specific `X-FYI-Content-Type` header is returned describing
5735the server detected content type of the file.
5736
5737If only the content type is required, callers should use HEAD to
5738avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02005739
5740.Response
5741----
5742 HTTP/1.1 200 OK
5743 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05005744 Content-Type: text/plain; charset=ISO-8859-1
5745 X-FYI-Content-Encoding: base64
5746 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02005747
5748 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
5749----
5750
David Ostrovskyd0078672015-02-06 21:51:04 +01005751Alternatively, if the only value of the Accept request header is
5752`application/json` the content is returned as JSON string and
5753`X-FYI-Content-Encoding` is set to `json`.
5754
David Pletcherd1efb452015-09-01 17:45:55 -07005755[[get-safe-content]]
5756=== Download Content
5757--
5758'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
5759--
5760
5761Downloads the content of a file from a certain revision, in a safe format
5762that poses no risk for inadvertent execution of untrusted code.
5763
5764If the content type is defined as safe, the binary file content is returned
5765verbatim. If the content type is not safe, the file is stored inside a ZIP
5766file, containing a single entry with a random, unpredictable name having the
5767same base and suffix as the true filename. The ZIP file is returned in
5768verbatim binary form.
5769
5770See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
5771for information about safe file type configuration.
5772
5773The HTTP resource Content-Type is dependent on the file type: the
5774applicable type for safe files, or "application/zip" for unsafe files.
5775
David Pletcherec622bf2015-09-18 14:30:05 -07005776The optional, integer-valued `parent` parameter can be specified to request
5777the named file from a parent commit of the specified revision. The value is
5778the 1-based index of the parent's position in the commit object. If the
5779parameter is omitted or the value non-positive, the patch set is referenced.
5780
5781Filenames are decorated with a suffix of `_new` for the current patch,
5782`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07005783
5784.Request
5785----
David Pursehouse6147f6d2016-10-18 05:40:44 +00005786 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/download HTTP/1.0
David Pletcherd1efb452015-09-01 17:45:55 -07005787----
5788
5789.Response
5790----
5791 HTTP/1.1 200 OK
5792 Content-Disposition: attachment; filename="logo.png"
5793 Content-Type: image/png
5794
5795 `[binary data for logo.png]`
5796----
5797
5798.Request
5799----
David Pursehouse6147f6d2016-10-18 05:40:44 +00005800 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 -07005801----
5802
5803.Response
5804----
5805 HTTP/1.1 200 OK
5806 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
5807 Content-Type:application/zip
5808
5809 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
5810----
5811
David Pursehouse882aef22013-06-05 10:56:37 +09005812[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005813=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005814--
David Pursehouse882aef22013-06-05 10:56:37 +09005815'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 -08005816--
David Pursehouse882aef22013-06-05 10:56:37 +09005817
5818Gets the diff of a file from a certain revision.
5819
5820.Request
5821----
5822 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
5823----
5824
5825As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
5826
5827.Response
5828----
5829 HTTP/1.1 200 OK
5830 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005831 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005832
5833 )]
5834 {
5835 "meta_a": {
5836 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005837 "content_type": "text/x-java-source",
5838 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09005839 },
5840 "meta_b": {
5841 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005842 "content_type": "text/x-java-source",
5843 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005844 },
5845 "change_type": "MODIFIED",
5846 "diff_header": [
5847 "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",
5848 "index 59b7670..9faf81c 100644",
5849 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5850 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
5851 ],
5852 "content": [
5853 {
5854 "ab": [
5855 "// Copyright (C) 2010 The Android Open Source Project",
5856 "//",
5857 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
5858 "// you may not use this file except in compliance with the License.",
5859 "// You may obtain a copy of the License at",
5860 "//",
5861 "// http://www.apache.org/licenses/LICENSE-2.0",
5862 "//",
5863 "// Unless required by applicable law or agreed to in writing, software",
5864 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
5865 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
5866 "// See the License for the specific language governing permissions and",
5867 "// limitations under the License."
5868 ]
5869 },
5870 {
5871 "b": [
5872 "//",
5873 "// Add some more lines in the header."
5874 ]
5875 },
5876 {
5877 "ab": [
5878 "",
5879 "package com.google.gerrit.server.project;",
5880 "",
5881 "import com.google.common.collect.Maps;",
5882 ...
5883 ]
5884 }
5885 ...
5886 ]
5887 }
5888----
5889
5890If the `intraline` parameter is specified, intraline differences are included in the diff.
5891
5892.Request
5893----
5894 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
5895----
5896
5897.Response
5898----
5899 HTTP/1.1 200 OK
5900 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005901 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005902
5903 )]
5904 {
5905 "meta_a": {
5906 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005907 "content_type": "text/x-java-source",
5908 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09005909 },
5910 "meta_b": {
5911 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005912 "content_type": "text/x-java-source",
5913 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005914 },
5915 "change_type": "MODIFIED",
5916 "diff_header": [
5917 "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",
5918 "index 59b7670..9faf81c 100644",
5919 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
5920 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
5921 ],
5922 "content": [
5923 ...
5924 {
5925 "a": [
5926 "/** Manages access control for Git references (aka branches, tags). */"
5927 ],
5928 "b": [
5929 "/** Manages access control for the Git references (aka branches, tags). */"
5930 ],
5931 "edit_a": [],
5932 "edit_b": [
5933 [
5934 31,
5935 4
5936 ]
5937 ]
5938 }
5939 ]
5940 }
5941----
5942
5943The `base` parameter can be specified to control the base patch set from which the diff should
5944be generated.
5945
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005946The integer-valued request parameter `parent` can be specified to control the
5947parent commit number against which the diff should be generated. This is useful
5948for supporting review of merge commits. The value is the 1-based index of the
5949parent's position in the commit object.
5950
David Pursehouse882aef22013-06-05 10:56:37 +09005951.Request
5952----
5953 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
5954----
5955
5956.Response
5957----
5958 HTTP/1.1 200 OK
5959 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005960 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005961
5962 )]
5963 {
5964 "meta_a": {
5965 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005966 "content_type": "text/x-java-source",
5967 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005968 },
5969 "meta_b": {
5970 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005971 "content_type": "text/x-java-source",
5972 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005973 },
5974 "change_type": "MODIFIED",
5975 "content": [
5976 {
5977 "skip": 578
5978 }
5979 ]
5980 }
5981----
5982
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01005983The `whitespace` parameter can be specified to control how whitespace
5984differences are reported in the result. Valid values are `IGNORE_NONE`,
5985`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09005986
Sharad Bagri3f6ed642022-06-06 12:41:57 -07005987[[preview-stored-fix]]
5988=== Preview Stored Fix
Dmitrii Filippovbf3f08b2019-12-06 03:13:06 +01005989--
5990'GET /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/preview'
5991--
5992
5993Gets the diffs of all files for a certain <<fix-id,\{fix-id\}>>.
5994As response, a map of link:#diff-info[DiffInfo] entities is returned that describes the diffs.
5995
5996Each link:#diff-info[DiffInfo] is the differences between the patch set indicated by revision-id and a virtual patch set with the applied fix.
5997
Sharad Bagrid1b05fd2022-05-18 13:14:17 -07005998[[preview-provided-fix]]
5999=== Preview Provided fix
6000--
6001'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fix:preview'
6002--
6003
6004Gets the diffs of all files for a list of <<fix-replacement-info,FixReplacementInfo>> loaded from
6005the <<apply-provided-fix-input,ApplyProvidedFixInput>> entity. The fixes are passed as part of the
6006request body.
6007As response, a map of link:#diff-info[DiffInfo] is returned that describes the diffs.
6008
6009Each link:#diff-info[DiffInfo] is the differences between the patch set indicated by revision-id
6010and a virtual patch set with the applied fix. No content on the server will be modified as part of this request.
6011
6012.Request
6013----
6014 POST /changes/myProject~master~Id6f0b9d946791f8aba90ace53074eda565983452/revisions/1/fix:preview HTTP/1.0
6015 Content-Type: application/json; charset=UTF-8
6016
6017 {
6018 "fix_replacement_infos": [
6019 {
6020 "path": "abcd.txt",
6021 "range": {
6022 "start_line": 2,
6023 "start_character": 2,
6024 "end_line": 2,
6025 "end_character": 5
6026 },
6027 "replacement": "abcdefg"
6028 }
6029 ]
6030 }
6031----
6032
6033If the `Preview Provided Fix` operation was successful, a link:#diff-info[DiffInfo] previewing the
6034change is returned.
6035
6036.Response
6037----
6038 HTTP/1.1 200 OK
6039 Content-Disposition: attachment
6040 Content-Type: application/json; charset=UTF-8
6041
6042 )]}'
6043 {
6044 "abcd.txt": {
6045 "meta_a": {
6046 "name": "abcd.txt",
6047 "content_type": "text/plain",
6048 "lines": 3
6049 },
6050 "meta_b": {
6051 "name": "abcd.txt",
6052 "content_type": "text/plain",
6053 "lines": 3
6054 },
6055 "intraline_status": "OK",
6056 "change_type": "MODIFIED",
6057 "content": [
6058 {
6059 "ab": [
6060 "ABCDEFGHI"
6061 ]
6062 },
6063 {
6064 "a": [
6065 "JKLMNOPQR"
6066 ],
6067 "b": [
6068 "JKabcdefgOPQR"
6069 ],
6070 "edit_a": [
6071 [
6072 2,
6073 3
6074 ]
6075 ],
6076 "edit_b": [
6077 [
6078 2,
6079 7
6080 ]
6081 ]
6082 },
6083 {
6084 "ab": [
6085 ""
6086 ]
6087 }
6088 ]
6089 }
6090 }
6091----
6092
6093
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006094[[get-blame]]
6095=== Get Blame
6096--
6097'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
6098--
6099
6100Gets the blame of a file from a certain revision.
6101
6102.Request
6103----
6104 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
6105----
6106
6107As response a link:#blame-info[BlameInfo] entity is returned that describes the
6108blame.
6109
6110.Response
6111----
6112 HTTP/1.1 200 OK
6113 Content-Disposition: attachment
6114 Content-Type: application/json; charset=UTF-8
6115
6116 )]
6117 {
6118 [
6119 {
6120 "author": "Joe Daw",
6121 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
6122 "time": 1421441349,
6123 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
6124 "ranges": [
6125 {
6126 "start": 1,
6127 "end": 10
6128 },
6129 {
6130 "start": 16,
6131 "end": 296
6132 }
6133 ]
6134 },
6135 {
6136 "author": "Jane Daw",
6137 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
6138 "time": 1421825421,
6139 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
6140 "ranges": [
6141 {
6142 "start": 13,
6143 "end": 13
6144 }
6145 ]
6146 }
6147 ]
6148 }
6149----
6150
6151The `base` parameter can be specified to control the base patch set from which
6152the blame should be generated.
6153
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006154[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006155=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08006156--
Edwin Kempinbea55a52013-05-14 13:53:39 +02006157'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 -08006158--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01006159
Edwin Kempinbea55a52013-05-14 13:53:39 +02006160Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006161
6162.Request
6163----
6164 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
6165----
6166
6167.Response
6168----
6169 HTTP/1.1 201 Created
6170----
6171
Edwin Kempinbea55a52013-05-14 13:53:39 +02006172If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006173response is "`200 OK`".
6174
6175[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006176=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08006177--
Edwin Kempinbea55a52013-05-14 13:53:39 +02006178'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 -08006179--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01006180
Edwin Kempinbea55a52013-05-14 13:53:39 +02006181Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006182
6183.Request
6184----
6185 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
6186----
6187
6188.Response
6189----
6190 HTTP/1.1 204 No Content
6191----
6192
Gustaf Lundh019fb262012-11-28 14:20:22 +01006193[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006194=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08006195--
Gustaf Lundh019fb262012-11-28 14:20:22 +01006196'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08006197--
Gustaf Lundh019fb262012-11-28 14:20:22 +01006198
6199Cherry picks a revision to a destination branch.
6200
Changcheng Xiao54b6c0c2017-10-23 14:57:42 +02006201To cherry pick a commit with no change-id associated with it, see
6202link:rest-api-projects.html#cherry-pick-commit[CherryPickCommit].
6203
Gustaf Lundh019fb262012-11-28 14:20:22 +01006204The commit message and destination branch must be provided in the request body inside a
Han-Wen Nienhuys02272e02017-03-28 14:47:09 +02006205link:#cherrypick-input[CherryPickInput] entity. If the commit message
6206does not specify a Change-Id, a new one is picked for the destination change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01006207
Gal Paikin8dadd422021-05-07 10:21:54 +02006208When cherry-picking a change into a branch that already contains the Change-Id
6209that we want to cherry-pick, the cherry-pick will create a new patch-set on the
6210destination's branch's appropriate Change-Id. If the change is closed on the
6211destination branch, the cherry-pick will fail.
6212
Gustaf Lundh019fb262012-11-28 14:20:22 +01006213.Request
6214----
6215 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09006216 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01006217
6218 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01006219 "message" : "Implementing Feature X",
6220 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01006221 }
6222----
6223
Edwin Kempinaab27d32020-01-29 13:17:04 +01006224As response a link:#change-info[ChangeInfo] entity is returned that
6225describes the resulting cherry-pick change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01006226
6227.Response
6228----
6229 HTTP/1.1 200 OK
6230 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09006231 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01006232
6233 )]}'
6234 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01006235 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
6236 "project": "myProject",
6237 "branch": "release-branch",
6238 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
6239 "subject": "Implementing Feature X",
6240 "status": "NEW",
6241 "created": "2013-02-01 09:59:32.126000000",
6242 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01006243 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01006244 "insertions": 12,
6245 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01006246 "_number": 3965,
6247 "owner": {
6248 "name": "John Doe"
6249 }
6250 }
6251----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006252
Changcheng Xiao2fcae692017-01-02 12:38:30 +01006253[[revision-reviewer-endpoints]]
6254== Revision Reviewer Endpoints
6255
6256[[list-revision-reviewers]]
6257=== List Revision Reviewers
6258--
6259'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/'
6260--
6261
6262Lists the reviewers of a revision.
6263
6264Please note that only the current revision is supported.
6265
6266As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
6267
6268.Request
6269----
6270 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0
6271----
6272
6273.Response
6274----
6275 HTTP/1.1 200 OK
6276 Content-Disposition: attachment
6277 Content-Type: application/json; charset=UTF-8
6278
6279 )]}'
6280 [
6281 {
6282 "approvals": {
6283 "Verified": "+1",
6284 "Code-Review": "+2"
6285 },
6286 "_account_id": 1000096,
6287 "name": "John Doe",
6288 "email": "john.doe@example.com"
6289 },
6290 {
6291 "approvals": {
6292 "Verified": " 0",
6293 "Code-Review": "-1"
6294 },
6295 "_account_id": 1000097,
6296 "name": "Jane Roe",
6297 "email": "jane.roe@example.com"
6298 }
6299 ]
6300----
6301
6302[[list-revision-votes]]
6303=== List Revision Votes
6304--
6305'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
6306--
6307
6308Lists the votes for a specific reviewer of the revision.
6309
6310Please note that only the current revision is supported.
6311
6312.Request
6313----
6314 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0
6315----
6316
6317As result a map is returned that maps the label name to the label value.
6318The entries in the map are sorted by label name.
6319
6320.Response
6321----
6322 HTTP/1.1 200 OK
6323 Content-Disposition: attachment
6324 Content-Type: application/json;charset=UTF-8
6325
6326 )]}'
6327 {
6328 "Code-Review": -1,
6329 "Verified": 1,
6330 "Work-In-Progress": 1
6331 }
6332----
6333
6334[[delete-revision-vote]]
6335=== Delete Revision Vote
6336--
6337'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
6338/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' +
6339'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
6340/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete'
6341--
6342
6343Deletes a single vote from a revision. The deletion will be possible only
6344if the revision is the current revision. By using this endpoint you can prevent
6345deleting the vote (with same label) from a newer patch set by mistake.
6346
6347Note, that even when the last vote of a reviewer is removed the reviewer itself
6348is still listed on the change.
6349
Gal Paikin6ce56dc2021-03-29 12:28:43 +02006350If another user removed a user's vote, the user with the deleted vote will be
6351added to the attention set.
6352
Changcheng Xiao2fcae692017-01-02 12:38:30 +01006353.Request
6354----
6355 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
6356 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
6357----
6358
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02006359Options can be provided in the request body as a
6360link:#delete-vote-input[DeleteVoteInput] entity.
6361Historically, this method allowed a body in the DELETE, but that behavior is
Marian Harbach34253372019-12-10 18:01:31 +01006362link:https://www.gerritcodereview.com/releases/2.16.md[deprecated,role=external,window=_blank].
Changcheng Xiao03fc3cc2018-07-23 11:16:53 +02006363In this case, use a POST request instead:
Changcheng Xiao2fcae692017-01-02 12:38:30 +01006364
6365.Request
6366----
6367 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
6368 Content-Type: application/json; charset=UTF-8
6369
6370 {
6371 "notify": "NONE"
6372 }
6373----
6374
6375.Response
6376----
6377 HTTP/1.1 204 No Content
6378----
6379
Gal Paikinc326de42020-06-16 18:49:00 +03006380[[attention-set-endpoints]]
6381== Attention Set Endpoints
6382
6383[[get-attention-set]]
6384=== Get Attention Set
6385--
6386'GET /changes/link:#change-id[\{change-id\}]/attention'
6387--
6388
6389Returns all users that are currently in the attention set.
6390As response a list of link:#attention-set-info[AttentionSetInfo]
6391entity is returned.
6392
6393.Request
6394----
6395 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
6396----
6397
6398.Response
6399----
6400 HTTP/1.1 200 OK
6401 Content-Disposition: attachment
6402 Content-Type: application/json; charset=UTF-8
6403
6404 )]}'
6405 [
6406 {
6407 "account": {
6408 "_account_id": 1000096,
6409 "name": "John Doe",
6410 "email": "john.doe@example.com",
6411 "username": "jdoe"
6412 },
6413 "last_update": "2013-02-01 09:59:32.126000000",
6414 "reason": "reviewer or cc replied"
6415 },
6416 {
6417 "account": {
6418 "_account_id": 1000097,
6419 "name": "Jane Doe",
6420 "email": "jane.doe@example.com",
6421 "username": "janedoe"
6422 },
6423 "last_update": "2013-02-01 09:59:32.126000000",
6424 "reason": "Reviewer was added"
6425 }
6426 ]
6427----
6428
6429[[add-to-attention-set]]
6430=== Add To Attention Set
6431--
6432'POST /changes/link:#change-id[\{change-id\}]/attention'
6433--
6434
6435Adds a single user to the attention set of a change.
6436
6437A user can only be added if they are not in the attention set.
6438If a user is added while already in the attention set, the
6439request is silently ignored.
6440
Gal Paikine631de22020-10-29 12:19:11 +01006441The user must be a reviewer, cc, uploader, or owner on the change.
6442
Gal Paikinc326de42020-06-16 18:49:00 +03006443.Request
6444----
6445 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
6446----
6447
6448Details should be provided in the request body as an
6449link:#attention-set-input[AttentionSetInput] entity.
6450
6451.Request
6452----
6453 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention HTTP/1.0
6454 Content-Type: application/json; charset=UTF-8
6455
6456 {
6457 "user": "John Doe",
6458 "reason": "reason"
6459 }
6460----
6461
6462.Response
6463----
6464 HTTP/1.1 200 OK
6465 Content-Disposition: attachment
6466 Content-Type: application/json; charset=UTF-8
6467
6468 )]}'
6469 {
6470 "_account_id": 1000096,
6471 "name": "John Doe",
6472 "email": "john.doe@example.com",
6473 "username": "jdoe"
6474 }
6475----
6476
6477[[remove-from-attention-set]]
6478=== Remove from Attention Set
6479--
6480'DELETE /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]' +
6481'POST /changes/link:#change-id[\{change-id\}]/attention/link:rest-api-accounts.html#account-id[\{account-id\}]/delete'
6482--
6483
6484Deletes a single user from the attention set of a change.
6485
6486A user can only be removed from the attention set if they
6487are currently in the attention set. Otherwise, the request
6488is silently ignored.
6489
6490.Request
6491----
6492 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe HTTP/1.0
6493 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0
6494----
6495
6496Reason can be provided in the request body as an
6497link:#attention-set-input[AttentionSetInput] entity.
6498
6499User must be left empty, or the user must be exactly
6500the same user as in the request header.
6501
6502.Request
6503----
6504 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/attention/John%20Doe/delete HTTP/1.0
6505 Content-Type: application/json; charset=UTF-8
6506
6507 {
6508 "reason": "reason"
6509 }
6510----
6511
6512.Response
6513----
6514 HTTP/1.1 204 No Content
6515----
6516
6517[[attention-set]]
6518== Attention Set
6519Attention Set is the set of users that should perform some action on the
6520change. E.g, reviewers should review the change, owner/uploader should
6521add a new patchset or respond to comments.
6522
6523Users are added to the attention set if one the following apply:
6524
6525* They are manually added in link:#review-input[ReviewInput] in
6526 add_to_attention_set.
6527* They are added as reviewers.
6528* The change is marked ready for review.
6529* As an owner/uploader, when someone replies on your change.
6530* As a reviewer, when the owner/uploader replies.
Gal Paikin6ce56dc2021-03-29 12:28:43 +02006531* When the user's vote is deleted by another user.
Gal Paikin102f6d82021-04-13 15:21:51 +02006532* The rules above (except manually adding to the attention set) don't apply
6533 for changes that are work in progress.
Gal Paikinc326de42020-06-16 18:49:00 +03006534
6535Users are removed from the attention set if one the following apply:
6536
6537* They are manually removed in link:#review-input[ReviewInput] in
6538 remove_from_attention_set.
6539* They are removed from reviewers.
6540* The change is marked work in progress, abandoned, or submitted.
6541* When the user replies on a change.
6542
6543If the ignore_default_attention_set_rules in link:#review-input[ReviewInput]
6544is set to true, no other changes to the attention set will occur during the
6545link:#set-review[set-review].
6546Also, users specified in the list will occur instead of any of the implicit
6547changes to the attention set. E.g, if a user is added by add_to_attention_set
6548in link:#review-input[ReviewInput], but also the change is marked work in
6549progress, the user will still be added.
6550
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006551[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006552== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006553
Edwin Kempina3d02ef2013-02-22 16:31:53 +01006554[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006555=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01006556--
6557--
6558
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006559[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006560=== \{change-id\}
Patrick Hiesel18da0452017-12-21 14:02:05 +01006561Identifier that uniquely identifies one change. It contains the URL-encoded
6562project name as well as the change number: "'$$<project>~<numericId>$$'"
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006563
David Pursehousea5923972020-02-26 09:39:38 +09006564Gerrit also supports the following identifiers:
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006565
6566* an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'",
6567 where for the branch the `refs/heads/` prefix can be omitted
6568 ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$")
6569* a Change-Id if it uniquely identifies one change
6570 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
Patrick Hiesel4d2dd182017-05-09 17:35:18 +02006571* a numeric change ID ("4247")
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006572
Changcheng Xiaod61590f2018-04-30 10:59:14 +02006573[[change-message-id]]
6574=== \{change-message-id\}
6575ID of a change message returned in a link:#change-message-info[ChangeMessageInfo].
6576
John Spurlock5e402f02013-03-24 11:35:04 -04006577[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006578=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04006579UUID of a published comment.
6580
Edwin Kempin3ca57192013-02-27 07:44:01 +01006581[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006582=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01006583UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01006584
David Ostrovskybeb0b842014-12-13 00:24:29 +01006585[[label-id]]
6586=== \{label-id\}
6587The name of the label.
6588
Edwin Kempinbea55a52013-05-14 13:53:39 +02006589[[file-id]]
David Pursehouseb10c2662016-12-06 08:41:33 +09006590=== \{file-id\}
Edwin Kempinbea55a52013-05-14 13:53:39 +02006591The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01006592
David Pursehouse11badbb2017-03-27 10:58:05 +09006593The following magic paths are supported:
6594
6595* `/COMMIT_MSG`:
6596+
6597The commit message and headers with the parent commit(s), the author
6598information and the committer information.
6599
6600* `/MERGE_LIST` (for merge commits only):
6601+
6602The list of commits that are being integrated into the destination
6603branch by submitting the merge commit.
6604
Gal Paikin3edc1422020-03-19 12:04:52 +01006605* `/PATCHSET_LEVEL`:
6606+
6607This file path is used exclusively for posting and indicating
6608patchset-level comments, thus not relevant for other use-cases.
6609
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006610[[fix-id]]
6611=== \{fix-id\}
6612UUID of a suggested fix.
6613
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006614[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006615=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006616Identifier that uniquely identifies one revision of a change.
6617
6618This can be:
6619
Shawn Pearce9c0722a2013-03-02 15:30:31 -08006620* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006621* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
6622* an abbreviated commit ID that uniquely identifies one revision of the
6623 change ("674ac754"), at least 4 digits are required
Edwin Kempin2582c982022-12-27 15:47:59 +01006624* a numeric patch number ("1" for first patch set of the change)
Edwin Kempin8cc0bab2016-09-15 15:53:37 +02006625* "0" or the literal `edit` for a change edit
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01006626
Edwin Kempine3446292013-02-19 16:40:14 +01006627[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006628== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01006629
Edwin Kempined5364b2013-02-22 10:39:33 +01006630[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006631=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01006632The `AbandonInput` entity contains information for abandoning a change.
6633
David Pursehouseae367192014-11-25 17:24:47 +09006634[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006635|=============================
6636|Field Name ||Description
6637|`message` |optional|
Edwin Kempined5364b2013-02-22 10:39:33 +01006638Message to be added as review comment to the change when abandoning the
6639change.
Edwin Kempincd07df42016-12-01 09:10:09 +01006640|`notify` |optional|
Stephen Lie5fcdf72016-08-02 11:05:11 -07006641Notify handling that defines to whom email notifications should be sent after
6642the change is abandoned. +
6643Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6644If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006645|`notify_details`|optional|
6646Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03006647of link:user-notify.html#recipient-types[recipient type] to
6648link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01006649|=============================
Edwin Kempined5364b2013-02-22 10:39:33 +01006650
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006651[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006652=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006653The `ActionInfo` entity describes a REST API call the client can
6654make to manipulate a resource. These are frequently implemented by
6655plugins and may be discovered at runtime.
6656
David Pursehouseae367192014-11-25 17:24:47 +09006657[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006658|====================================
6659|Field Name ||Description
6660|`method` |optional|
6661HTTP method to use with the action. Most actions use `POST`, `PUT`
6662or `DELETE` to cause state changes.
6663|`label` |optional|
6664Short title to display to a user describing the action. In the
6665Gerrit web interface the label is used as the text on the button
6666presented in the UI.
6667|`title` |optional|
6668Longer text to display describing the action. In a web UI this
6669should be the title attribute of the element, displaying when
6670the user hovers the mouse.
6671|`enabled` |optional|
6672If true the action is permitted at this time and the caller is
6673likely allowed to execute it. This may change if state is updated
6674at the server or permissions are modified. Not present if false.
Edwin Kempinccc9da02023-01-23 17:57:15 +01006675|`enabled_options` |optional|
6676Optional list of enabled options. +
6677See the list of suppported options link:action-options[below].
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006678|====================================
6679
Edwin Kempinccc9da02023-01-23 17:57:15 +01006680[[action-options]]
6681==== Action Options
6682
6683Options that are returned via the `enabled_options` field of
6684link:#action-info[ActionInfo].
6685
6686[options="header",cols="1,^1,5"]
6687|===============================
6688|REST view |Option |Description
6689|`rebase` |`rebase`|
6690Present if the user can rebase the change. +
6691This is the case for the change owner and users with the
6692link:access-control.html#category_submit[Submit] or
6693link:access-control.html#category_rebase[Rebase] permission if they
6694have the link:access-control.html#category_push[Push] permission.
6695|`rebase` |`rebase_on_behalf_of`|
6696Present if the user can rebase the change on behalf of the uploader. +
6697This is the case for the change owner and users with the
6698link:access-control.html#category_submit[Submit] or
6699link:access-control.html#category_rebase[Rebase] permission.
6700|===============================
6701
6702For all other REST views no options are returned.
6703
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03006704[[applypatch-input]]
6705=== ApplyPatchInput
6706The `ApplyPatchInput` entity contains information about a patch to apply.
6707
6708A new commit will be created from the patch, and saved as a new patch set.
6709
6710[options="header",cols="1,^1,5"]
6711|=================================
6712|Field Name ||Description
6713|`patch` |required|
6714The patch to be applied. Must be compatible with `git diff` output.
6715For example, link:#get-patch[Get Patch] output.
Nitzan Gur-Furmancf722f62023-02-15 20:40:33 +01006716The patch must be provided as UTF-8 text, either directly or base64-encoded.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03006717|=================================
6718
6719[[applypatchpatchset-input]]
6720=== ApplyPatchPatchSetInput
6721The `ApplyPatchPatchSetInput` entity contains information for creating a new patch set from a
6722given patch.
6723
6724[options="header",cols="1,^1,5"]
6725|=================================
6726|Field Name ||Description
6727|`patch` |required|
6728The details of the patch to be applied as a link:#applypatch-input[ApplyPatchInput] entity.
6729|`commit_message` |optional|
6730The commit message for the new patch set. If not specified, a predefined message will be used.
6731|`base` |optional|
673240-hex digit SHA-1 of the commit which will be the parent commit of the newly created patch set.
6733If set, it must be a merged commit or a change revision on the destination branch.
6734Otherwise, the target change's branch tip will be used.
6735|`author` |optional|
6736The author of the commit to create. Must be an
6737link:rest-api-accounts.html#account-input[AccountInput] entity with at least
6738the `name` and `email` fields set.
6739The caller needs "Forge Author" permission when using this field, unless specifies their own details.
6740This field does not affect the owner of the change, which will continue to use the identity of the
6741caller.
Patrick Hiesele6759d52023-02-21 15:24:15 +01006742|`response_format_options` |optional|
6743List of link:#query-options[query options] to format the response.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03006744|=================================
6745
6746
Edwin Kempine3446292013-02-19 16:40:14 +01006747[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006748=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006749The `ApprovalInfo` entity contains information about an approval from a
6750user for a label on a change.
6751
Edwin Kempin963dfd02013-02-27 12:39:32 +01006752`ApprovalInfo` has the same fields as
6753link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01006754In addition `ApprovalInfo` has the following fields:
6755
David Pursehouseae367192014-11-25 17:24:47 +09006756[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006757|===========================
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006758|Field Name ||Description
6759|`value` |optional|
Dave Borowitza30db912013-03-22 14:20:33 -07006760The vote that the user has given for the label. If present and zero, the
6761user is permitted to vote on the label. If absent, the user is not
6762permitted to vote on that label.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006763|`permitted_voting_range` |optional|
6764The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote
6765on that label. If present, the user is permitted to vote on the label
6766regarding the range values. If absent, the user is not permitted to vote
6767on that label.
6768|`date` |optional|
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01006769The time and date describing when the approval was made.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006770|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006771Value of the `tag` field from link:#review-input[ReviewInput] set
Vitaliy Lotorevea882812018-06-28 20:16:39 +00006772while posting the review. Votes/comments that contain `tag` with
6773'autogenerated:' prefix can be filtered out in the web UI.
6774NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006775invocations of the REST call are required.
Dave Borowitze47fe472016-09-09 13:57:14 -04006776|`post_submit` |not set if `false`|
6777If true, this vote was made after the change was submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01006778|===========================
6779
Gal Paikinc326de42020-06-16 18:49:00 +03006780[[attention-set-info]]
6781=== AttentionSetInfo
6782The `AttentionSetInfo` entity contains details of users that are in
6783the link:#attention-set[attention set].
6784
6785[options="header",cols="1,^1,5"]
6786|===========================
6787|Field Name ||Description
6788|`account` || link:rest-api-accounts.html#account-info[AccountInfo] entity.
6789|`last_update` || The link:rest-api.html#timestamp[timestamp] of the last update.
Marija Savtchouk25a5fd5a2021-08-06 17:26:24 +01006790|`reason` ||
6791The reason for adding or removing the user.
6792If the update was caused by another user, that account is represented by
6793account ID in reason as `<GERRIT_ACCOUNT_18419>` and the corresponding
6794link:rest-api-accounts.html#account-info[AccountInfo] can be found in `reason_account` field.
6795|`reason_account` ||
6796link:rest-api-accounts.html#account-info[AccountInfo] of the user who caused the update.
Gal Paikinc326de42020-06-16 18:49:00 +03006797
6798|===========================
6799[[attention-set-input]]
6800=== AttentionSetInput
6801The `AttentionSetInput` entity contains details for adding users to the
6802link:#attention-set[attention set] and removing them from it.
6803
6804[options="header",cols="1,^1,5"]
6805|===========================
Gal Paikinf2b1b332020-07-06 16:34:36 +03006806|Field Name ||Description
6807|`user` |optional| link:rest-api-accounts.html#account-id[ID]
Gal Paikinc326de42020-06-16 18:49:00 +03006808of the account that should be added to the attention set. For removals,
6809this field should be empty or the same as the field in the request header.
Gal Paikinf2b1b332020-07-06 16:34:36 +03006810|`reason` || The reason of for adding or removing the user.
6811|`notify` |optional|
6812Notify handling that defines to whom email notifications should be sent
6813after the change is created. +
6814Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6815If not set, the default is `OWNER`.
6816|`notify_details` |optional|
6817Additional information about whom to notify about the change creation
Gal Paikin1ae8b462020-07-27 15:50:59 +03006818as a map of link:user-notify.html#recipient-types[recipient type] to
6819link:#notify-info[NotifyInfo] entity.
Gal Paikinc326de42020-06-16 18:49:00 +03006820|===========================
6821
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006822[[blame-info]]
6823=== BlameInfo
6824The `BlameInfo` entity stores the commit metadata with the row coordinates where
6825it applies.
6826
6827[options="header",cols="1,6"]
6828|===========================
6829|Field Name | Description
6830|`author` | The author of the commit.
6831|`id` | The id of the commit.
6832|`time` | Commit time.
6833|`commit_msg` | The commit message.
6834|`ranges` |
6835The blame row coordinates as link:#range-info[RangeInfo] entities.
6836|===========================
6837
Edwin Kempin521c1242015-01-23 12:44:44 +01006838[[change-edit-input]]
6839=== ChangeEditInput
6840The `ChangeEditInput` entity contains information for restoring a
6841path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02006842
Edwin Kempin521c1242015-01-23 12:44:44 +01006843[options="header",cols="1,^1,5"]
6844|===========================
6845|Field Name ||Description
6846|`restore_path`|optional|Path to file to restore.
6847|`old_path` |optional|Old path to file to rename.
6848|`new_path` |optional|New path to file to rename.
6849|===========================
6850
6851[[change-edit-message-input]]
6852=== ChangeEditMessageInput
6853The `ChangeEditMessageInput` entity contains information for changing
6854the commit message within a change edit.
6855
6856[options="header",cols="1,^1,5"]
6857|===========================
6858|Field Name ||Description
6859|`message` ||New commit message.
6860|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02006861
Edwin Kempine3446292013-02-19 16:40:14 +01006862[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006863=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006864The `ChangeInfo` entity contains information about a change.
6865
David Pursehouseae367192014-11-25 17:24:47 +09006866[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006867|==================================
6868|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01006869|`id` ||
6870The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
John Spurlockd25fad12013-03-09 11:48:49 -05006871where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the
Edwin Kempine3446292013-02-19 16:40:14 +01006872`refs/heads/` prefix is omitted.
6873|`project` ||The name of the project.
6874|`branch` ||
6875The name of the target branch. +
6876The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01006877|`topic` |optional|The topic to which this change belongs.
Gal Paikinc326de42020-06-16 18:49:00 +03006878|`attention_set` |optional|
6879The map that maps link:rest-api-accounts.html#account-id[account IDs]
Gal Paikin69f20462021-11-08 17:26:42 +01006880to link:#attention-set-info[AttentionSetInfo] of that account. Those are all
6881accounts that are currently in the attention set.
6882|`removed_from_attention_set` |optional|
6883The map that maps link:rest-api-accounts.html#account-id[account IDs]
6884to link:#attention-set-info[AttentionSetInfo] of that account. Those are all
6885accounts that were in the attention set but were removed. The
6886link:#attention-set-info[AttentionSetInfo] is the latest and most recent removal
6887 of the account from the attention set.
Edwin Kempin93b74fb2017-08-25 10:42:56 +02006888|`hashtags` |optional|
Gal Paikin07a580c2021-04-15 09:47:36 +02006889List of hashtags that are set on the change.
Edwin Kempine3446292013-02-19 16:40:14 +01006890|`change_id` ||The Change-Id of the change.
6891|`subject` ||
6892The subject of the change (header line of the commit message).
6893|`status` ||
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01006894The status of the change (`NEW`, `MERGED`, `ABANDONED`).
Edwin Kempine3446292013-02-19 16:40:14 +01006895|`created` ||
6896The link:rest-api.html#timestamp[timestamp] of when the change was
6897created.
6898|`updated` ||
6899The link:rest-api.html#timestamp[timestamp] of when the change was last
6900updated.
Khai Do96a7caf2016-01-07 14:07:54 -08006901|`submitted` |only set for merged changes|
6902The link:rest-api.html#timestamp[timestamp] of when the change was
6903submitted.
Dave Borowitz8ec31f92017-08-23 10:28:34 -04006904|`submitter` |only set for merged changes|
6905The user who submitted the change, as an
6906link:rest-api-accounts.html#account-info[ AccountInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01006907|`starred` |not set if `false`|
Edwin Kempin9e972cc2016-04-15 10:39:13 +02006908Whether the calling user has starred this change with the default label.
6909|`stars` |optional|
6910A list of star labels that are applied by the calling user to this
6911change. The labels are lexicographically sorted.
Edwin Kempine3446292013-02-19 16:40:14 +01006912|`reviewed` |not set if `false`|
6913Whether the change was reviewed by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07006914Only set if link:#reviewed[reviewed] is requested.
Dave Borowitzace32102015-12-17 13:08:25 -05006915|`submit_type` |optional|
Changcheng Xiao21885982019-01-15 18:16:51 +01006916The link:config-project-config.html#submit-type[submit type] of the change. +
Dave Borowitzace32102015-12-17 13:08:25 -05006917Not set for merged changes.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01006918|`mergeable` |optional|
6919Whether the change is mergeable. +
Patrick Hiesela4824db2019-12-20 10:55:26 +01006920Only set for open changes if
6921link:config-gerrit.html#change.mergeabilityComputationBehavior[change.mergeabilityComputationBehavior]
6922is `API_REF_UPDATED_AND_CHANGE_REINDEX`.
Shawn Pearce4cd05b22016-09-17 22:45:33 -07006923|`submittable` |optional|
6924Whether the change has been approved by the project submit rules. +
Jonathan Niedercb51d742016-09-23 11:37:57 -07006925Only set if link:#submittable[requested].
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01006926|`insertions` ||
6927Number of inserted lines.
6928|`deletions` ||
6929Number of deleted lines.
Dave Borowitzc001f322018-10-31 14:31:08 -07006930|`total_comment_count` |optional|
6931Total number of inline comments across all patch sets. Not set if the current
6932change index doesn't have the data.
Changcheng Xiao81c48092017-02-08 13:04:07 +01006933|`unresolved_comment_count` |optional|
Dave Borowitzc001f322018-10-31 14:31:08 -07006934Number of unresolved inline comment threads across all patch sets. Not set if
6935the current change index doesn't have the data.
Ben Rohlfsb56e3552021-09-10 09:04:19 +02006936|`_number` ||
6937The numeric ID of the change. (The underscore is just a relict of a prior
6938attempt to deprecate the numeric ID.)
Edwin Kempine3446292013-02-19 16:40:14 +01006939|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01006940The owner of the change as an link:rest-api-accounts.html#account-info[
6941AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07006942|`actions` |optional|
6943Actions the caller might be able to perform on this revision. The
6944information is a map of view name to link:#action-info[ActionInfo]
6945entities.
Youssef Elghareeb02d33aa2021-10-04 13:24:52 +02006946|`submit_records` ||
6947List of the link:rest-api-changes.html#submit-record-info[SubmitRecordInfo]
6948containing the submit records for the change at the latest patchset.
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01006949|`requirements` |optional|
6950List of the link:rest-api-changes.html#requirement[requirements] to be met before this change
Youssef Elghareeb79f473622021-05-26 18:58:40 +02006951can be submitted. This field is deprecated in favour of `submit_requirements`.
6952|`submit_requirements` |optional|
6953List of the link:#submit-requirement-result-info[SubmitRequirementResultInfo]
6954containing the evaluated submit requirements for the change.
6955Only set if link:#submit-requirements[`SUBMIT_REQUIREMENTS`] is requested.
Edwin Kempine3446292013-02-19 16:40:14 +01006956|`labels` |optional|
6957The labels of the change as a map that maps the label names to
6958link:#label-info[LabelInfo] entries. +
6959Only set if link:#labels[labels] or link:#detailed-labels[detailed
6960labels] are requested.
6961|`permitted_labels` |optional|
6962A map of the permitted labels that maps a label name to the list of
6963values that are allowed for that label. +
6964Only set if link:#detailed-labels[detailed labels] are requested.
Nitzan Gur-Furmand1223572023-01-16 12:07:46 +00006965|`removable_labels` |optional|
6966A map of the removable labels that maps a label name to the map of
6967values and reviewers (
6968link:rest-api-accounts.html#account-info[AccountInfo] entities)
6969that are allowed to be removed from the change. +
6970Only set if link:#labels[labels] or
6971link:#detailed-labels[detailed labels] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01006972|`removable_reviewers`|optional|
6973The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01006974link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Patrick Hieselae92ad82020-11-17 11:09:05 +01006975Only set if link:#labels[labels] or
6976link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07006977|`reviewers` |optional|
Edwin Kempin66af3d82015-11-10 17:38:40 -08006978The reviewers as a map that maps a reviewer state to a list of
6979link:rest-api-accounts.html#account-info[AccountInfo] entities.
6980Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
6981`REVIEWER`: Users with at least one non-zero vote on the change. +
6982`CC`: Users that were added to the change, but have not voted. +
6983`REMOVED`: Users that were previously reviewers on the change, but have
6984been removed. +
Patrick Hieselae92ad82020-11-17 11:09:05 +01006985Only set if link:#labels[labels] or
6986link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07006987|`pending_reviewers` |optional|
6988Updates to `reviewers` that have been made while the change was in the
6989WIP state. Only present on WIP changes and only if there are pending
6990reviewer updates to report. These are reviewers who have not yet been
6991notified about being added to or removed from the change. +
Patrick Hieselae92ad82020-11-17 11:09:05 +01006992Only set if link:#labels[labels] or
6993link:#detailed-labels[detailed labels] are requested.
Viktar Donich316bf7a2016-07-06 11:29:01 -07006994|`reviewer_updates`|optional|
6995Updates to reviewers set for the change as
6996link:#review-update-info[ReviewerUpdateInfo] entities.
Han-Wen Nienhuys3c670be2020-06-30 19:17:07 +02006997Only set if link:#reviewer-updates[reviewer updates] are requested.
John Spurlock74a70cc2013-03-23 16:41:50 -04006998|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07006999Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04007000link:#change-message-info[ChangeMessageInfo] entities. +
7001Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007002|`current_revision` |optional|
7003The commit ID of the current patch set of this change. +
7004Only set if link:#current-revision[the current revision] is requested
7005or if link:#all-revisions[all revisions] are requested.
7006|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05007007All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01007008patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08007009Only set if link:#current-revision[the current revision] is requested
7010(in which case it will only contain a key for the current revision) or
7011if link:#all-revisions[all revisions] are requested.
Han-Wen Nienhuys4ec526a2021-02-16 19:20:26 +01007012|`meta_rev_id` |optional|
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02007013The SHA-1 of the NoteDb meta ref.
Makson Lee3568a932017-08-28 17:12:03 +08007014|`tracking_ids` |optional|
7015A list of link:#tracking-id-info[TrackingIdInfo] entities describing
7016references to external tracking systems. Only set if
7017link:#tracking-ids[tracking ids] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007018|`_more_changes` |optional, not set if `false`|
7019Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08007020Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05007021|`problems` |optional|
7022A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08007023problems with this change. Only set if link:#check[CHECK] is set.
David Ostrovskycb19cec2017-04-28 11:55:45 +02007024|`is_private` |optional, not set if `false`|
7025When present, change is marked as private.
David Ostrovsky258849b2017-03-09 23:21:03 +01007026|`work_in_progress` |optional, not set if `false`|
7027When present, change is marked as Work In Progress.
Logan Hanks724b24c2017-07-14 10:01:05 -07007028|`has_review_started` |optional, not set if `false`|
Logan Hanks296cd892017-05-03 15:14:41 -07007029When present, change has been marked Ready at some point in time.
Patrick Hiesel828f3222017-07-13 14:18:38 +02007030|`revert_of` |optional|
7031The numeric Change-Id of the change that this change reverts.
Gal Paikinf57225a2019-11-13 12:39:12 -08007032|`submission_id` |optional|
7033ID of the submission of this change. Only set if the status is `MERGED`.
Gal Paikindd31db92019-12-06 14:43:35 +01007034This ID is equal to the numeric ID of the change that triggered the submission.
7035If the change that triggered the submission also has a topic, it will be
7036"<id>-<topic>" of the change that triggered the submission.
7037The callers must not rely on the format of the submission ID.
Edwin Kempinaab27d32020-01-29 13:17:04 +01007038|`cherry_pick_of_change` |optional|
Kaushik Lingarkar73bcb412020-01-29 13:00:46 -08007039The numeric Change-Id of the change that this change was cherry-picked from.
Edwin Kempin4529d642021-02-01 13:03:08 +01007040Only set if the cherry-pick has been done through the Gerrit REST API (and
7041not if a cherry-picked commit was pushed).
Edwin Kempinaab27d32020-01-29 13:17:04 +01007042|`cherry_pick_of_patch_set`|optional|
Kaushik Lingarkar73bcb412020-01-29 13:00:46 -08007043The patchset number of the change that this change was cherry-picked from.
Edwin Kempin4529d642021-02-01 13:03:08 +01007044Only set if the cherry-pick has been done through the Gerrit REST API (and
7045not if a cherry-picked commit was pushed).
Edwin Kempinaab27d32020-01-29 13:17:04 +01007046|`contains_git_conflicts` |optional, not set if `false`|
7047Whether the change contains conflicts. +
7048If `true`, some of the file contents of the change contain git conflict
7049markers to indicate the conflicts. +
7050Only set if this change info is returned in response to a request that
7051creates a new change or patch set and conflicts are allowed. In
7052particular this field is only populated if the change info is returned
7053by one of the following REST endpoints: link:#create-change[Create
7054Change], link:#create-merge-patch-set-for-change[Create Merge Patch Set
7055For Change], link:#cherry-pick[Cherry Pick Revision],
Edwin Kempin269a9502022-05-11 12:28:22 +02007056link:rest-api-project.html#cherry-pick-commit[Cherry Pick Commit],
7057link:#rebase-change[Rebase Change]
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08007058|==================================
7059
7060[[change-input]]
7061=== ChangeInput
7062The `ChangeInput` entity contains information about creating a new change.
7063
7064[options="header",cols="1,^1,5"]
7065|==================================
7066|Field Name ||Description
7067|`project` ||The name of the project.
7068|`branch` ||
7069The name of the target branch. +
7070The `refs/heads/` prefix is omitted.
7071|`subject` ||
Edwin Kempinba8388c2020-03-06 08:46:59 +01007072The commit message of the change. Comment lines (beginning with `#`)
7073will be removed. If the commit message contains a Change-Id (as a
7074"Change-Id: I..." footer) that Change-Id will be used for the newly
7075created changed. If a change with this Change-Id already exists for
7076same repository and branch, the request is rejected since Change-Ids
7077must be unique per repository and branch. If the commit message doesn't
7078contain a Change-Id, a newly generated Change-Id is automatically
7079inserted into the commit message.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08007080|`topic` |optional|The topic to which this change belongs.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02007081Topic can't contain quotation marks.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08007082|`status` |optional, default to `NEW`|
David Ostrovsky4b44bdc2017-07-27 08:05:43 +02007083The status of the change (only `NEW` accepted here).
Edwin Kempin14d50ed2017-05-03 13:26:30 +02007084|`is_private` |optional, default to `false`|
7085Whether the new change should be marked as private.
7086|`work_in_progress` |optional, default to `false`|
7087Whether the new change should be set to work in progress.
David Ostrovsky9d8ec422014-12-24 00:52:09 +01007088|`base_change` |optional|
7089A link:#change-id[\{change-id\}] that identifies the base change for a create
Nitzan Gur-Furman6799a832023-01-13 12:20:25 +01007090change operation. +
7091Mutually exclusive with `base_commit`. +
7092If neither `base_commit` nor `base_change` are set, the target branch tip will
7093be used as the parent commit.
Aaron Gablee8e73282018-04-26 11:09:30 -07007094|`base_commit` |optional|
7095A 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 +01007096created change. If set, it must be a merged commit on the destination branch. +
7097Mutually exclusive with `base_change`. +
7098If neither `base_commit` nor `base_change` are set, the target branch tip will
7099be used as the parent commit.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08007100|`new_branch` |optional, default to `false`|
Edwin Kempine94bb872019-10-08 13:47:41 +02007101Allow creating a new branch when set to `true`. Using this option is
7102only possible for non-merge commits (if the `merge` field is not set).
Edwin Kempined8a6bf2021-06-15 14:00:31 +02007103|`validation_options` |optional|
7104Map with key-value pairs that are forwarded as options to the commit validation
7105listeners (e.g. can be used to skip certain validations). Which validation
7106options are supported depends on the installed commit validation listeners.
7107Gerrit core doesn't support any validation options, but commit validation
7108listeners that are implemented in plugins may. Please refer to the
7109documentation of the installed plugins to learn whether they support validation
7110options. Unknown validation options are silently ignored.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007111|`merge` |optional|
7112The detail of a merge commit as a link:#merge-input[MergeInput] entity.
Edwin Kempine94bb872019-10-08 13:47:41 +02007113If set, the target branch (see `branch` field) must exist (it is not
7114possible to create it automatically by setting the `new_branch` field
7115to `true`.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03007116|`patch` |optional|
7117The detail of a patch to be applied as an link:#applypatch-input[ApplyPatchInput] entity.
Han-Wen Nienhuys2a1029e2020-01-30 18:52:45 +01007118|`author` |optional|
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03007119The author of the commit to create. Must be an
7120link:rest-api-accounts.html#account-input[AccountInput] entity with at least
7121the `name` and `email` fields set.
Han-Wen Nienhuys2a1029e2020-01-30 18:52:45 +01007122The caller needs "Forge Author" permission when using this field.
7123This field does not affect the owner of the change, which will
7124continue to use the identity of the caller.
Edwin Kempin5f8c3832017-01-13 11:45:06 +01007125|`notify` |optional|
7126Notify handling that defines to whom email notifications should be sent
7127after the change is created. +
7128Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7129If not set, the default is `ALL`.
7130|`notify_details` |optional|
7131Additional information about whom to notify about the change creation
Gal Paikin1ae8b462020-07-27 15:50:59 +03007132as a map of link:user-notify.html#recipient-types[recipient type] to
7133link:#notify-info[NotifyInfo] entity.
Patrick Hiesele6759d52023-02-21 15:24:15 +01007134|`response_format_options` |optional|
7135List of link:#query-options[query options] to format the response.
Edwin Kempine3446292013-02-19 16:40:14 +01007136|==================================
7137
John Spurlock74a70cc2013-03-23 16:41:50 -04007138[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007139=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04007140The `ChangeMessageInfo` entity contains information about a message
7141attached to a change.
7142
David Pursehouseae367192014-11-25 17:24:47 +09007143[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04007144|==================================
7145|Field Name ||Description
7146|`id` ||The ID of the message.
7147|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07007148Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04007149link:rest-api-accounts.html#account-info[AccountInfo] entity. +
7150Unset if written by the Gerrit system.
Patrick Hiesel9221ef12017-03-23 16:44:36 +01007151|`real_author` |optional|
7152Real author of the message as an
7153link:rest-api-accounts.html#account-info[AccountInfo] entity. +
Edwin Kempine03de5f2023-01-31 14:54:51 +01007154Only set if the message was posted on behalf of another user.
John Spurlock74a70cc2013-03-23 16:41:50 -04007155|`date` ||
7156The link:rest-api.html#timestamp[timestamp] this message was posted.
Marija Savtchouke40dc1a2021-04-07 09:56:12 +01007157|`message` ||
7158The text left by the user or Gerrit system. Accounts are served as account IDs
7159inlined in the text as `<GERRIT_ACCOUNT_18419>`.
7160All accounts, used in message, can be found in `accountsInMessage`
7161field.
7162|`accountsInMessage` ||Accounts, used in `message`.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007163|`tag` |optional|
7164Value of the `tag` field from link:#review-input[ReviewInput] set
Vitaliy Lotorevea882812018-06-28 20:16:39 +00007165while posting the review. Votes/comments that contain `tag` with
7166'autogenerated:' prefix can be filtered out in the web UI.
7167NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007168invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04007169|`_revision_number` |optional|
7170Which patchset (if any) generated this message.
7171|==================================
7172
Gustaf Lundh019fb262012-11-28 14:20:22 +01007173[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007174=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01007175The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
7176
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02007177[options="header",cols="1,^1,5"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01007178|===========================
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007179|Field Name ||Description
7180|`message` |optional|
Edwin Kempin159804b2019-09-23 11:09:39 +02007181Commit message for the cherry-pick change. If not set, the commit message of
7182the cherry-picked commit is used.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007183|`destination` ||Destination branch
7184|`base` |optional|
Changcheng Xiaoe3332582017-05-26 15:29:41 +0200718540-hex digit SHA-1 of the commit which will be the parent commit of the newly created change.
7186If set, it must be a merged commit or a change revision on the destination branch.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007187|`parent` |optional, defaults to 1|
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02007188Number of the parent relative to which the cherry-pick should be considered.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007189|`notify` |optional|
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02007190Notify handling that defines to whom email notifications should be sent
7191after the cherry-pick. +
7192Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Saša Živkov357e2bd2020-06-12 12:06:07 +02007193If not set, the default is `ALL`.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007194|`notify_details` |optional|
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02007195Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007196of link:user-notify.html#recipient-types[recipient type] to
7197link:#notify-info[NotifyInfo] entity.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007198|`keep_reviewers` |optional, defaults to false|
Edwin Kempin5ac370d2018-10-05 13:39:34 +02007199If `true`, carries reviewers and ccs over from original change to newly created one.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007200|`allow_conflicts` |optional, defaults to false|
Edwin Kempin5ac370d2018-10-05 13:39:34 +02007201If `true`, the cherry-pick uses content merge and succeeds also if
7202there are conflicts. If there are conflicts the file contents of the
7203created change contain git conflict markers to indicate the conflicts.
7204Callers can find out if there were conflicts by checking the
Edwin Kempinaab27d32020-01-29 13:17:04 +01007205`contains_git_conflicts` field in the link:#change-info[ChangeInfo]. If
7206there are conflicts the cherry-pick change is marked as
Edwin Kempin3c4113a2018-10-12 10:49:33 +02007207work-in-progress.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007208|`topic` |optional|
Gal Paikinf3abd3c2020-03-24 16:39:20 +01007209The topic of the created cherry-picked change. If not set, the default depends
7210on the source. If the source is a change with a topic, the resulting topic
7211of the cherry-picked change will be {source_change_topic}-{destination_branch}.
7212Otherwise, if the source change has no topic, or the source is a commit,
7213the created change will have no topic.
Gal Paikin1f83c202020-03-31 16:23:41 +02007214If the change already exists, the topic will not change if not set. If set, the
7215topic will be overridden.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007216|`allow_empty` |optional, defaults to false|
Gal Paikin626abe02020-04-07 12:21:26 +02007217If `true`, the cherry-pick succeeds also if the created commit will be empty.
7218If `false`, a cherry-pick that would create an empty commit fails without creating
7219the commit.
Edwin Kempinbd2d7ab2022-02-10 07:54:11 +01007220|`validation_options`|optional|
7221Map with key-value pairs that are forwarded as options to the commit validation
7222listeners (e.g. can be used to skip certain validations). Which validation
7223options are supported depends on the installed commit validation listeners.
7224Gerrit core doesn't support any validation options, but commit validation
7225listeners that are implemented in plugins may. Please refer to the
7226documentation of the installed plugins to learn whether they support validation
7227options. Unknown validation options are silently ignored.
Gustaf Lundh019fb262012-11-28 14:20:22 +01007228|===========================
7229
Edwin Kempincb6724a2013-02-26 16:58:51 +01007230[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007231=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05007232The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01007233
David Pursehouseae367192014-11-25 17:24:47 +09007234[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01007235|===========================
7236|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07007237|`patch_set` |optional|
7238The patch set number for the comment; only set in contexts where +
7239comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04007240|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01007241|`path` |optional|
Gal Paikin3edc1422020-03-19 12:04:52 +01007242link:#file-id[The file path] for which the inline comment was done. +
Edwin Kempincb6724a2013-02-26 16:58:51 +01007243Not set if returned in a map where the key is the file path.
7244|`side` |optional|
7245The side on which the comment was added. +
7246Allowed values are `REVISION` and `PARENT`. +
7247If not set, the default is `REVISION`.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01007248|`parent` |optional|
7249The 1-based parent number. Used only for merge commits when `side == PARENT`.
7250When not set the comment is for the auto-merge tree.
Edwin Kempincb6724a2013-02-26 16:58:51 +01007251|`line` |optional|
7252The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04007253If range is set, this equals the end line of the range. +
7254If neither line nor range is set, it's a file comment.
7255|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09007256The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04007257entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01007258|`in_reply_to` |optional|
7259The URL encoded UUID of the comment to which this comment is a reply.
7260|`message` |optional|The comment message.
7261|`updated` ||
7262The link:rest-api.html#timestamp[timestamp] of when this comment was
7263written.
John Spurlock5e402f02013-03-24 11:35:04 -04007264|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09007265The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04007266link:rest-api-accounts.html#account-info[AccountInfo] entity. +
7267Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007268|`tag` |optional|
7269Value of the `tag` field from link:#review-input[ReviewInput] set
7270while posting the review.
Sven Selberg1a6728d2018-09-28 12:30:12 +02007271NOTE: To apply different tags on different votes/comments multiple
Dariusz Lukszac70e8622016-03-15 14:05:51 +01007272invocations of the REST call are required.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08007273|`unresolved` |optional|
7274Whether or not the comment must be addressed by the user. The state of
7275resolution of a comment thread is stored in the last comment in that thread
7276chronologically.
Youssef Elghareeb7fdfa442020-02-03 12:00:52 +01007277|`change_message_id` |optional|
Youssef Elghareeb5bd4e4e2020-08-13 17:09:42 +02007278Available with the link:#list-change-comments[list change comments] endpoint.
7279Contains the link:rest-api-changes.html#change-message-info[id] of the change
7280message that this comment is linked to.
Youssef Elghareebb5e42082020-07-09 15:24:01 +02007281|`commit_id` |optional|
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02007282Hex commit SHA-1 (40 characters string) of the commit of the patchset to which
Youssef Elghareebb5e42082020-07-09 15:24:01 +02007283this comment applies.
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02007284|`context_lines` |optional|
7285A list of link:#context-line[ContextLine] containing the lines of the source
Youssef Elghareeb68e87b62021-01-11 13:20:03 +01007286file where the comment was written. Available only if the "enable-context"
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02007287parameter (see link:#list-change-comments[List Change Comments]) is set.
Youssef Elghareeb27d62012021-02-23 18:21:46 +01007288|`source_content_type` |optional|
7289Mime type of the file where the comment is written. Available only if the
7290"enable-context" parameter (see link:#list-change-comments[List Change Comments])
7291is set.
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02007292
Edwin Kempincb6724a2013-02-26 16:58:51 +01007293|===========================
7294
Edwin Kempin67498de2013-02-25 16:15:34 +01007295[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007296=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03007297The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01007298comment.
7299
David Pursehouseae367192014-11-25 17:24:47 +09007300[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01007301|===========================
7302|Field Name ||Description
7303|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01007304The URL encoded UUID of the comment if an existing draft comment should
7305be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01007306|`path` |optional|
Gal Paikin3edc1422020-03-19 12:04:52 +01007307link:#file-id[The file path] for which the inline comment should be added. +
Edwin Kempin7faf41e2013-02-27 08:17:02 +01007308Doesn't need to be set if contained in a map where the key is the file
7309path.
Edwin Kempin67498de2013-02-25 16:15:34 +01007310|`side` |optional|
7311The side on which the comment should be added. +
7312Allowed values are `REVISION` and `PARENT`. +
7313If not set, the default is `REVISION`.
7314|`line` |optional|
7315The number of the line for which the comment should be added. +
7316`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04007317If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09007318If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04007319|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09007320The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04007321entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01007322|`in_reply_to` |optional|
7323The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01007324|`updated` |optional|
7325The link:rest-api.html#timestamp[timestamp] of this comment. +
7326Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01007327|`message` |optional|
7328The comment message. +
7329If not set and an existing draft comment is updated, the existing draft
7330comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04007331|`tag` |optional, drafts only|
7332Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
7333inputs; for published comments, use the `tag` field in +
Gal Paikinb2b81f22020-02-26 13:14:08 +01007334link:#review-input[ReviewInput]. Votes/comments that contain `tag` with
Vitaliy Lotorevea882812018-06-28 20:16:39 +00007335'autogenerated:' prefix can be filtered out in the web UI.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08007336|`unresolved` |optional|
7337Whether or not the comment must be addressed by the user. This value will
7338default to false if the comment is an orphan, or the value of the `in_reply_to`
7339comment if it is supplied.
Edwin Kempin67498de2013-02-25 16:15:34 +01007340|===========================
7341
Michael Zhou596c7682013-08-25 05:43:34 -04007342[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007343=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04007344The `CommentRange` entity describes the range of an inline comment.
7345
Quinten Yearsley31786712018-07-16 13:44:33 -07007346The comment range is a range from the start position, specified by `start_line`
7347and `start_character`, to the end position, specified by `end_line` and
7348`end_character`. The start position is *inclusive* and the end position is
7349*exclusive*.
7350
7351So, a range over part of a line will have `start_line` equal to
7352`end_line`; however a range with `end_line` set to 5 and `end_character` equal
7353to 0 will not include any characters on line 5,
7354
David Pursehouseae367192014-11-25 17:24:47 +09007355[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04007356|===========================
Quinten Yearsley31786712018-07-16 13:44:33 -07007357|Field Name ||Description
7358|`start_line` ||The start line number of the range. (1-based)
7359|`start_character` ||The character position in the start line. (0-based)
7360|`end_line` ||The end line number of the range. (1-based)
7361|`end_character` ||The character position in the end line. (0-based)
Michael Zhou596c7682013-08-25 05:43:34 -04007362|===========================
7363
Youssef Elghareeb5c4fffb2020-07-10 19:14:57 +02007364[[context-line]]
7365=== ContextLine
7366The `ContextLine` entity contains the line number and line text of a single
7367line of the source file content.
7368
7369[options="header",cols="1,6"]
7370|===========================
7371|Field Name |Description
7372|`line_number` |The line number of the source line.
7373|`context_line` |String containing the line text.
7374|===========================
7375
Edwin Kempine3446292013-02-19 16:40:14 +01007376[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007377=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007378The `CommitInfo` entity contains information about a commit.
7379
Edwin Kempinf0c57152015-07-15 18:18:24 +02007380[options="header",cols="1,^1,5"]
7381|===========================
7382|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02007383|`commit` |Optional|
7384The commit ID. Not set if included in a link:#revision-info[
7385RevisionInfo] entity that is contained in a map which has the commit ID
7386as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007387|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01007388The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02007389link:#commit-info[CommitInfo] entities. In each parent
7390only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007391|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01007392link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007393|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01007394link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007395|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01007396The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02007397|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01007398|`web_links` |optional|
Frank Bordendf69edb2021-05-05 17:00:15 +02007399Links to the patch set in external sites as a list of
7400link:#web-link-info[WebLinkInfo] entities.
7401|`resolve_conflicts_web_links` |optional|
7402Links to the commit in external sites for resolving conflicts as a list of
Sven Selbergd26bd542014-11-21 16:28:10 +01007403link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02007404|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01007405
Patrick Hieselfda96452017-06-14 16:44:54 +02007406[[commit-message-input]]
7407=== CommitMessageInput
7408The `CommitMessageInput` entity contains information for changing
7409the commit message of a change.
7410
7411[options="header",cols="1,^1,5"]
7412|=============================
7413|Field Name ||Description
7414|`message` ||New commit message.
7415|`notify` |optional|
7416Notify handling that defines to whom email notifications should be sent
7417after the commit message was updated. +
7418Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Logan Hanksa1e68dc2017-06-29 15:13:27 -07007419If not set, the default is `OWNER` for WIP changes and `ALL` otherwise.
Patrick Hieselfda96452017-06-14 16:44:54 +02007420|`notify_details`|optional|
7421Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007422of link:user-notify.html#recipient-types[recipient type] to
7423link:#notify-info[NotifyInfo] entity.
Patrick Hieselfda96452017-06-14 16:44:54 +02007424|=============================
7425
Changcheng Xiao6d4ee642018-04-25 11:43:19 +02007426[[delete-change-message-input]]
7427=== DeleteChangeMessageInput
7428The `DeleteChangeMessageInput` entity contains the options for deleting a change message.
7429
7430[options="header",cols="1,^1,5"]
7431|=============================
7432|Field Name ||Description
7433|`reason` |optional|
7434The reason why the change message should be deleted. +
7435If set, the change message will be replaced with
7436"Change message removed by: `name`\nReason: `reason`",
7437or just "Change message removed by: `name`." if not set.
7438|=============================
7439
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01007440[[delete-comment-input]]
7441=== DeleteCommentInput
7442The `DeleteCommentInput` entity contains the option for deleting a comment.
7443
7444[options="header",cols="1,^1,5"]
7445|=============================
7446|Field Name ||Description
7447|`reason` |optional|
7448The reason why the comment should be deleted. +
7449If set, the comment's message will be replaced with
7450"Comment removed by: `name`; Reason: `reason`",
7451or just "Comment removed by: `name`." if not set.
7452|=============================
7453
Edwin Kempin407fca32016-08-29 12:01:00 +02007454[[delete-reviewer-input]]
7455=== DeleteReviewerInput
7456The `DeleteReviewerInput` entity contains options for the deletion of a
7457reviewer.
7458
7459[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007460|=============================
7461|Field Name ||Description
7462|`notify` |optional|
Edwin Kempin407fca32016-08-29 12:01:00 +02007463Notify handling that defines to whom email notifications should be sent
7464after the reviewer is deleted. +
7465Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7466If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007467|`notify_details`|optional|
7468Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007469of link:user-notify.html#recipient-types[recipient type] to
7470link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01007471|=============================
Edwin Kempin407fca32016-08-29 12:01:00 +02007472
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007473[[delete-vote-input]]
7474=== DeleteVoteInput
7475The `DeleteVoteInput` entity contains options for the deletion of a
7476vote.
7477
7478[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01007479|=============================
7480|Field Name ||Description
7481|`label` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007482The label for which the vote should be deleted. +
7483If set, must match the label in the URL.
Edwin Kempincd07df42016-12-01 09:10:09 +01007484|`notify` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007485Notify handling that defines to whom email notifications should be sent
7486after the vote is deleted. +
7487Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
7488If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01007489|`notify_details`|optional|
7490Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007491of link:user-notify.html#recipient-types[recipient type] to
7492link:#notify-info[NotifyInfo] entity.
Gal Paikinbd7575d2021-11-11 14:42:53 +01007493|`ignore_automatic_attention_set_rules`|optional|
7494If set to true, ignore all automatic attention set rules described in the
7495link:#attention-set[attention set]. When not set, the default is false.
Patrick Hiesel8c5568a2022-05-31 08:33:52 +02007496|`reason` |optional|
7497The reason why this vote is deleted. Will +
7498go into the change message.
Edwin Kempincd07df42016-12-01 09:10:09 +01007499|=============================
Edwin Kempin1dfecb62016-06-16 10:45:00 +02007500
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08007501[[description-input]]
7502=== DescriptionInput
7503The `DescriptionInput` entity contains information for setting a description.
7504
7505[options="header",cols="1,6"]
7506|===========================
7507|Field Name |Description
7508|`description` |The description text.
7509|===========================
7510
David Pursehouse882aef22013-06-05 10:56:37 +09007511[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007512=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09007513The `DiffContent` entity contains information about the content differences
7514in a file.
7515
David Pursehouseae367192014-11-25 17:24:47 +09007516[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09007517|==========================
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007518|Field Name ||Description
7519|`a` |optional|Content only in the file on side A (deleted in B).
7520|`b` |optional|Content only in the file on side B (added in B).
7521|`ab` |optional|Content in the file on both sides (unchanged).
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007522|`edit_a` |only present when the `intraline` parameter is set and the
7523DiffContent is a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09007524Text sections deleted from side A as a
7525link:#diff-intraline-info[DiffIntralineInfo] entity.
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007526|`edit_b` |only present when the `intraline` parameter is set and the
7527DiffContent is a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09007528Text sections inserted in side B as a
7529link:#diff-intraline-info[DiffIntralineInfo] entity.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007530|`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a
7531rebase.
Renan Oliveirac5077aa2020-09-25 18:11:54 +02007532|`due_to_move`|not set if `false`|Indicates whether this entry was introduced by a
7533move operation.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007534|`skip` |optional|count of lines skipped on both sides when the file is
David Pursehouse882aef22013-06-05 10:56:37 +09007535too large to include all common lines.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02007536|`common` |optional|Set to `true` if the region is common according
Shawn Pearce425a2be2014-01-02 16:00:58 -08007537to the requested ignore-whitespace parameter, but a and b contain
7538differing amounts of whitespace. When present and true a and b are
7539used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09007540|==========================
7541
7542[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007543=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09007544The `DiffFileMetaInfo` entity contains meta information about a file diff.
7545
David Pursehouseae367192014-11-25 17:24:47 +09007546[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09007547|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02007548|Field Name ||Description
7549|`name` ||The name of the file.
Youssef Elghareeb20a91dd2022-02-03 13:46:44 +01007550|`content_type`||The content type of the file. For the commit message and merge
7551list the value is `text/x-gerrit-commit-message` and `text/x-gerrit-merge-list`
7552respectively. For git links the value is `x-git/gitlink`. For symlinks the value
7553is `x-git/symlink`. For regular files the value is the file mime type (e.g.
7554`text/x-java`, `text/x-c++src`, etc...).
Sven Selberge7f3f0a2014-10-21 11:04:42 +02007555|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01007556|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02007557Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07007558link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09007559|==========================
7560
7561[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007562=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09007563The `DiffInfo` entity contains information about the diff of a file
7564in a revision.
7565
Edwin Kempin8cdce502014-12-06 10:55:38 +01007566If the link:#weblinks-only[weblinks-only] parameter is specified, only
7567the `web_links` field is set.
7568
David Pursehouseae367192014-11-25 17:24:47 +09007569[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09007570|==========================
7571|Field Name ||Description
7572|`meta_a` |not present when the file is added|
7573Meta information about the file on side A as a
7574link:#diff-file-meta-info[DiffFileMetaInfo] entity.
7575|`meta_b` |not present when the file is deleted|
7576Meta information about the file on side B as a
7577link:#diff-file-meta-info[DiffFileMetaInfo] entity.
7578|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
7579`COPIED`, `REWRITE`).
7580|`intraline_status`|only set when the `intraline` parameter was specified in the request|
7581Intraline status (`OK`, `ERROR`, `TIMEOUT`).
7582|`diff_header` ||A list of strings representing the patch set diff header.
7583|`content` ||The content differences in the file as a list of
7584link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01007585|`web_links` |optional|
7586Links to the file diff in external sites as a list of
7587link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
Frank Borden19524922021-05-04 11:40:44 +02007588|`edit_web_links` |optional|
7589Links to edit the file in external sites as a list of
7590link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01007591|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09007592|==========================
7593
7594[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007595=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09007596The `DiffIntralineInfo` entity contains information about intraline edits in a
7597file.
7598
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007599The information consists of a list of `<skip length, edit length>` pairs, where
David Pursehouse31203f52013-06-08 17:05:45 +09007600the skip length is the number of characters between the end of the previous edit
Ole Rehmsen2374b6b2019-07-02 16:06:22 +02007601and the start of this edit, and the edit length is the number of edited characters
David Pursehouse31203f52013-06-08 17:05:45 +09007602following the skip. The start of the edits is from the beginning of the related
Tao Zhou42430482019-09-13 11:26:01 +02007603diff content lines. If the list is empty, the entire DiffContent should be considered
7604as unedited.
David Pursehouse882aef22013-06-05 10:56:37 +09007605
David Pursehouse31203f52013-06-08 17:05:45 +09007606Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07007607the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09007608
Edwin Kempin8cdce502014-12-06 10:55:38 +01007609[[diff-web-link-info]]
7610=== DiffWebLinkInfo
7611The `DiffWebLinkInfo` entity describes a link on a diff screen to an
7612external site.
7613
7614[options="header",cols="1,6"]
7615|=======================
7616|Field Name|Description
7617|`name` |The link name.
7618|`url` |The link URL.
7619|`image_url`|URL to the icon of the link.
7620|show_on_side_by_side_diff_view|
7621Whether the web link should be shown on the side-by-side diff screen.
7622|show_on_unified_diff_view|
7623Whether the web link should be shown on the unified diff screen.
7624|=======================
7625
Sharad Bagribdb582d2022-03-26 01:32:35 -07007626[[apply-provided-fix-input]]
7627=== ApplyProvidedFixInput
7628The `ApplyProvidedFixInput` entity contains the fixes to be applied on a review.
7629
7630[options="header",cols="1,6"]
7631|=======================
7632|Field Name |Description
7633|`fix_replacement_infos` |A list of <<fix-replacement-info,FixReplacementInfo>>.
7634|=======================
7635
David Ostrovsky9ea9c112015-01-25 00:12:38 +01007636[[edit-file-info]]
7637=== EditFileInfo
7638The `EditFileInfo` entity contains additional information
7639of a file within a change edit.
7640
7641[options="header",cols="1,^1,5"]
7642|===========================
7643|Field Name ||Description
7644|`web_links` |optional|
7645Links to the diff info in external sites as a list of
7646link:#web-link-info[WebLinkInfo] entities.
7647|===========================
7648
Edwin Kempin521c1242015-01-23 12:44:44 +01007649[[edit-info]]
7650=== EditInfo
7651The `EditInfo` entity contains information about a change edit.
7652
7653[options="header",cols="1,^1,5"]
7654|===========================
David Pursehouse5934d3f2019-01-07 15:23:49 +09007655|Field Name ||Description
7656|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01007657link:#commit-info[CommitInfo] entity.
David Pursehouse5934d3f2019-01-07 15:23:49 +09007658|`base_patch_set_number`||The patch set number of the patch set the change edit is based on.
7659|`base_revision` ||The revision of the patch set the change edit is based on.
David Pursehouse1bb55ff2019-01-07 15:28:22 +09007660|`ref` ||The ref of the change edit.
David Pursehouse5934d3f2019-01-07 15:23:49 +09007661|`fetch` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01007662Information about how to fetch this patch set. The fetch information is
7663provided as a map that maps the protocol name ("`git`", "`http`",
7664"`ssh`") to link:#fetch-info[FetchInfo] entities.
David Pursehouse5934d3f2019-01-07 15:23:49 +09007665|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01007666The files of the change edit as a map that maps the file names to
7667link:#file-info[FileInfo] entities.
7668|===========================
7669
Edwin Kempine3446292013-02-19 16:40:14 +01007670[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007671=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007672The `FetchInfo` entity contains information about how to fetch a patch
7673set via a certain protocol.
7674
David Pursehouseae367192014-11-25 17:24:47 +09007675[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007676|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02007677|Field Name ||Description
7678|`url` ||The URL of the project.
7679|`ref` ||The ref of the patch set.
7680|`commands` |optional|
7681The download commands for this patch set as a map that maps the command
7682names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09007683Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007684|==========================
7685
7686[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007687=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007688The `FileInfo` entity contains information about a file in a patch set.
7689
David Pursehouseae367192014-11-25 17:24:47 +09007690[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007691|=============================
7692|Field Name ||Description
7693|`status` |optional|
7694The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
7695"`C`"=Copied, "`W`"=Rewritten). +
7696Not set if the file was Modified ("`M`").
7697|`binary` |not set if `false`|Whether the file is binary.
7698|`old_path` |optional|
7699The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05007700Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01007701|`lines_inserted`|optional|
7702Number of inserted lines. +
Alice Kober-Sotzek7eff37c2018-07-05 15:58:50 +02007703Not set for binary files or if no lines were inserted. +
7704An empty last line is not included in the count and hence this number can
Sharad Bagri6fc48982022-06-25 14:11:50 -07007705differ by one from details provided in <<diff-info,DiffInfo>>.
Edwin Kempine3446292013-02-19 16:40:14 +01007706|`lines_deleted` |optional|
7707Number of deleted lines. +
Alice Kober-Sotzek7eff37c2018-07-05 15:58:50 +02007708Not set for binary files or if no lines were deleted. +
7709An empty last line is not included in the count and hence this number can
Sharad Bagri6fc48982022-06-25 14:11:50 -07007710differ by one from details provided in <<diff-info,DiffInfo>>.
Edwin Kempin640f9842015-10-08 15:53:20 +02007711|`size_delta` ||
7712Number of bytes by which the file size increased/decreased.
Youssef Elghareeb1ae12c02022-06-28 13:49:18 +02007713|`size` || File size in bytes.
7714|`old_mode` |optional|File mode in octal (e.g. 100644) at the old commit.
7715The first three digits indicate the file type and the last three digits contain
7716the file permission bits. For added files, this field will not be present.
7717|`new_mode` |optional|File mode in octal (e.g. 100644) at the new commit.
7718The first three digits indicate the file type and the last three digits contain
7719the file permission bits. For deleted files, this field will not be present.
Edwin Kempine3446292013-02-19 16:40:14 +01007720|=============================
7721
Dave Borowitzbad53ee2015-06-11 10:10:18 -04007722[[fix-input]]
7723=== FixInput
7724The `FixInput` entity contains options for fixing commits using the
7725link:#fix-change[fix change] endpoint.
7726
7727[options="header",cols="1,6"]
7728|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07007729|Field Name |Description
7730|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04007731database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07007732|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07007733merged into the destination branch as this exact SHA-1. If not, insert
7734a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04007735|==========================
7736
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007737[[fix-suggestion-info]]
7738=== FixSuggestionInfo
7739The `FixSuggestionInfo` entity represents a suggested fix.
7740
7741[options="header",cols="1,^1,5"]
7742|==========================
7743|Field Name ||Description
7744|`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested
7745fix. It will be generated automatically and hence will be ignored if it's set
7746for input objects.
7747|`description` ||A description of the suggested fix.
7748|`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>>
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01007749entities indicating how the content of one or several files should be modified.
7750Within a file, they should refer to non-overlapping regions.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007751|==========================
7752
7753[[fix-replacement-info]]
7754=== FixReplacementInfo
Alice Kober-Sotzek110f60f2016-12-19 14:53:40 +01007755The `FixReplacementInfo` entity describes how the content of a file should be
7756replaced by another content.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007757
7758[options="header",cols="1,6"]
7759|==========================
7760|Field Name |Description
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01007761|`path` |The path of the file which should be modified. Any file in
Alice Kober-Sotzek368547f2020-03-13 22:00:41 +01007762the repository may be modified. The commit message can be modified via the
7763magic file `/COMMIT_MSG` though only the part below the generated header of
7764that magic file can be modified. References to the header lines will result in
7765errors when the fix is applied.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007766|`range` |A <<comment-range,CommentRange>> indicating which content
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01007767of the file should be replaced. Lines in the file are assumed to be separated
Alice Kober-Sotzekf0a3f342020-09-24 14:16:06 +02007768by the line feed character.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01007769|`replacement` |The content which should be used instead of the current one.
7770|==========================
7771
Edwin Kempine3446292013-02-19 16:40:14 +01007772[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007773=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01007774The `GitPersonInfo` entity contains information about the
7775author/committer of a commit.
7776
David Pursehouseae367192014-11-25 17:24:47 +09007777[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01007778|==========================
7779|Field Name |Description
7780|`name` |The name of the author/committer.
7781|`email` |The email address of the author/committer.
7782|`date` |The link:rest-api.html#timestamp[timestamp] of when
7783this identity was constructed.
7784|`tz` |The timezone offset from UTC of when this identity was
7785constructed.
7786|==========================
7787
Edwin Kempin521c1242015-01-23 12:44:44 +01007788[[group-base-info]]
7789=== GroupBaseInfo
7790The `GroupBaseInfo` entity contains base information about the group.
7791
7792[options="header",cols="1,6"]
7793|==========================
7794|Field Name |Description
Edwin Kempin703613c2016-11-25 16:06:04 +01007795|`id` |The UUID of the group.
Edwin Kempin521c1242015-01-23 12:44:44 +01007796|`name` |The name of the group.
7797|==========================
7798
David Pursehoused9dac372016-11-24 19:41:10 +09007799[[hashtags-input]]
7800=== HashtagsInput
7801
7802The `HashtagsInput` entity contains information about hashtags to add to,
7803and/or remove from, a change.
7804
7805[options="header",cols="1,^1,5"]
7806|=======================
7807|Field Name||Description
7808|`add` |optional|The list of hashtags to be added to the change.
Mike Frysinger136ecbd2021-02-09 14:26:02 -05007809|`remove` |optional|The list of hashtags to be removed from the change.
David Pursehoused9dac372016-11-24 19:41:10 +09007810|=======================
7811
Edwin Kempin521c1242015-01-23 12:44:44 +01007812[[included-in-info]]
7813=== IncludedInInfo
7814The `IncludedInInfo` entity contains information about the branches a
Xinan Lindc40ff12021-07-26 23:26:28 -07007815change was merged into and tags it was tagged with. The branch or tag
7816must have 'refs/head/' or 'refs/tags/' prefix respectively.
Edwin Kempin521c1242015-01-23 12:44:44 +01007817
Edwin Kempin78279ba2015-05-22 15:22:41 +02007818[options="header",cols="1,^1,5"]
7819|=======================
7820|Field Name||Description
7821|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01007822Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02007823|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01007824Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02007825|`external`|optional|A map that maps a name to a list of external
7826systems that include this change, e.g. a list of servers on which this
7827change is deployed.
7828|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01007829
Edwin Kempine3446292013-02-19 16:40:14 +01007830[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08007831=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07007832The `LabelInfo` entity contains information about a label on a change, always
7833corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01007834
Dave Borowitz88159512013-06-14 14:21:50 -07007835There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07007836link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07007837
Youssef Elghareeb9b3e0212022-01-21 14:40:18 +01007838* Using `LABELS` will skip the `all.permitted_voting_range` attribute.
7839* Using `DETAILED_LABELS` will include the `all.permitted_voting_range`
7840 attribute.
Dave Borowitz88159512013-06-14 14:21:50 -07007841
David Pursehouseae367192014-11-25 17:24:47 +09007842[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01007843|===========================
7844|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01007845|`optional` |not set if `false`|
7846Whether the label is optional. Optional means the label may be set, but
7847it's neither necessary for submission nor does it block submission if
7848set.
Youssef Elghareeb261691a2021-11-17 13:01:08 +01007849|`description` |optional| The description of the label.
Dave Borowitz88159512013-06-14 14:21:50 -07007850|`approved` |optional|One user who approved this label on the change
7851(voted the maximum value) as an
7852link:rest-api-accounts.html#account-info[AccountInfo] entity.
7853|`rejected` |optional|One user who rejected this label on the change
7854(voted the minimum value) as an
7855link:rest-api-accounts.html#account-info[AccountInfo] entity.
7856|`recommended` |optional|One user who recommended this label on the
7857change (voted positively, but not the maximum value) as an
7858link:rest-api-accounts.html#account-info[AccountInfo] entity.
7859|`disliked` |optional|One user who disliked this label on the change
7860(voted negatively, but not the minimum value) as an
7861link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01007862|`blocking` |optional|If `true`, the label blocks submit operation.
7863If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07007864|`value` |optional|The voting value of the user who
7865recommended/disliked this label on the change if it is not
7866"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07007867|`default_value`|optional|The default voting value for the label.
7868This value may be outside the range specified in permitted_labels.
Youssef Elghareeb9b3e0212022-01-21 14:40:18 +01007869|votes|optional|A list of integers containing the vote values applied to this
7870label at the latest patchset.
Edwin Kempine3446292013-02-19 16:40:14 +01007871|`all` |optional|List of all approvals for this label as a list
Aaron Gableea8a2112017-04-25 14:18:16 -07007872of link:#approval-info[ApprovalInfo] entities. Items in this list may
7873not represent actual votes cast by users; if a user votes on any label,
Youssef Elghareeb9b3e0212022-01-21 14:40:18 +01007874a corresponding ApprovalInfo will appear in this list for all labels. +
7875The `permitted_voting_range` attribute is only set if the `DETAILED_LABELS`
7876option is requested.
Edwin Kempine3446292013-02-19 16:40:14 +01007877|`values` |optional|A map of all values that are allowed for this
7878label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07007879to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01007880|===========================
7881
Saša Živkov499873f2014-05-05 13:34:18 +02007882[[mergeable-info]]
7883=== MergeableInfo
7884The `MergeableInfo` entity contains information about the mergeability of a
7885change.
7886
David Pursehouseae367192014-11-25 17:24:47 +09007887[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02007888|============================
Saša Živkov697cab22014-04-29 16:46:50 +02007889|Field Name ||Description
7890|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02007891Submit type used for this change, can be `MERGE_IF_NECESSARY`,
Gert van Dijka4e49d02017-08-27 22:50:40 +02007892`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `REBASE_ALWAYS`, `MERGE_ALWAYS` or
Saša Živkov499873f2014-05-05 13:34:18 +02007893`CHERRY_PICK`.
Edwin Kempinfad66bc2020-01-29 10:26:00 +01007894|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007895The strategy of the merge, can be `recursive`, `resolve`,
7896`simple-two-way-in-core`, `ours` or `theirs`.
Saša Živkov697cab22014-04-29 16:46:50 +02007897|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02007898`true` if this change is cleanly mergeable, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01007899|`commit_merged` |optional|
Zhen Chen8f00d552016-07-26 16:54:59 -07007900`true` if this change is already merged, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01007901|`content_merged`|optional|
Zhen Chen8f00d552016-07-26 16:54:59 -07007902`true` if the content of this change is already merged, `false` otherwise
Edwin Kempinfad66bc2020-01-29 10:26:00 +01007903|`conflicts` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007904A list of paths with conflicts
Saša Živkov697cab22014-04-29 16:46:50 +02007905|`mergeable_into`|optional|
7906A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02007907|============================
Dave Borowitz88159512013-06-14 14:21:50 -07007908
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007909[[merge-input]]
7910=== MergeInput
7911The `MergeInput` entity contains information about the merge
7912
7913[options="header",cols="1,^1,5"]
Edwin Kempinaab27d32020-01-29 13:17:04 +01007914|==============================
7915|Field Name ||Description
7916|`source` ||
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007917The source to merge from, e.g. a complete or abbreviated commit SHA-1,
David Pursehouse4abaef932018-03-18 15:05:08 +09007918a complete reference name, a short reference name under `refs/heads`, `refs/tags`,
7919or `refs/remotes` namespace, etc.
Edwin Kempinaab27d32020-01-29 13:17:04 +01007920|`source_branch` |optional|
Han-Wen Nienhuys9ec1f6a2020-01-07 17:32:08 +01007921A branch from which `source` is reachable. If specified,
7922`source` is checked for visibility and reachability against only this
7923branch. This speeds up the operation, especially for large repos with
7924many branches.
Edwin Kempinaab27d32020-01-29 13:17:04 +01007925|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007926The strategy of the merge, can be `recursive`, `resolve`,
7927`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
Edwin Kempinaab27d32020-01-29 13:17:04 +01007928|`allow_conflicts`|optional, defaults to false|
7929If `true`, creating the merge succeeds also if there are conflicts. +
7930If there are conflicts the file contents of the created change contain
7931git conflict markers to indicate the conflicts. +
7932Callers can find out whether there were conflicts by checking the
7933`contains_git_conflicts` field in the link:#change-info[ChangeInfo]. +
7934If there are conflicts the change is marked as work-in-progress. +
7935This option is not supported for all merge strategies (e.g. it's
7936supported for `recursive` and `resolve`, but not for
7937`simple-two-way-in-core`).
7938|==============================
Zhen Chenf7d85ea2016-05-02 15:14:43 -07007939
Zhen Chenb1e07e52016-09-23 12:59:48 -07007940[[merge-patch-set-input]]
7941=== MergePatchSetInput
7942The `MergePatchSetInput` entity contains information about updating a new
7943change by creating a new merge commit.
7944
7945[options="header",cols="1,^1,5"]
7946|==================================
7947|Field Name ||Description
7948|`subject` |optional|
7949The new subject for the change, if not specified, will reuse the current patch
7950set's subject
Han-Wen Nienhuysbd2af0c2020-01-09 16:39:26 +01007951|`inherit_parent` |optional, default to `false`|
Zhen Chenb1e07e52016-09-23 12:59:48 -07007952Use the current patch set's first parent as the merge tip when set to `true`.
Changcheng Xiao9bdedaf2017-10-24 09:34:42 +02007953|`base_change` |optional|
Han-Wen Nienhuys69917fe2020-01-09 16:39:26 +01007954A link:#change-id[\{change-id\}] that identifies a change. When `inherit_parent`
Changcheng Xiao9bdedaf2017-10-24 09:34:42 +02007955is `false`, the merge tip will be the current patch set of the `base_change` if
7956it's set. Otherwise, the current branch tip of the destination branch will be used.
Zhen Chenb1e07e52016-09-23 12:59:48 -07007957|`merge` ||
7958The detail of the source commit for merge as a link:#merge-input[MergeInput]
7959entity.
Patrick Hiesele8fc7972020-10-06 13:22:07 +02007960|`author` |optional|
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03007961The author of the commit to create. Must be an
7962link:rest-api-accounts.html#account-input[AccountInput] entity with at least
7963the `name` and `email` fields set.
Patrick Hiesele8fc7972020-10-06 13:22:07 +02007964The caller needs "Forge Author" permission when using this field.
Nitzan Gur-Furmanbbfd3092022-06-28 14:53:03 +03007965This field does not affect the owner or the committer of the change, which will
Patrick Hiesele8fc7972020-10-06 13:22:07 +02007966continue to use the identity of the caller.
Zhen Chenb1e07e52016-09-23 12:59:48 -07007967|==================================
7968
Raviteja Sunkara791f3392015-11-03 13:24:50 +05307969[[move-input]]
7970=== MoveInput
7971The `MoveInput` entity contains information for moving a change to a new branch.
7972
7973[options="header",cols="1,^1,5"]
7974|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04007975|Field Name ||Description
7976|`destination_branch`||Destination branch
7977|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05307978A message to be posted in this change's comments
Marija Savtchoukd89fefc2020-12-15 06:46:15 +00007979|`keep_all_votes` |optional, defaults to false|
Marija Savtchoukcee6a8f2020-12-03 12:58:04 +00007980By default, only veto votes that are blocking the change from submission are moved to
7981the destination branch. Using this option is only allowed for administrators,
7982because it can affect the submission behaviour of the change (depending on the label access
7983configuration and submissions rules).
Raviteja Sunkara791f3392015-11-03 13:24:50 +05307984|===========================
7985
Edwin Kempincd07df42016-12-01 09:10:09 +01007986[[notify-info]]
7987=== NotifyInfo
7988The `NotifyInfo` entity contains detailed information about who should
7989be notified about an update. These notifications are sent out even if a
7990`notify` option in the request input disables normal notifications.
7991`NotifyInfo` entities are normally contained in a `notify_details` map
Gal Paikin1ae8b462020-07-27 15:50:59 +03007992in the request input where the key is the
7993link:user-notify.html#recipient-types[recipient type].
Edwin Kempincd07df42016-12-01 09:10:09 +01007994
7995[options="header",cols="1,^1,5"]
7996|=======================
7997|Field Name||Description
7998|`accounts`|optional|
7999A list of link:rest-api-accounts.html#account-id[account IDs] that
8000identify the accounts that should be should be notified.
8001|=======================
8002
Edwin Kempin364a86b2017-04-27 12:34:00 +02008003[[private-input]]
8004=== PrivateInput
8005The `PrivateInput` entity contains information for changing the private
8006flag on a change.
8007
8008[options="header",cols="1,^1,5"]
8009|=======================
8010|Field Name||Description
8011|`message` |optional|Message describing why the private flag was changed.
8012|=======================
8013
Edwin Kempin521c1242015-01-23 12:44:44 +01008014[[problem-info]]
8015=== ProblemInfo
8016The `ProblemInfo` entity contains a description of a potential consistency problem
8017with a change. These are not related to the code review process, but rather
8018indicate some inconsistency in Gerrit's database or repository metadata related
8019to the enclosing change.
8020
8021[options="header",cols="1,^1,5"]
8022|===========================
8023|Field Name||Description
8024|`message` ||Plaintext message describing the problem with the change.
8025|`status` |optional|
8026The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
8027fix was attempted.
8028|`outcome` |optional|
8029If `status` is set, an additional plaintext message describing the
8030outcome of the fix.
8031|===========================
8032
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02008033[[publish-change-edit-input]]
8034=== PublishChangeEditInput
8035The `PublishChangeEditInput` entity contains options for the publishing of
8036change edit.
8037
8038[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01008039|=============================
8040|Field Name ||Description
8041|`notify` |optional|
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02008042Notify handling that defines to whom email notifications should be sent
8043after the change edit is published. +
8044Allowed values are `NONE` and `ALL`. +
8045If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01008046|`notify_details`|optional|
8047Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008048of link:user-notify.html#recipient-types[recipient type] to
8049link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01008050|=============================
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02008051
Patrick Hieselbb84fd72017-08-23 11:11:22 +02008052[[pure-revert-info]]
8053=== PureRevertInfo
8054The `PureRevertInfo` entity describes the result of a pure revert check.
8055
8056[options="header",cols="1,6"]
8057|======================
8058|Field Name |Description
8059|`is_pure_revert` |Outcome of the check as boolean.
8060|======================
8061
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04008062[[push-certificate-info]]
8063=== PushCertificateInfo
8064The `PushCertificateInfo` entity contains information about a push
8065certificate provided when the user pushed for review with `git push
8066--signed HEAD:refs/for/<branch>`. Only used when signed push is
8067link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
8068
8069[options="header",cols="1,6"]
8070|===========================
8071|Field Name|Description
8072|`certificate`|Signed certificate payload and GPG signature block.
8073|`key` |
8074Information about the key that signed the push, along with any problems
8075found while checking the signature or the key itself, as a
8076link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
8077|===========================
8078
Gabor Somossyb72d4c62015-10-20 23:40:07 +01008079[[range-info]]
8080=== RangeInfo
8081The `RangeInfo` entity stores the coordinates of a range.
8082
8083[options="header",cols="1,6"]
8084|===========================
8085|Field Name | Description
8086|`start` | First index.
8087|`end` | Last index.
8088|===========================
8089
Zalan Blenessy874aed72015-01-12 13:26:18 +01008090[[rebase-input]]
8091=== RebaseInput
8092The `RebaseInput` entity contains information for changing parent when rebasing.
8093
Edwin Kempin2f47eb42022-02-10 12:48:45 +01008094[options="header",cols="1,^1,5"]
Edwin Kempinccc9da02023-01-23 17:57:15 +01008095|====================================
8096|Field Name ||Description
8097|`base` |optional|
Han-Wen Nienhuys37a1cab2021-04-01 12:46:00 +02008098The new parent revision. This can be a ref or a SHA-1 to a concrete patchset. +
Zalan Blenessy874aed72015-01-12 13:26:18 +01008099Alternatively, a change number can be specified, in which case the current
8100patch set is inferred. +
8101Empty string is used for rebasing directly on top of the target branch,
8102which effectively breaks dependency towards a parent change.
Edwin Kempinccc9da02023-01-23 17:57:15 +01008103|`allow_conflicts` |optional, defaults to false|
Edwin Kempin9a6f0542021-01-13 13:51:42 +01008104If `true`, the rebase also succeeds if there are conflicts. +
8105If there are conflicts the file contents of the rebased patch set contain
8106git conflict markers to indicate the conflicts. +
8107Callers can find out whether there were conflicts by checking the
8108`contains_git_conflicts` field in the returned link:#change-info[ChangeInfo]. +
Edwin Kempinccc9da02023-01-23 17:57:15 +01008109If there are conflicts the change is marked as work-in-progress. +
8110Cannot be combined with the `on_behalf_of_uploader` option.
8111|`on_behalf_of_uploader`|optional, defaults to false|
8112If `true`, the rebase is done on behalf of the uploader. +
8113This means the uploader of the current patch set will also be the uploader of
8114the rebased patch set. The calling user will be recorded as the real user. +
8115Rebasing on behalf of the uploader is only supported for trivial rebases.
8116This means this option cannot be combined with the `allow_conflicts` option. +
8117In addition, rebasing on behalf of the uploader is only supported for the
8118current patch set of a change and not when rebasing a chain. +
8119Using this option is not supported when rebasing a chain via the
8120link:#rebase-chain[Rebase Chain] REST endpoint. +
8121If the caller is the uploader this flag is ignored and a normal rebase is done.
8122|`validation_options` |optional|
Edwin Kempine5ec9212022-02-11 13:37:35 +01008123Map with key-value pairs that are forwarded as options to the commit validation
8124listeners (e.g. can be used to skip certain validations). Which validation
8125options are supported depends on the installed commit validation listeners.
8126Gerrit core doesn't support any validation options, but commit validation
8127listeners that are implemented in plugins may. Please refer to the
8128documentation of the installed plugins to learn whether they support validation
8129options. Unknown validation options are silently ignored.
Edwin Kempinccc9da02023-01-23 17:57:15 +01008130|====================================
Zalan Blenessy874aed72015-01-12 13:26:18 +01008131
Nitzan Gur-Furman4655d8b2022-12-16 08:46:18 +01008132[[rebase-chain-info]]
8133=== RebaseChainInfo
8134
8135The `RebaseChainInfo` entity contains information about a chain of changes
8136that were rebased.
8137
8138[options="header",cols="1,^1,5"]
8139|===========================
8140|Field Name ||Description
8141|`rebased_changes` ||List of the unsubmitted ancestors, as link:#change-info[ChangeInfo]
8142entities. Includes both rebased changes, and previously up-to-date ancestors. The list is ordered by
8143ancestry, where the oldest ancestor is the first.
8144|`contains_git_conflicts` ||Whether any of the rebased changes has conflicts
8145due to rebasing.
Nitzan Gur-Furmanca0c55c2023-01-11 09:33:38 +01008146|===========================
Nitzan Gur-Furman4655d8b2022-12-16 08:46:18 +01008147
Edwin Kempin521c1242015-01-23 12:44:44 +01008148[[related-change-and-commit-info]]
8149=== RelatedChangeAndCommitInfo
8150
8151The `RelatedChangeAndCommitInfo` entity contains information about
8152a related change and commit.
8153
8154[options="header",cols="1,^1,5"]
8155|===========================
8156|Field Name ||Description
Patrick Hieselcab63512017-07-28 10:25:42 +02008157|`project` ||The project of the change or commit.
Edwin Kempin521c1242015-01-23 12:44:44 +01008158|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01008159|`commit` ||The commit as a
8160link:#commit-info[CommitInfo] entity.
8161|`_change_number` |optional|The change number.
8162|`_revision_number` |optional|The revision number.
8163|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07008164|`status` |optional|The status of the change. The status of
David Ostrovsky6ffb7d92017-02-13 21:16:58 +01008165the change is one of (`NEW`, `MERGED`, `ABANDONED`).
Joerg Zieren75e95382022-07-08 11:30:35 +02008166|`submittable` |optional|Boolean indicating whether the change is
8167submittable. +
8168Only populated if link:#get-related-changes-submittable[requested].
Edwin Kempin521c1242015-01-23 12:44:44 +01008169|===========================
8170
8171[[related-changes-info]]
8172=== RelatedChangesInfo
8173The `RelatedChangesInfo` entity contains information about related
8174changes.
8175
8176[options="header",cols="1,6"]
8177|===========================
8178|Field Name |Description
8179|`changes` |A list of
8180link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
8181describing the related changes. Sorted by git commit order, newest to
8182oldest. Empty if there are no related changes.
8183|===========================
8184
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01008185
8186[[requirement]]
8187=== Requirement
8188The `Requirement` entity contains information about a requirement relative to a change.
8189
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01008190[options="header",cols="1,^1,5"]
8191|===========================
8192|Field Name | |Description
8193|`status` | | Status of the requirement. Can be either `OK`, `NOT_READY` or `RULE_ERROR`.
Sven Selberge748e3f2020-09-24 13:44:56 +02008194|`fallback_text` | | A human readable reason
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01008195|`type` | |
8196Alphanumerical (plus hyphens or underscores) string to identify what the requirement is and why it
8197was triggered. Can be seen as a class: requirements sharing the same type were created for a similar
8198reason, and the data structure will follow one set of rules.
Maxime Guerreirod32aedb2018-03-22 15:29:10 +01008199|===========================
8200
8201
Edwin Kempined5364b2013-02-22 10:39:33 +01008202[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008203=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01008204The `RestoreInput` entity contains information for restoring a change.
8205
David Pursehouseae367192014-11-25 17:24:47 +09008206[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01008207|===========================
8208|Field Name ||Description
8209|`message` |optional|
8210Message to be added as review comment to the change when restoring the
8211change.
8212|===========================
8213
Edwin Kempind2ec4152013-02-22 12:17:19 +01008214[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008215=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01008216The `RevertInput` entity contains information for reverting a change.
8217
David Pursehouseae367192014-11-25 17:24:47 +09008218[options="header",cols="1,^1,5"]
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008219|=================================
8220|Field Name ||Description
8221|`message` |optional|
Edwin Kempind2ec4152013-02-22 12:17:19 +01008222Message to be added as review comment to the change when reverting the
8223change.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008224|`notify` |optional|
Edwin Kempin0d5be4f52018-03-14 16:54:24 +01008225Notify handling that defines to whom email notifications should be sent
8226for reverting the change. +
8227Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
8228If not set, the default is `ALL`.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008229|`notify_details` |optional|
Edwin Kempin0d5be4f52018-03-14 16:54:24 +01008230Additional information about whom to notify about the revert as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008231of link:user-notify.html#recipient-types[recipient type] to
8232link:#notify-info[NotifyInfo] entity.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008233|`topic` |optional|
Gal Paikinb81f56c2019-10-16 14:39:24 +02008234Name of the topic for the revert change. If not set, the default for Revert
8235endpoint is the topic of the change being reverted, and the default for the
8236RevertSubmission endpoint is `revert-{submission_id}-{timestamp.now}`.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02008237Topic can't contain quotation marks.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008238|`work_in_progress` |optional|
Youssef Elghareeb86095442021-08-02 18:18:22 +02008239When present, change is marked as Work In Progress. The `notify` input is
Nitzan Gur-Furman08765cb2022-10-18 13:27:34 +02008240used if it's present, otherwise it will be overridden to `NONE`. +
8241Notifications for the reverted change will only sent once the result change is
8242no longer WIP. +
Youssef Elghareebfd02dae2020-09-03 21:56:30 +02008243If not set, the default is false.
Edwin Kempinc6dc7a02022-04-22 12:02:30 +02008244|`validation_options`|optional|
8245Map with key-value pairs that are forwarded as options to the commit validation
8246listeners (e.g. can be used to skip certain validations). Which validation
8247options are supported depends on the installed commit validation listeners.
8248Gerrit core doesn't support any validation options, but commit validation
8249listeners that are implemented in plugins may. Please refer to the
8250documentation of the installed plugins to learn whether they support validation
8251options. Unknown validation options are silently ignored.
8252|=================================
Gal Paikinb81f56c2019-10-16 14:39:24 +02008253
8254[[revert-submission-info]]
8255=== RevertSubmissionInfo
Gal Paikin64777c72019-12-18 14:11:13 +01008256The `RevertSubmissionInfo` entity describes the revert changes.
Gal Paikinb81f56c2019-10-16 14:39:24 +02008257
8258[options="header",cols="1,6"]
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02008259|==============================
Gal Paikinb81f56c2019-10-16 14:39:24 +02008260|Field Name | Description
8261|`revert_changes` |
Edwin Kempin6e7fb4e2019-10-24 17:20:51 +02008262A list of link:#change-info[ChangeInfo] that describes the revert changes. Each
8263entity in that list is a revert change that was created in that revert
8264submission.
Edwin Kempin45ec1bb2019-10-24 17:19:30 +02008265|==============================
Edwin Kempind2ec4152013-02-22 12:17:19 +01008266
Edwin Kempin67498de2013-02-25 16:15:34 +01008267[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008268=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01008269The `ReviewInfo` entity contains information about a review.
8270
David Pursehouseae367192014-11-25 17:24:47 +09008271[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01008272|===========================
8273|Field Name |Description
8274|`labels` |
8275The labels of the review as a map that maps the label names to the
8276voting values.
8277|===========================
8278
Viktar Donich316bf7a2016-07-06 11:29:01 -07008279[[review-update-info]]
8280=== ReviewerUpdateInfo
8281The `ReviewerUpdateInfo` entity contains information about updates to
8282change's reviewers set.
8283
8284[options="header",cols="1,6"]
8285|===========================
8286|Field Name |Description
8287|`updated`|
8288Timestamp of the update.
8289|`updated_by`|
8290The account which modified state of the reviewer in question as
8291link:rest-api-accounts.html#account-info[AccountInfo] entity.
8292|`reviewer`|
8293The reviewer account added or removed from the change as an
8294link:rest-api-accounts.html#account-info[AccountInfo] entity.
8295|`state`|
8296The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`.
8297|===========================
8298
Edwin Kempin67498de2013-02-25 16:15:34 +01008299[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008300=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01008301The `ReviewInput` entity contains information for adding a review to a
8302revision.
8303
David Pursehouseae367192014-11-25 17:24:47 +09008304[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01008305|============================
Gal Paikin3e984c22020-07-03 16:44:40 +03008306|Field Name ||Description
8307|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008308The message to be added as review comment.
Gal Paikin3e984c22020-07-03 16:44:40 +03008309|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01008310Apply this tag to the review comment message, votes, and inline
Ben Rohlfsd9be63f2021-02-04 09:01:46 +01008311comments. Tags with an 'autogenerated:' prefix may be used by CI or other
8312automated systems to distinguish them from human reviews. If another
8313message was posted on a newer patchset, but with the same tag, then the older
8314message will be hidden in the UI. Suffixes starting with `~` are not considered,
8315so `autogenerated:my-ci-system~trigger` and `autogenerated:my-ci-system~result`
8316will be considered being the same tag with regards to the hiding rule.
Gal Paikin3e984c22020-07-03 16:44:40 +03008317|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008318The votes that should be added to the revision as a map that maps the
8319label names to the voting values.
Gal Paikin3e984c22020-07-03 16:44:40 +03008320|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008321The comments that should be added as a map that maps a file path to a
8322list of link:#comment-input[CommentInput] entities.
Gal Paikin3e984c22020-07-03 16:44:40 +03008323|`robot_comments` |optional|
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008324The robot comments that should be added as a map that maps a file path
8325to a list of link:#robot-comment-input[RobotCommentInput] entities.
Gal Paikin3e984c22020-07-03 16:44:40 +03008326|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008327Draft handling that defines how draft comments are handled that are
8328already in the database but that were not also described in this
8329input. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05008330Allowed values are `PUBLISH`, `PUBLISH_ALL_REVISIONS` and `KEEP`. All values
8331except `PUBLISH_ALL_REVISIONS` operate only on drafts for a single revision. +
Dave Borowitzc0640542016-10-05 16:19:21 -04008332Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. +
Dave Borowitz3b5fb812018-01-09 15:21:06 -05008333If not set, the default is `KEEP`. If `on_behalf_of` is set, then no other value
8334besides `KEEP` is allowed.
Youssef Elghareeb3e4bf512021-05-12 18:40:27 +02008335|`draft_ids_to_publish` |optional|
8336List of draft IDs to be published. The draft IDs should belong to the current
8337user and be valid. If `drafts` is set to `PUBLISH`, then draft IDs should
8338contain drafts for the same revision that is requested for review. If `drafts`
8339is set to `KEEP`, then `draft_ids_to_publish` will be ignored and no draft
8340comments will be published. +
8341If not set, the default is to publish all drafts according to the `drafts` field.
Gal Paikin3e984c22020-07-03 16:44:40 +03008342|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01008343Notify handling that defines to whom email notifications should be sent
8344after the review is stored. +
8345Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
8346If not set, the default is `ALL`.
Gal Paikin3e984c22020-07-03 16:44:40 +03008347|`notify_details` |optional|
Edwin Kempincd07df42016-12-01 09:10:09 +01008348Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008349of link:user-notify.html#recipient-types[recipient type] to
8350link:#notify-info[NotifyInfo] entity.
Gal Paikin3e984c22020-07-03 16:44:40 +03008351|`omit_duplicate_comments` |optional|
Bill Wendling692b4ec2015-10-19 15:40:57 -07008352If `true`, comments with the same content at the same place will be omitted.
Gal Paikin3e984c22020-07-03 16:44:40 +03008353|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07008354link:rest-api-accounts.html#account-id[\{account-id\}] the review
8355should be posted on behalf of. To use this option the caller must
8356have been granted `labelAs-NAME` permission for all keys of labels.
Gal Paikin3e984c22020-07-03 16:44:40 +03008357|`reviewers` |optional|
Patrick Hieselcf6d9352017-04-13 10:15:42 +02008358A list of link:rest-api-changes.html#reviewer-input[ReviewerInput]
Gal Paikin0184a2b2021-04-15 08:58:34 +02008359representing reviewers that should be added/removed to/from the change.
Gal Paikin3e984c22020-07-03 16:44:40 +03008360|`ready` |optional|
Logan Hanks53c36012017-06-30 13:47:54 -07008361If true, and if the change is work in progress, then start review.
8362It is an error for both `ready` and `work_in_progress` to be true.
Gal Paikin3e984c22020-07-03 16:44:40 +03008363|`work_in_progress` |optional|
Logan Hanks53c36012017-06-30 13:47:54 -07008364If true, mark the change as work in progress. It is an error for both
8365`ready` and `work_in_progress` to be true.
Gal Paikin3e984c22020-07-03 16:44:40 +03008366|`add_to_attention_set` |optional|
Gal Paikinc326de42020-06-16 18:49:00 +03008367list of link:#attention-set-input[AttentionSetInput] entities to add
Gal Paikine631de22020-10-29 12:19:11 +01008368to the link:#attention-set[attention set]. Users that are not reviewers,
8369ccs, owner, or uploader are silently ignored.
Gal Paikin3e984c22020-07-03 16:44:40 +03008370|`remove_from_attention_set` |optional|
Gal Paikinc326de42020-06-16 18:49:00 +03008371list of link:#attention-set-input[AttentionSetInput] entities to remove
8372from the link:#attention-set[attention set].
Gal Paikin3e984c22020-07-03 16:44:40 +03008373|`ignore_automatic_attention_set_rules`|optional|
8374If set to true, ignore all automatic attention set rules described in the
Gal Paikinc326de42020-06-16 18:49:00 +03008375link:#attention-set[attention set]. Updates in add_to_attention_set
8376and remove_from_attention_set are not ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01008377|============================
8378
Aaron Gable843b0c12017-04-21 08:25:27 -07008379[[review-result]]
8380=== ReviewResult
8381The `ReviewResult` entity contains information regarding the updates
8382that were made to a review.
8383
8384[options="header",cols="1,^1,5"]
8385|============================
8386|Field Name ||Description
8387|`labels` |optional|
8388Map of labels to values after the review was posted. Null if any reviewer
8389additions were rejected.
8390|`reviewers` |optional|
8391Map of account or group identifier to
Gal Paikin721a40b2021-04-15 09:30:00 +02008392link:rest-api-changes.html#reviewer-result[ReviewerResult]
Gal Paikin0184a2b2021-04-15 08:58:34 +02008393representing the outcome of adding/removing a reviewer.
Aaron Gable843b0c12017-04-21 08:25:27 -07008394Absent if no reviewer additions were requested.
Logan Hankse81ad8e2017-07-18 09:45:46 -07008395|`ready` |optional|
8396If true, the change was moved from WIP to ready for review as a result of this
8397action. Not set if false.
Edwin Kempinddcf6f92022-08-02 11:21:05 +02008398|`error` |optional|
8399Error message for non-200 responses.
Aaron Gable843b0c12017-04-21 08:25:27 -07008400|============================
8401
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008402[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008403=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008404The `ReviewerInfo` entity contains information about a reviewer and its
8405votes on a change.
8406
Edwin Kempin963dfd02013-02-27 12:39:32 +01008407`ReviewerInfo` has the same fields as
8408link:rest-api-accounts.html#account-info[AccountInfo] and includes
8409link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008410In addition `ReviewerInfo` has the following fields:
8411
David Pursehouseae367192014-11-25 17:24:47 +09008412[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008413|==========================
8414|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008415|`approvals` |
8416The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09008417approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Patrick Hiesel11873ef2017-03-17 17:36:05 +01008418|`_account_id` |
8419This field is inherited from `AccountInfo` but is optional here if an
8420unregistered reviewer was added by email. See
8421link:rest-api-changes.html#add-reviewer[add-reviewer] for details.
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01008422|==========================
8423
Edwin Kempin392328e2013-02-25 12:50:03 +01008424[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008425=== ReviewerInput
Gal Paikin0184a2b2021-04-15 08:58:34 +02008426The `ReviewerInput` entity contains information for adding or removing
8427reviewers to/from the change.
Edwin Kempin392328e2013-02-25 12:50:03 +01008428
David Pursehouseae367192014-11-25 17:24:47 +09008429[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01008430|=============================
8431|Field Name ||Description
8432|`reviewer` ||
Edwin Kempin392328e2013-02-25 12:50:03 +01008433The link:rest-api-accounts.html#account-id[ID] of one account that
Gal Paikin0184a2b2021-04-15 08:58:34 +02008434should be added/removed as reviewer or the link:rest-api-groups.html#group-id[
Han-Wen Nienhuyse6229052020-01-29 12:51:36 +01008435ID] of one internal group for which all members should be added as reviewers. +
Edwin Kempin392328e2013-02-25 12:50:03 +01008436If an ID identifies both an account and a group, only the account is
8437added as reviewer to the change.
Han-Wen Nienhuyse6229052020-01-29 12:51:36 +01008438External groups, such as LDAP groups, will be silently omitted from a
8439link:#set-review[set-review] or
Gal Paikin0184a2b2021-04-15 08:58:34 +02008440link:rest-api-changes.html#add-reviewer[add-reviewer] call. A group can only be
8441specified for adding reviewers, not for removing them.
Edwin Kempincd07df42016-12-01 09:10:09 +01008442|`state` |optional|
Gal Paikin0184a2b2021-04-15 08:58:34 +02008443Add reviewer in this state. Possible reviewer states are `REVIEWER`,
8444`CC` and `REMOVED`. If not given, defaults to `REVIEWER`.
Edwin Kempincd07df42016-12-01 09:10:09 +01008445|`confirmed` |optional|
Edwin Kempin392328e2013-02-25 12:50:03 +01008446Whether adding the reviewer is confirmed. +
8447The Gerrit server may be configured to
8448link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
8449confirmation] when adding a group as reviewer that has many members.
Edwin Kempincd07df42016-12-01 09:10:09 +01008450|`notify` |optional|
Sven Selberg4d64f972016-09-26 16:15:02 +02008451Notify handling that defines to whom email notifications should be sent
8452after the reviewer is added. +
8453Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
8454If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01008455|`notify_details`|optional|
8456Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008457of link:user-notify.html#recipient-types[recipient type] to
8458link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01008459|=============================
Edwin Kempin392328e2013-02-25 12:50:03 +01008460
Gal Paikin721a40b2021-04-15 09:30:00 +02008461[[reviewer-result]]
8462=== ReviewerResult
Gal Paikin0184a2b2021-04-15 08:58:34 +02008463The `ReviewerResult` entity describes the result of modifying reviewers of
8464a change.
Gal Paikin721a40b2021-04-15 09:30:00 +02008465
8466[options="header",cols="1,^1,5"]
8467|===========================
8468|Field Name ||Description
8469|`input` ||
8470Value of the `reviewer` field from link:#reviewer-input[ReviewerInput]
8471set while adding the reviewer.
8472|`reviewers` |optional|
8473The newly added reviewers as a list of link:#reviewer-info[
8474ReviewerInfo] entities.
8475|`ccs` |optional|
Gal Paikinefb4ad52021-04-15 09:44:40 +02008476The newly CCed accounts as a list of
8477link:rest-api-accounts.html#account-info[AccountInfo] entities. This field will
Gal Paikin0184a2b2021-04-15 08:58:34 +02008478only appear if the requested `state` for the reviewer was `CC`.
8479|`removed` |optional|
8480The newly removed accounts as a list of
8481link:rest-api-accounts.html#account-info[AccountInfo] entities.
8482This field will only appear if the requested `state` for the reviewer was
8483`REMOVED`.
Gal Paikin721a40b2021-04-15 09:30:00 +02008484|`error` |optional|
8485Error message explaining why the reviewer could not be added. +
8486If a group was specified in the input and an error is returned, it
8487means that none of the members were added as reviewer.
8488|`confirm` |`false` if not set|
8489Whether adding the reviewer requires confirmation.
8490|===========================
8491
Edwin Kempine3446292013-02-19 16:40:14 +01008492[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008493=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01008494The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07008495Not all fields are returned by default. Additional fields can
8496be obtained by adding `o` parameters as described in
8497link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01008498
David Pursehouseae367192014-11-25 17:24:47 +09008499[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01008500|===========================
8501|Field Name ||Description
David Pursehouse4de41112016-06-28 09:24:08 +09008502|`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`,
8503`MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`.
Kasper Nilssonbe3616d2018-01-23 14:10:36 -08008504|`_number` ||The patch set number, or `edit` if the patch set is an edit.
Edwin Kempin04cbd342015-02-19 16:31:22 +01008505|`created` ||
8506The link:rest-api.html#timestamp[timestamp] of when the patch set was
8507created.
8508|`uploader` ||
8509The uploader of the patch set as an
8510link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempinccc9da02023-01-23 17:57:15 +01008511|`real_uploader`|optional|
8512The real uploader of the patch set as an
8513link:rest-api-accounts.html#account-info[AccountInfo] entity. +
8514Only set if the upload was done on behalf of another user.
Edwin Kempin4569ced2014-11-25 16:45:05 +01008515|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01008516|`fetch` ||
8517Information about how to fetch this patch set. The fetch information is
8518provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07008519"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
8520only included if a plugin implementing the
8521link:intro-project-owner.html#download-commands[download commands]
8522interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07008523|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01008524link:#commit-info[CommitInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07008525|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01008526The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07008527link:#file-info[FileInfo] entities. Only set if
8528link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
8529option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07008530|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07008531Actions the caller might be able to perform on this revision. The
8532information is a map of view name to link:#action-info[ActionInfo]
8533entities.
Khai Dob3139b7532014-09-19 15:13:04 -07008534|`reviewed` |optional|
8535Indicates whether the caller is authenticated and has commented on the
8536current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Quinten Yearsley28cd2122019-06-10 14:41:13 -07008537|`commit_with_footers` |optional|
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07008538If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
8539this is the current patch set, contains the full commit message with
8540Gerrit-specific commit footers, as if this revision were submitted
8541using the link:project-configuration.html#cherry_pick[Cherry Pick]
8542submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04008543|`push_certificate` |optional|
8544If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
8545contains the push certificate provided by the user when uploading this
8546patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
8547This field is always set if the option is requested; if no push
8548certificate was provided, it is set to an empty object.
Aaron Gable621c9b62017-04-21 09:24:20 -07008549|`description` |optional|
8550The description of this patchset, as displayed in the patchset
8551selector menu. May be null if no description is set.
Edwin Kempine3446292013-02-19 16:40:14 +01008552|===========================
8553
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008554[[robot-comment-info]]
8555=== RobotCommentInfo
8556The `RobotCommentInfo` entity contains information about a robot inline
8557comment.
8558
Alice Kober-Sotzek7d890be2020-10-01 17:41:56 +02008559`RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>>
8560except for the `unresolved` field which doesn't exist for robot comments.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008561In addition `RobotCommentInfo` has the following fields:
8562
8563[options="header",cols="1,^1,5"]
8564|===========================
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01008565|Field Name ||Description
8566|`robot_id` ||The ID of the robot that generated this comment.
8567|`robot_run_id` ||An ID of the run of the robot.
8568|`url` |optional|URL to more information.
8569|`properties` |optional|Robot specific properties as map that maps arbitrary
8570keys to values.
8571|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
8572<<fix-suggestion-info,FixSuggestionInfo>> entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008573|===========================
8574
8575[[robot-comment-input]]
8576=== RobotCommentInput
8577The `RobotCommentInput` entity contains information for creating an inline
8578robot comment.
8579
Alice Kober-Sotzek7d890be2020-10-01 17:41:56 +02008580[options="header",cols="1,^1,5"]
8581|===========================
8582|Field Name ||Description
8583|`path` ||
8584link:#file-id[The file path] for which the inline comment should be added.
8585|`side` |optional|
8586The side on which the comment should be added. +
8587Allowed values are `REVISION` and `PARENT`. +
8588If not set, the default is `REVISION`.
8589|`line` |optional|
8590The number of the line for which the comment should be added. +
8591`0` if it is a file comment. +
8592If neither line nor range is set, a file comment is added. +
8593If range is set, this value is ignored in favor of the `end_line` of the range.
8594|`range` |optional|
8595The range of the comment as a link:#comment-range[CommentRange]
8596entity.
8597|`in_reply_to` |optional|
8598The URL encoded UUID of the comment to which this comment is a reply.
8599|`message` |optional|
8600The comment message.
8601|`robot_id` ||The ID of the robot that generated this comment.
8602|`robot_run_id` ||An ID of the run of the robot.
8603|`url` |optional|URL to more information.
8604|`properties` |optional|Robot specific properties as map that maps arbitrary
8605keys to values.
8606|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
8607<<fix-suggestion-info,FixSuggestionInfo>> entities.
8608|===========================
Edwin Kempin3fde7e42016-09-19 15:35:10 +02008609
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008610[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008611=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008612The `RuleInput` entity contains information to test a Prolog rule.
8613
David Pursehouseae367192014-11-25 17:24:47 +09008614[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008615|===========================
8616|Field Name ||Description
8617|`rule`||
8618Prolog code to execute instead of the code in `refs/meta/config`.
8619|`filters`|`RUN` if not set|
8620When `RUN` filter rules in the parent projects are called to
8621post-process the results of the project specific rule. This
8622behavior matches how the rule will execute if installed. +
8623If `SKIP` the parent filters are not called, allowing the test
8624to return results from the input rule.
8625|===========================
8626
Edwin Kempin0eddba02013-02-22 15:30:12 +01008627[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008628=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01008629The `SubmitInput` entity contains information for submitting a change.
8630
David Pursehouseae367192014-11-25 17:24:47 +09008631[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01008632|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01008633|Field Name ||Description
Edwin Kempincd07df42016-12-01 09:10:09 +01008634|`on_behalf_of` |optional|
Dave Borowitzc6d143d2016-02-24 12:32:23 -05008635If set, submit the change on behalf of the given user. The value may take any
8636format link:rest-api-accounts.html#account-id[accepted by the accounts REST
8637API]. Using this option requires
8638link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
8639permission on the branch.
Edwin Kempincd07df42016-12-01 09:10:09 +01008640|`notify` |optional|
Stephen Lia5a5ef02016-03-31 16:55:53 -07008641Notify handling that defines to whom email notifications should be sent after
8642the change is submitted. +
8643Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
Nitzan Gur-Furman9da317c2022-10-07 11:19:53 +02008644If not set, the default is `ALL`.+
8645Ignored if a post approval diff is present (i.e. if the change is submitted
8646with copied approvals), because in this case everyone should be informed
8647about the non-reviewed diff which has been applied after the change has been
8648approved so that they can take action if the post approval diff looks
8649unexpected. In other words if a post approval diff is present `ALL` is
8650enforced.
Edwin Kempincd07df42016-12-01 09:10:09 +01008651|`notify_details`|optional|
8652Additional information about whom to notify about the update as a map
Gal Paikin1ae8b462020-07-27 15:50:59 +03008653of link:user-notify.html#recipient-types[recipient type] to
8654link:#notify-info[NotifyInfo] entity.
Edwin Kempincd07df42016-12-01 09:10:09 +01008655|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01008656
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008657[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008658=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008659The `SubmitRecord` entity describes results from a submit_rule.
Dave Borowitz6453fce2016-09-22 16:11:56 +02008660Fields in this entity roughly correspond to the fields set by `LABELS`
8661in link:#label-info[LabelInfo].
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008662
David Pursehouseae367192014-11-25 17:24:47 +09008663[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008664|===========================
8665|Field Name ||Description
8666|`status`||
8667`OK`, the change can be submitted. +
8668`NOT_READY`, additional labels are required before submit. +
8669`CLOSED`, closed changes cannot be submitted. +
8670`RULE_ERROR`, rule code failed with an error.
8671|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01008672Map of labels that are approved; an
8673link:rest-api-accounts.html#account-info[AccountInfo] identifies the
8674voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008675|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01008676Map of labels that are preventing submit;
8677link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008678|`need`|optional|
8679Map of labels that need to be given to submit. The value is
8680currently an empty object.
8681|`may`|optional|
8682Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01008683link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
8684if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08008685|`impossible`|optional|
8686Map of labels that should have been in `need` but cannot be
8687used by any user because of access restrictions. The value
8688is currently an empty object.
8689|`error_message`|optional|
8690When status is RULE_ERROR this message provides some text describing
8691the failure of the rule predicate.
8692|===========================
8693
Youssef Elghareeb02d33aa2021-10-04 13:24:52 +02008694[[submit-record-info]]
8695=== SubmitRecordInfo
8696The `SubmitRecordInfo` entity describes results from a submit_rule.
8697
8698[options="header",cols="1,^1,5"]
8699|===========================
8700|Field Name ||Description
8701|`rule_name`||
8702The name of the submit rule that created this submit record. The submit rule is
8703specified in the form of "$plugin~$rule" where `$plugin` is the plugin name
8704and `$rule` is the name of the class that implemented the submit rule.
8705|`status`||
8706`OK`, the change can be submitted. +
8707`NOT_READY`, additional labels are required before submit. +
8708`CLOSED`, closed changes cannot be submitted. +
8709`FORCED`, the change was submitted bypassing the submit rule. +
8710`RULE_ERROR`, rule code failed with an error.
8711|`labels`|optional|
8712A list of labels, each containing the following fields. +
8713 * `label`: the label name. +
8714 * `status`: the label status: {`OK`, `REJECT`, `MAY`, `NEED`, `IMPOSSIBLE`}. +
8715 * `appliedBy`: the link:rest-api-accounts.html#account-info[AccountInfo]
8716 that applied the vote to the label.
8717|`requirements`|optional|
8718List of the link:rest-api-changes.html#requirement[requirements] to be met
8719before this change can be submitted.
8720|`error_message`|optional|
8721When status is RULE_ERROR this message provides some text describing
8722the failure of the rule predicate.
8723|===========================
8724
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008725[[submit-requirement-expression-info]]
8726=== SubmitRequirementExpressionInfo
8727The `SubmitRequirementExpressionInfo` describes the result of evaluating a
8728single submit requirement expression, for example `label:code-review=+2`.
8729
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008730[options="header",cols="1,^1,5"]
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008731|===========================
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008732|Field Name ||Description
8733|`expression`|optional|
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008734The submit requirement expression as a string, for example
8735`branch:refs/heads/foo and label:verified=+1`.
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008736|`fulfilled`||
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008737True if the submit requirement is fulfilled for the change.
Youssef Elghareebdf62c5a2022-04-08 12:23:23 +02008738|`status`||
8739A string containing the status of evaluating the expression which can be one
8740of the following: +
8741 * `PASS` - expression was evaluated and result is true. +
8742 * `FAIL` - expression was evaluated and result is false. +
8743 * `ERROR` - an error occurred while evaluating the expression. +
8744 * `NOT_EVALUATED` - expression was not evaluated.
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008745|`passing_atoms`|optional|
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008746A list of passing atoms as strings. For the above expression,
8747`passing_atoms` can contain ["branch:refs/heads/foo"] if the branch predicate is
8748fulfilled for the change.
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008749|`failing_atoms`|optional|
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008750A list of failing atoms. This is similar to `passing_atoms` except that it
8751contains the list of predicates that are not fulfilled for the change.
Youssef Elghareeb393be612021-11-16 13:39:33 +01008752|`error_message`|optional|
8753If the submit requirement fails during evaluation, this string will contain
8754an error message describing why it failed.
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008755|===========================
8756
Youssef Elghareebd5986932021-10-15 11:45:23 +02008757[[submit-requirement-input]]
8758=== SubmitRequirementInput
8759The `SubmitRequirementInput` entity describes a submit requirement.
8760
8761[options="header",cols="1,^1,5"]
8762|===========================
8763|Field Name ||Description
8764|`name`||
8765The submit requirement name.
8766|`description`|optional|
8767Description of the submit requirement.
8768|`applicability_expression`|optional|
8769Query expression that can be evaluated on any change. If evaluated to true on a
8770change, the submit requirement is then applicable for this change.
8771If not specified, the submit requirement is applicable for all changes.
8772|`submittability_expression`||
8773Query expression that can be evaluated on any change. If evaluated to true on a
8774change, the submit requirement is fulfilled and not blocking change submission.
8775|`override_expression`|optional|
8776Query expression that can be evaluated on any change. If evaluated to true on a
8777change, the submit requirement is overridden and not blocking change submission.
8778|`allow_override_in_child_projects`|optional|
8779Whether this submit requirement can be overridden in child projects. Default is
8780`true`.
8781|===========================
8782
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008783[[submit-requirement-result-info]]
8784=== SubmitRequirementResultInfo
8785The `SubmitRequirementResultInfo` describes the result of evaluating a
8786submit requirement on a change.
8787
8788[options="header",cols="1,^1,5"]
8789|===========================
8790|Field Name ||Description
8791|`name`||
8792The submit requirement name.
8793|`description`|optional|
8794Description of the submit requirement.
8795|`status`||
8796Status describing the result of evaluating the submit requirement. The status
Youssef Elghareebf592ed12021-11-26 15:52:06 +01008797is one of (`SATISFIED`, `UNSATISFIED`, `OVERRIDDEN`, `NOT_APPLICABLE`, `ERROR`,
8798`FORCED`).
Youssef Elghareeb024103e2021-09-06 14:41:04 +02008799|`is_legacy`||
8800If true, this submit requirement result was created from a legacy
8801link:#submit-record[SubmitRecord]. Otherwise, it was created by evaluating a
8802submit requirement.
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008803|`applicability_expression_result`|optional|
8804A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo]
8805containing the result of evaluating the applicability expression. Not set if the
8806submit requirement did not define an applicability expression.
Youssef Elghareeb08d4cae2021-10-27 15:43:05 +02008807Note that fields `expression`, `passing_atoms` and `failing_atoms` are always
8808omitted for the `applicability_expression_result`.
Youssef Elghareebdf62c5a2022-04-08 12:23:23 +02008809|`submittability_expression_result`||
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008810A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo]
Marija Savtchouk6d87bae2022-01-20 17:06:22 +00008811containing the result of evaluating the submittability expression. +
Youssef Elghareebdf62c5a2022-04-08 12:23:23 +02008812If the submit requirement does not apply, the `status` field of the result
8813will be set to `NOT_EVALUATED`.
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008814|`override_expression_result`|optional|
8815A link:#submit-requirement-expression-info[SubmitRequirementExpressionInfo]
Marija Savtchouk6d87bae2022-01-20 17:06:22 +00008816containing the result of evaluating the override expression. +
Youssef Elghareebdf62c5a2022-04-08 12:23:23 +02008817Not set if the submit requirement did not define an override expression. If the
8818submit requirement does not apply, the `status` field of the result will be set
8819to `NOT_EVALUATED`.
Youssef Elghareeb79f473622021-05-26 18:58:40 +02008820|===========================
8821
Jonathan Nieder2a629b02016-06-16 15:15:25 -07008822[[submitted-together-info]]
8823=== SubmittedTogetherInfo
8824The `SubmittedTogetherInfo` entity contains information about a
8825collection of changes that would be submitted together.
8826
8827[options="header",cols="1,6"]
8828|===========================
8829|Field Name |Description
8830|`changes` |
8831A list of ChangeInfo entities representing the changes to be submitted together.
8832|`non_visible_changes`|
8833The number of changes to be submitted together that the current user
8834cannot see. (This count includes changes that are visible to the
8835current user when their reason for being submitted together involves
8836changes the user cannot see.)
8837|===========================
8838
Edwin Kempin521c1242015-01-23 12:44:44 +01008839[[suggested-reviewer-info]]
8840=== SuggestedReviewerInfo
8841The `SuggestedReviewerInfo` entity contains information about a reviewer
8842that can be added to a change (an account or a group).
8843
8844`SuggestedReviewerInfo` has either the `account` field that contains
8845the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
8846the `group` field that contains the
8847link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
8848
Logan Hanksab3c81e2016-07-20 15:42:52 -07008849[options="header",cols="1,^1,5"]
8850|===========================
8851|Field Name ||Description
8852|`account` |optional|
8853An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the
8854suggestion is an account.
8855|`group` |optional|
8856A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the
8857suggestion is a group.
8858|`count` ||
8859The total number of accounts in the suggestion. This is `1` if `account` is
8860present. If `group` is present, the total number of accounts that are
8861members of the group is returned (this count includes members of nested
8862groups).
8863|`confirm` |optional|
8864True if `group` is present and `count` is above the threshold where the
8865`confirmed` flag must be passed to add the group as a reviewer.
8866|===========================
8867
Edwin Kempin64006bb2013-02-22 08:17:04 +01008868[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008869=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01008870The `TopicInput` entity contains information for setting a topic.
8871
David Pursehouseae367192014-11-25 17:24:47 +09008872[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01008873|===========================
8874|Field Name ||Description
8875|`topic` |optional|The topic. +
8876The topic will be deleted if not set.
Gal Paikin44dbd7e2020-04-15 15:23:44 +02008877Topic can't contain quotation marks.
Edwin Kempin64006bb2013-02-22 08:17:04 +01008878|===========================
8879
Makson Lee3568a932017-08-28 17:12:03 +08008880[[tracking-id-info]]
8881=== TrackingIdInfo
8882The `TrackingIdInfo` entity describes a reference to an external tracking system.
8883
8884[options="header",cols="1,6"]
8885|======================
8886|Field Name|Description
8887|`system` |The name of the external tracking system.
8888|`id` |The tracking id.
8889|======================
8890
Oleg Aravinbf313bb2016-10-24 12:28:56 -07008891[[voting-range-info]]
8892=== VotingRangeInfo
8893The `VotingRangeInfo` entity describes the continuous voting range from min
8894to max values.
8895
8896[options="header",cols="1,6"]
8897|======================
8898|Field Name|Description
8899|`min` |The minimum voting value.
8900|`max` |The maximum voting value.
8901|======================
8902
Edwin Kempinbd885ff2014-04-11 16:11:56 +02008903[[web-link-info]]
8904=== WebLinkInfo
8905The `WebLinkInfo` entity describes a link to an external site.
8906
Edwin Kempinaf35ce42021-01-29 13:50:04 +01008907[options="header",cols="1,^1,5"]
8908|========================
8909|Field Name ||Description
8910|`name` ||The link name.
8911|`url` ||The link URL.
8912|`image_url`|optional|URL to the icon of the link.
8913|`target` |optional|The target window in which the web link should be opened.
8914|========================
Edwin Kempinbd885ff2014-04-11 16:11:56 +02008915
Alan Tokaev392cfca2017-04-28 11:11:31 +02008916[[work-in-progress-input]]
8917=== WorkInProgressInput
8918The `WorkInProgressInput` entity contains additional information for a change
8919set to WorkInProgress/ReadyForReview.
8920
8921[options="header",cols="1,^1,5"]
8922|=============================
8923|Field Name ||Description
8924|`message` |optional|
8925Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview.
8926|=============================
8927
Edwin Kempind0a63922013-01-23 16:32:59 +01008928GERRIT
8929------
8930Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07008931
8932SEARCHBOX
8933---------