blob: 84624e308ad9527f0497c52f14f26f0b0ca64392 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Gerrit Code Review - /changes/ REST API
Edwin Kempind0a63922013-01-23 16:32:59 +01002
3This page describes the change related REST endpoints.
4Please also take note of the general information on the
5link:rest-api.html[REST API].
6
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01007[[change-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08008== Change Endpoints
Edwin Kempind0a63922013-01-23 16:32:59 +01009
David Ostrovsky837c0ee2014-04-27 12:54:20 +020010[[create-change]]
11=== Create Change
12--
13'POST /changes'
14--
15
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -080016The change input link:#change-input[ChangeInput] entity must be provided in the
17request body.
David Ostrovsky837c0ee2014-04-27 12:54:20 +020018
19.Request
20----
21 POST /changes HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +090022 Content-Type: application/json; charset=UTF-8
David Ostrovsky837c0ee2014-04-27 12:54:20 +020023
24 {
25 "project" : "myProject",
26 "subject" : "Let's support 100% Gerrit workflow direct in browser",
27 "branch" : "master",
28 "topic" : "create-change-in-browser",
29 "status" : "DRAFT"
30 }
31----
32
33As response a link:#change-info[ChangeInfo] entity is returned that describes
34the resulting change.
35
36.Response
37----
38 HTTP/1.1 200 OK
39 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090040 Content-Type: application/json; charset=UTF-8
David Ostrovsky837c0ee2014-04-27 12:54:20 +020041
42 )]}'
43 {
David Ostrovsky837c0ee2014-04-27 12:54:20 +020044 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
45 "project": "myProject",
46 "branch": "master",
47 "topic": "create-change-in-browser",
48 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
49 "subject": "Let's support 100% Gerrit workflow direct in browser",
50 "status": "DRAFT",
51 "created": "2014-05-05 07:15:44.639000000",
52 "updated": "2014-05-05 07:15:44.639000000",
53 "mergeable": true,
54 "insertions": 0,
55 "deletions": 0,
David Ostrovsky837c0ee2014-04-27 12:54:20 +020056 "_number": 4711,
57 "owner": {
58 "name": "John Doe"
59 }
60 }
61----
62
Edwin Kempin76202742013-02-15 13:51:50 +010063[[list-changes]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -080064=== Query Changes
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080065--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010066'GET /changes/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -080067--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +010068
Saša Živkovdd804022014-06-23 16:44:03 +020069Queries changes visible to the caller. The
70link:user-search.html#_search_operators[query string] must be provided
71by the `q` parameter. The `n` parameter can be used to limit the
72returned results.
Edwin Kempind0a63922013-01-23 16:32:59 +010073
Edwin Kempine3446292013-02-19 16:40:14 +010074As result a list of link:#change-info[ChangeInfo] entries is returned.
75The change output is sorted by the last update time, most recently
76updated to oldest updated.
77
Edwin Kempind0a63922013-01-23 16:32:59 +010078Query for open changes of watched projects:
Edwin Kempin37440832013-02-06 11:36:00 +010079
80.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010081----
Edwin Kempin2091edb2013-01-23 19:07:38 +010082 GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010083----
Edwin Kempind0a63922013-01-23 16:32:59 +010084
Edwin Kempin37440832013-02-06 11:36:00 +010085.Response
86----
Edwin Kempind0a63922013-01-23 16:32:59 +010087 HTTP/1.1 200 OK
88 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +090089 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +010090
91 )]}'
John Spurlockd25fad12013-03-09 11:48:49 -050092 [
93 {
John Spurlockd25fad12013-03-09 11:48:49 -050094 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
95 "project": "demo",
96 "branch": "master",
97 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
98 "subject": "One change",
99 "status": "NEW",
100 "created": "2012-07-17 07:18:30.854000000",
101 "updated": "2012-07-17 07:19:27.766000000",
John Spurlockd25fad12013-03-09 11:48:49 -0500102 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100103 "insertions": 26,
104 "deletions": 10,
John Spurlockd25fad12013-03-09 11:48:49 -0500105 "_number": 1756,
106 "owner": {
107 "name": "John Doe"
108 },
Edwin Kempind0a63922013-01-23 16:32:59 +0100109 },
John Spurlockd25fad12013-03-09 11:48:49 -0500110 {
John Spurlockd25fad12013-03-09 11:48:49 -0500111 "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501",
112 "project": "demo",
113 "branch": "master",
114 "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501",
115 "subject": "Another change",
116 "status": "NEW",
117 "created": "2012-07-17 07:18:30.884000000",
118 "updated": "2012-07-17 07:18:30.885000000",
119 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100120 "insertions": 12,
121 "deletions": 18,
John Spurlockd25fad12013-03-09 11:48:49 -0500122 "_number": 1757,
123 "owner": {
124 "name": "John Doe"
125 },
126 "_more_changes": true
127 }
128 ]
Edwin Kempind0a63922013-01-23 16:32:59 +0100129----
130
Sebastian Schuberth02bafe02016-01-20 21:38:11 +0100131If the number of changes matching the query exceeds either the internal
132limit or a supplied `n` query parameter, the last change object has a
David Pursehouse025ea3e2014-09-03 10:47:34 +0900133`_more_changes: true` JSON field set.
134
135The `S` or `start` query parameter can be supplied to skip a number
136of changes from the list.
Edwin Kempind0a63922013-01-23 16:32:59 +0100137
138Clients are allowed to specify more than one query by setting the `q`
139parameter multiple times. In this case the result is an array of
140arrays, one per query in the same order the queries were given in.
141
Edwin Kempina64c4b92013-01-23 11:30:40 +0100142.Query for the 25 most recent open changes of the projects that you watch
143****
144get::/changes/?q=status:open+is:watched&n=25
145****
146
Edwin Kempind0a63922013-01-23 16:32:59 +0100147Query that retrieves changes for a user's dashboard:
Edwin Kempin37440832013-02-06 11:36:00 +0100148
149.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100150----
151 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 +0100152----
Edwin Kempind0a63922013-01-23 16:32:59 +0100153
Edwin Kempin37440832013-02-06 11:36:00 +0100154.Response
155----
Edwin Kempind0a63922013-01-23 16:32:59 +0100156 HTTP/1.1 200 OK
157 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900158 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100159
160 )]}'
161 [
162 [
163 {
Edwin Kempind0a63922013-01-23 16:32:59 +0100164 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
165 "project": "demo",
166 "branch": "master",
167 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
168 "subject": "One change",
169 "status": "NEW",
170 "created": "2012-07-17 07:18:30.854000000",
171 "updated": "2012-07-17 07:19:27.766000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100172 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100173 "insertions": 4,
174 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100175 "_number": 1756,
176 "owner": {
177 "name": "John Doe"
178 },
179 "labels": {
180 "Verified": {},
181 "Code-Review": {}
182 }
183 }
184 ],
185 [],
186 []
187 ]
188----
189
Edwin Kempina64c4b92013-01-23 11:30:40 +0100190.Query the changes for your user dashboard
191****
192get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS
193****
194
David Pursehouse2cf28432016-08-21 23:20:08 +0900195[[query-options]]
Edwin Kempind0a63922013-01-23 16:32:59 +0100196Additional fields can be obtained by adding `o` parameters, each
197option requires more database lookups and slows down the query
198response time to the client so they are generally disabled by
199default. Optional fields are:
200
Edwin Kempine3446292013-02-19 16:40:14 +0100201[[labels]]
202--
Edwin Kempind0a63922013-01-23 16:32:59 +0100203* `LABELS`: a summary of each label required for submit, and
204 approvers that have granted (or rejected) with that label.
Edwin Kempine3446292013-02-19 16:40:14 +0100205--
Edwin Kempind0a63922013-01-23 16:32:59 +0100206
Edwin Kempine3446292013-02-19 16:40:14 +0100207[[detailed-labels]]
208--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800209* `DETAILED_LABELS`: detailed label information, including numeric
Dave Borowitz992ddd72013-02-13 11:53:17 -0800210 values of all existing approvals, recognized label values, values
Edwin Kempin66af3d82015-11-10 17:38:40 -0800211 permitted to be set by the current user, all reviewers by state, and
212 reviewers that may be removed by the current user.
Edwin Kempine3446292013-02-19 16:40:14 +0100213--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800214
Edwin Kempine3446292013-02-19 16:40:14 +0100215[[current-revision]]
216--
Edwin Kempind0a63922013-01-23 16:32:59 +0100217* `CURRENT_REVISION`: describe the current revision (patch set)
218 of the change, including the commit SHA-1 and URLs to fetch from.
Edwin Kempine3446292013-02-19 16:40:14 +0100219--
Edwin Kempind0a63922013-01-23 16:32:59 +0100220
Edwin Kempine3446292013-02-19 16:40:14 +0100221[[all-revisions]]
222--
Edwin Kempind0a63922013-01-23 16:32:59 +0100223* `ALL_REVISIONS`: describe all revisions, not just current.
Edwin Kempine3446292013-02-19 16:40:14 +0100224--
Edwin Kempind0a63922013-01-23 16:32:59 +0100225
David Pursehouse025c1af2015-11-20 17:02:50 +0900226[[download-commands]]
Edwin Kempinea621482013-10-16 12:58:24 +0200227--
228* `DOWNLOAD_COMMANDS`: include the `commands` field in the
229 link:#fetch-info[FetchInfo] for revisions. Only valid when the
230 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
231--
232
Edwin Kempine3446292013-02-19 16:40:14 +0100233[[current-commit]]
234--
Edwin Kempind0a63922013-01-23 16:32:59 +0100235* `CURRENT_COMMIT`: parse and output all header fields from the
David Pursehouse98006e82013-10-02 10:15:52 +0900236 commit object, including message. Only valid when the
237 `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100238--
Edwin Kempind0a63922013-01-23 16:32:59 +0100239
Edwin Kempine3446292013-02-19 16:40:14 +0100240[[all-commits]]
241--
Edwin Kempind0a63922013-01-23 16:32:59 +0100242* `ALL_COMMITS`: parse and output all header fields from the
243 output revisions. If only `CURRENT_REVISION` was requested
244 then only the current revision's commit data will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100245--
Edwin Kempind0a63922013-01-23 16:32:59 +0100246
Edwin Kempine3446292013-02-19 16:40:14 +0100247[[current-files]]
248--
Edwin Kempin8fd96b92016-12-05 16:39:03 +0100249* `CURRENT_FILES`: list files modified by the commit and magic files,
250 including basic line counts inserted/deleted per file. Only valid
251 when the `CURRENT_REVISION` or `ALL_REVISIONS` option is selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100252--
Edwin Kempind0a63922013-01-23 16:32:59 +0100253
Edwin Kempine3446292013-02-19 16:40:14 +0100254[[all-files]]
255--
Edwin Kempin8fd96b92016-12-05 16:39:03 +0100256* `ALL_FILES`: list files modified by the commit and magic files,
257 including basic line counts inserted/deleted per file. If only the
258 `CURRENT_REVISION` was requested then only that commit's modified
259 files will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100260--
Edwin Kempind0a63922013-01-23 16:32:59 +0100261
Edwin Kempine3446292013-02-19 16:40:14 +0100262[[detailed-accounts]]
263--
Edwin Kempin4a00e222013-10-16 14:34:24 +0200264* `DETAILED_ACCOUNTS`: include `_account_id`, `email` and `username`
265 fields when referencing accounts.
Edwin Kempine3446292013-02-19 16:40:14 +0100266--
Dave Borowitz8926a882013-02-01 14:32:48 -0800267
Viktar Donich316bf7a2016-07-06 11:29:01 -0700268[[reviewer-updates]]
269--
270* `REVIEWER_UPDATES`: include updates to reviewers set as
271 link:#review-update-info[ReviewerUpdateInfo] entities.
272--
273
John Spurlock74a70cc2013-03-23 16:41:50 -0400274[[messages]]
275--
276* `MESSAGES`: include messages associated with the change.
277--
278
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700279[[actions]]
280--
281* `CURRENT_ACTIONS`: include information on available actions
Stefan Beller09cd95d2015-02-12 13:40:23 -0800282 for the change and its current revision. Ignored if the caller
283 is not authenticated.
284--
285
286[[change-actions]]
287--
288* `CHANGE_ACTIONS`: include information on available
289 change actions for the change. Ignored if the caller
290 is not authenticated.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -0700291--
292
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700293[[reviewed]]
294--
Dave Borowitz86669b32015-05-27 14:56:10 -0700295* `REVIEWED`: include the `reviewed` field if all of the following are
296 true:
Ardo Septama505f9ad2016-12-06 16:28:00 +0100297 - the change is open
298 - the caller is authenticated
299 - the caller has commented on the change more recently than the last update
Dave Borowitz86669b32015-05-27 14:56:10 -0700300 from the change owner, i.e. this change would show up in the results of
301 link:user-search.html#reviewedby[reviewedby:self].
Shawn Pearce414c5ff2013-09-06 21:51:02 -0700302--
303
Jonathan Niedercb51d742016-09-23 11:37:57 -0700304[[submittable]]
305--
Jonathan Niederad5240f2016-10-04 11:03:23 -0700306* `SUBMITTABLE`: include the `submittable` field in link:#change-info[ChangeInfo],
Jonathan Niedercb51d742016-09-23 11:37:57 -0700307 which can be used to tell if the change is reviewed and ready for submit.
308--
309
Khai Do2a23ec82014-09-19 16:33:02 -0700310[[web-links]]
Sven Selbergae1a10c2014-02-14 14:24:29 +0100311--
Sven Selbergd26bd542014-11-21 16:28:10 +0100312* `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo],
313 therefore only valid in combination with `CURRENT_COMMIT` or
314 `ALL_COMMITS`.
Sven Selbergae1a10c2014-02-14 14:24:29 +0100315--
316
Dave Borowitz4c46c242014-12-03 16:46:45 -0800317[[check]]
318--
319* `CHECK`: include potential problems with the change.
320--
321
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700322[[commit-footers]]
323--
324* `COMMIT_FOOTERS`: include the full commit message with
325 Gerrit-specific commit footers in the
326 link:#revision-info[RevisionInfo].
Yuxuan 'fishy' Wang16baf212015-05-05 16:49:55 -0700327--
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700328
Dave Borowitz6f58dbe2015-09-14 12:34:31 -0400329[[push-certificates]]
330--
331* `PUSH_CERTIFICATES`: include push certificate information in the
332 link:#revision-info[RevisionInfo]. Ignored if signed push is not
333 link:config-gerrit.html#receive.enableSignedPush[enabled] on the
334 server.
335--
336
Edwin Kempin37440832013-02-06 11:36:00 +0100337.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100338----
Edwin Kempinea621482013-10-16 12:58:24 +0200339 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 +0100340----
Edwin Kempind0a63922013-01-23 16:32:59 +0100341
Edwin Kempin37440832013-02-06 11:36:00 +0100342.Response
343----
Edwin Kempind0a63922013-01-23 16:32:59 +0100344 HTTP/1.1 200 OK
345 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900346 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100347
348 )]}'
349 [
350 {
David Pursehousec3be6ad2014-07-18 12:03:06 +0900351 "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
Edwin Kempind0a63922013-01-23 16:32:59 +0100352 "project": "gerrit",
353 "branch": "master",
354 "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
355 "subject": "Use an EventBus to manage star icons",
356 "status": "NEW",
357 "created": "2012-04-25 00:52:25.580000000",
358 "updated": "2012-04-25 00:52:25.586000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100359 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100360 "insertions": 16,
361 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100362 "_number": 97,
363 "owner": {
364 "name": "Shawn Pearce"
365 },
366 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c",
367 "revisions": {
368 "184ebe53805e102605d11f6b143486d15c23a09c": {
David Pursehouse4de41112016-06-28 09:24:08 +0900369 "kind": "REWORK",
Edwin Kempind0a63922013-01-23 16:32:59 +0100370 "_number": 1,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100371 "ref": "refs/changes/97/97/1",
Edwin Kempind0a63922013-01-23 16:32:59 +0100372 "fetch": {
373 "git": {
374 "url": "git://localhost/gerrit",
Edwin Kempinea621482013-10-16 12:58:24 +0200375 "ref": "refs/changes/97/97/1",
376 "commands": {
377 "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
378 "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
379 "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
380 "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1"
381 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100382 },
383 "http": {
Edwin Kempinea621482013-10-16 12:58:24 +0200384 "url": "http://myuser@127.0.0.1:8080/gerrit",
385 "ref": "refs/changes/97/97/1",
386 "commands": {
387 "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
388 "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
389 "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",
390 "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1"
391 }
392 },
393 "ssh": {
394 "url": "ssh://myuser@*:29418/gerrit",
395 "ref": "refs/changes/97/97/1",
396 "commands": {
397 "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
398 "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
399 "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
400 "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1"
401 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100402 }
403 },
404 "commit": {
405 "parents": [
406 {
407 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
408 "subject": "Migrate contributor agreements to All-Projects."
409 }
410 ],
411 "author": {
412 "name": "Shawn O. Pearce",
413 "email": "sop@google.com",
414 "date": "2012-04-24 18:08:08.000000000",
415 "tz": -420
416 },
417 "committer": {
418 "name": "Shawn O. Pearce",
419 "email": "sop@google.com",
420 "date": "2012-04-24 18:08:08.000000000",
421 "tz": -420
422 },
423 "subject": "Use an EventBus to manage star icons",
424 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
425 },
426 "files": {
427 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200428 "lines_deleted": 8,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100429 "size_delta": -412,
430 "size": 7782
Edwin Kempind0a63922013-01-23 16:32:59 +0100431 },
432 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200433 "lines_inserted": 1,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100434 "size_delta": 23,
435 "size": 6762
Edwin Kempind0a63922013-01-23 16:32:59 +0100436 },
437 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": {
438 "lines_inserted": 11,
Edwin Kempin640f9842015-10-08 15:53:20 +0200439 "lines_deleted": 19,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100440 "size_delta": -298,
441 "size": 47023
Edwin Kempind0a63922013-01-23 16:32:59 +0100442 },
443 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": {
444 "lines_inserted": 23,
Edwin Kempin640f9842015-10-08 15:53:20 +0200445 "lines_deleted": 20,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100446 "size_delta": 132,
447 "size": 17727
Edwin Kempind0a63922013-01-23 16:32:59 +0100448 },
449 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": {
450 "status": "D",
Edwin Kempin640f9842015-10-08 15:53:20 +0200451 "lines_deleted": 139,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100452 "size_delta": -5512,
453 "size": 13098
Edwin Kempind0a63922013-01-23 16:32:59 +0100454 },
455 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": {
456 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +0200457 "lines_inserted": 204,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100458 "size_delta": 8345,
459 "size": 8345
Edwin Kempind0a63922013-01-23 16:32:59 +0100460 },
461 "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200462 "lines_deleted": 9,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100463 "size_delta": -343,
464 "size": 5385
Edwin Kempind0a63922013-01-23 16:32:59 +0100465 }
466 }
467 }
468 }
469 }
470 ]
471----
472
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100473[[get-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800474=== Get Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800475--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100476'GET /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800477--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100478
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100479Retrieves a change.
480
Dave Borowitz0314f732013-10-03 09:34:30 -0700481Additional fields can be obtained by adding `o` parameters, each
482option requires more database lookups and slows down the query
483response time to the client so they are generally disabled by
484default. Fields are described in link:#list-changes[Query Changes].
485
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100486.Request
487----
488 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
489----
490
491As response a link:#change-info[ChangeInfo] entity is returned that
492describes the change.
493
494.Response
495----
496 HTTP/1.1 200 OK
497 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900498 Content-Type: application/json; charset=UTF-8
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100499
500 )]}'
501 {
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100502 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
503 "project": "myProject",
504 "branch": "master",
505 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
506 "subject": "Implementing Feature X",
507 "status": "NEW",
508 "created": "2013-02-01 09:59:32.126000000",
509 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100510 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100511 "insertions": 34,
512 "deletions": 101,
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100513 "_number": 3965,
514 "owner": {
515 "name": "John Doe"
516 }
517 }
518----
519
Zhen Chenb1e07e52016-09-23 12:59:48 -0700520[[create-merge-patch-set-for-change]]
521=== Create Merge Patch Set For Change
522--
523'POST /changes/link:#change-id[\{change-id\}]/merge'
524--
525
526Update an existing change by using a
527link:#merge-patch-set-input[MergePatchSetInput] entity.
528
529Gerrit will create a merge commit based on the information of
530MergePatchSetInput and add a new patch set to the change corresponding
531to the new merge commit.
532
533.Request
534----
535 POST /changes/test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc/merge HTTP/1.0
536 Content-Type: application/json; charset=UTF-8
537
538 {
539 "source": "refs/12/1234/1"
540 }
541----
542
543As response a link:#change-info[ChangeInfo] entity with current revision is
544returned that describes the resulting change.
545
546.Response
547----
548 HTTP/1.1 200 OK
549 Content-Disposition: attachment
550 Content-Type: application/json; charset=UTF-8
551
552 )]}'
553 {
554 "id": "test~master~Ic5466d107c5294414710935a8ef3b0180fb848dc",
555 "project": "test",
556 "branch": "master",
557 "hashtags": [],
558 "change_id": "Ic5466d107c5294414710935a8ef3b0180fb848dc",
559 "subject": "Merge dev_branch into master",
560 "status": "NEW",
561 "created": "2016-09-23 18:08:53.238000000",
562 "updated": "2016-09-23 18:09:25.934000000",
563 "submit_type": "MERGE_IF_NECESSARY",
564 "mergeable": true,
565 "insertions": 5,
566 "deletions": 0,
567 "_number": 72,
568 "owner": {
569 "_account_id": 1000000
570 },
571 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822"
572 }
573----
574
Edwin Kempin8e492202013-02-21 15:38:25 +0100575[[get-change-detail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800576=== Get Change Detail
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800577--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100578'GET /changes/link:#change-id[\{change-id\}]/detail'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800579--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100580
Edwin Kempin8e492202013-02-21 15:38:25 +0100581Retrieves a change with link:#labels[labels], link:#detailed-labels[
Viktar Donich316bf7a2016-07-06 11:29:01 -0700582detailed labels], link:#detailed-accounts[detailed accounts],
583link:#reviewer-updates[reviewer updates], and link:#messages[messages].
Edwin Kempin8e492202013-02-21 15:38:25 +0100584
Shawn Pearce7f3dccf2013-07-06 19:24:29 -0700585Additional fields can be obtained by adding `o` parameters, each
586option requires more database lookups and slows down the query
587response time to the client so they are generally disabled by
588default. Fields are described in link:#list-changes[Query Changes].
589
Edwin Kempin8e492202013-02-21 15:38:25 +0100590.Request
591----
592 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0
593----
594
595As response a link:#change-info[ChangeInfo] entity is returned that
Khai Doad632012014-06-22 08:29:57 -0700596describes the change. This response will contain all votes for each
597label and include one combined vote. The combined label vote is
598calculated in the following order (from highest to lowest):
599REJECTED > APPROVED > DISLIKED > RECOMMENDED.
Edwin Kempin8e492202013-02-21 15:38:25 +0100600
601.Response
602----
603 HTTP/1.1 200 OK
604 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900605 Content-Type: application/json; charset=UTF-8
Edwin Kempin8e492202013-02-21 15:38:25 +0100606
607 )]}'
608 {
Edwin Kempin8e492202013-02-21 15:38:25 +0100609 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
610 "project": "myProject",
611 "branch": "master",
612 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
613 "subject": "Implementing Feature X",
614 "status": "NEW",
615 "created": "2013-02-01 09:59:32.126000000",
616 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempin8e492202013-02-21 15:38:25 +0100617 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100618 "insertions": 126,
619 "deletions": 11,
Edwin Kempin8e492202013-02-21 15:38:25 +0100620 "_number": 3965,
621 "owner": {
622 "_account_id": 1000096,
623 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200624 "email": "john.doe@example.com",
625 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100626 },
627 "labels": {
628 "Verified": {
629 "all": [
630 {
631 "value": 0,
632 "_account_id": 1000096,
633 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200634 "email": "john.doe@example.com",
635 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100636 },
637 {
638 "value": 0,
639 "_account_id": 1000097,
640 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200641 "email": "jane.roe@example.com",
642 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100643 }
644 ],
645 "values": {
646 "-1": "Fails",
647 " 0": "No score",
648 "+1": "Verified"
649 }
650 },
651 "Code-Review": {
Edwin Kempin8e492202013-02-21 15:38:25 +0100652 "disliked": {
653 "_account_id": 1000096,
654 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200655 "email": "john.doe@example.com",
656 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100657 },
658 "all": [
659 {
660 "value": -1,
661 "_account_id": 1000096,
662 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200663 "email": "john.doe@example.com",
664 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100665 },
666 {
667 "value": 1,
668 "_account_id": 1000097,
669 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200670 "email": "jane.roe@example.com",
671 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100672 }
673 ]
674 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +0400675 "-2": "This shall not be merged",
676 "-1": "I would prefer this is not merged as is",
Edwin Kempin8e492202013-02-21 15:38:25 +0100677 " 0": "No score",
678 "+1": "Looks good to me, but someone else must approve",
679 "+2": "Looks good to me, approved"
680 }
681 }
682 },
683 "permitted_labels": {
684 "Verified": [
685 "-1",
686 " 0",
687 "+1"
688 ],
689 "Code-Review": [
690 "-2",
691 "-1",
692 " 0",
693 "+1",
694 "+2"
695 ]
696 },
697 "removable_reviewers": [
698 {
699 "_account_id": 1000096,
700 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200701 "email": "john.doe@example.com",
702 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100703 },
704 {
705 "_account_id": 1000097,
706 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200707 "email": "jane.roe@example.com",
708 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100709 }
John Spurlock74a70cc2013-03-23 16:41:50 -0400710 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -0800711 "reviewers": {
712 "REVIEWER": [
713 {
714 "_account_id": 1000096,
715 "name": "John Doe",
716 "email": "john.doe@example.com",
717 "username": "jdoe"
718 },
719 {
720 "_account_id": 1000097,
721 "name": "Jane Roe",
722 "email": "jane.roe@example.com",
723 "username": "jroe"
724 }
725 ]
726 },
Viktar Donich316bf7a2016-07-06 11:29:01 -0700727 "reviewer_updates": [
728 {
729 "state": "REVIEWER",
730 "reviewer": {
731 "_account_id": 1000096,
732 "name": "John Doe",
733 "email": "john.doe@example.com",
734 "username": "jdoe"
735 },
736 "updated_by": {
737 "_account_id": 1000096,
738 "name": "John Doe",
739 "email": "john.doe@example.com",
740 "username": "jdoe"
741 },
742 "updated": "2016-07-21 20:12:39.000000000"
743 },
744 {
745 "state": "REMOVED",
746 "reviewer": {
747 "_account_id": 1000096,
748 "name": "John Doe",
749 "email": "john.doe@example.com",
750 "username": "jdoe"
751 },
752 "updated_by": {
753 "_account_id": 1000096,
754 "name": "John Doe",
755 "email": "john.doe@example.com",
756 "username": "jdoe"
757 },
758 "updated": "2016-07-21 20:12:33.000000000"
759 },
760 {
761 "state": "CC",
762 "reviewer": {
763 "_account_id": 1000096,
764 "name": "John Doe",
765 "email": "john.doe@example.com",
766 "username": "jdoe"
767 },
768 "updated_by": {
769 "_account_id": 1000096,
770 "name": "John Doe",
771 "email": "john.doe@example.com",
772 "username": "jdoe"
773 },
774 "updated": "2016-03-23 21:34:02.419000000",
775 },
776 ],
John Spurlock74a70cc2013-03-23 16:41:50 -0400777 "messages": [
778 {
779 "id": "YH-egE",
780 "author": {
781 "_account_id": 1000096,
782 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200783 "email": "john.doe@example.com",
784 "username": "jdoe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400785 },
786 "updated": "2013-03-23 21:34:02.419000000",
787 "message": "Patch Set 1:\n\nThis is the first message.",
788 "revision_number": 1
789 },
790 {
791 "id": "WEEdhU",
792 "author": {
793 "_account_id": 1000097,
794 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200795 "email": "jane.roe@example.com",
796 "username": "jroe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400797 },
798 "updated": "2013-03-23 21:36:52.332000000",
799 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
800 "revision_number": 1
801 }
Edwin Kempin8e492202013-02-21 15:38:25 +0100802 ]
803 }
804----
805
Edwin Kempin64006bb2013-02-22 08:17:04 +0100806[[get-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800807=== Get Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800808--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100809'GET /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800810--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100811
Edwin Kempin64006bb2013-02-22 08:17:04 +0100812Retrieves the topic of a change.
813
814.Request
815----
816 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
817----
818
819.Response
820----
821 HTTP/1.1 200 OK
822 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900823 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100824
825 )]}'
826 "Documentation"
827----
828
829If the change does not have a topic an empty string is returned.
830
831[[set-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800832=== Set Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800833--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100834'PUT /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800835--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100836
Edwin Kempin64006bb2013-02-22 08:17:04 +0100837Sets the topic of a change.
838
839The new topic must be provided in the request body inside a
840link:#topic-input[TopicInput] entity.
841
842.Request
843----
844 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900845 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100846
847 {
848 "topic": "Documentation"
849 }
850----
851
852As response the new topic is returned.
853
854.Response
855----
856 HTTP/1.1 200 OK
857 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900858 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100859
860 )]}'
861 "Documentation"
862----
863
864If the topic was deleted the response is "`204 No Content`".
865
866[[delete-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800867=== Delete Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800868--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100869'DELETE /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800870--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100871
Edwin Kempin64006bb2013-02-22 08:17:04 +0100872Deletes the topic of a change.
873
Edwin Kempin64006bb2013-02-22 08:17:04 +0100874Please note that some proxies prohibit request bodies for DELETE
875requests. In this case, if you want to specify a commit message, use
876link:#set-topic[PUT] to delete the topic.
877
878.Request
879----
880 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
881----
882
883.Response
884----
885 HTTP/1.1 204 No Content
886----
887
Sven Selberg273a4aa2016-09-21 16:28:10 +0200888[[get-assignee]]
889=== Get Assignee
890--
891'GET /changes/link:#change-id[\{change-id\}]/assignee'
892--
893
894Retrieves the account of the user assigned to a change.
895
896.Request
897----
898 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
899----
900
901As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
902describing the assigned account is returned.
903
904.Response
905----
906 HTTP/1.1 200 OK
907 Content-Disposition: attachment
908 Content-Type: application/json; charset=UTF-8
909
910 )]}'
911 {
912 "_account_id": 1000096,
913 "name": "John Doe",
914 "email": "john.doe@example.com",
915 "username": "jdoe"
916 }
917----
918
919If the change has no assignee the response is "`204 No Content`".
920
921[[get-past-assignees]]
922=== Get Past Assignees
923--
924'GET /changes/link:#change-id[\{change-id\}]/past_assignees'
925--
926
927Returns a list of every user ever assigned to a change, in the order in which
928they were first assigned.
929
930.Request
931----
932 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/past_assignees HTTP/1.0
933----
934
935As a response a list of link:rest-api-accounts.html#account-info[AccountInfo]
936entities is returned.
937
938.Response
939----
940 HTTP/1.1 200 OK
941 Content-Disposition: attachment
942 Content-Type: application/json; charset=UTF-8
943
944 )]}'
945 [
946 {
947 "_account_id": 1000051,
948 "name": "Jane Doe",
949 "email": "jane.doe@example.com",
950 "username": "janed"
951 },
952 {
953 "_account_id": 1000096,
954 "name": "John Doe",
955 "email": "john.doe@example.com",
956 "username": "jdoe"
957 }
958 ]
959
960----
961
962
963[[set-assignee]]
964=== Set Assignee
965--
966'PUT /changes/link:#change-id[\{change-id\}]/assignee'
967--
968
969Sets the assignee of a change.
970
971The new assignee must be provided in the request body inside a
972link:#assignee-input[AssigneeInput] entity.
973
974.Request
975----
976 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
977 Content-Type: application/json; charset=UTF-8
978
979 {
980 "assignee": "jdoe"
981 }
982----
983
984As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
985describing the assigned account is returned.
986
987.Response
988----
989 HTTP/1.1 200 OK
990 Content-Disposition: attachment
991 Content-Type: application/json; charset=UTF-8
992
993 )]}'
994 {
995 "_account_id": 1000096,
996 "name": "John Doe",
997 "email": "john.doe@example.com",
998 "username": "jdoe"
999 }
1000----
1001
1002[[delete-assignee]]
1003=== Delete Assignee
1004--
1005'DELETE /changes/link:#change-id[\{change-id\}]/assignee'
1006--
1007
1008Deletes the assignee of a change.
1009
1010
1011.Request
1012----
1013 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/assignee HTTP/1.0
1014----
1015
1016As a response an link:rest-api-accounts.html#account-info[AccountInfo] entity
1017describing the account of the deleted assignee is returned.
1018
1019.Response
1020----
1021 HTTP/1.1 200 OK
1022 Content-Disposition: attachment
1023 Content-Type: application/json; charset=UTF-8
1024
1025 )]}'
1026 {
1027 "_account_id": 1000096,
1028 "name": "John Doe",
1029 "email": "john.doe@example.com",
1030 "username": "jdoe"
1031 }
1032----
1033
1034If the change had no assignee the response is "`204 No Content`".
1035
Edwin Kempined5364b2013-02-22 10:39:33 +01001036[[abandon-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001037=== Abandon Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001038--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001039'POST /changes/link:#change-id[\{change-id\}]/abandon'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001040--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001041
Edwin Kempined5364b2013-02-22 10:39:33 +01001042Abandons a change.
1043
1044The request body does not need to include a link:#abandon-input[
1045AbandonInput] entity if no review comment is added.
1046
1047.Request
1048----
1049 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0
1050----
1051
1052As response a link:#change-info[ChangeInfo] entity is returned that
1053describes the abandoned change.
1054
1055.Response
1056----
1057 HTTP/1.1 200 OK
1058 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001059 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001060
1061 )]}'
1062 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001063 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1064 "project": "myProject",
1065 "branch": "master",
1066 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1067 "subject": "Implementing Feature X",
1068 "status": "ABANDONED",
1069 "created": "2013-02-01 09:59:32.126000000",
1070 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001071 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001072 "insertions": 3,
1073 "deletions": 310,
Edwin Kempined5364b2013-02-22 10:39:33 +01001074 "_number": 3965,
1075 "owner": {
1076 "name": "John Doe"
1077 }
1078 }
1079----
1080
1081If the change cannot be abandoned because the change state doesn't
1082allow abandoning of the change, the response is "`409 Conflict`" and
1083the error message is contained in the response body.
1084
1085.Response
1086----
1087 HTTP/1.1 409 Conflict
1088 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001089 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001090
1091 change is merged
1092----
1093
Logan Hankse43b68e2017-05-23 13:16:22 -07001094.Notifications
1095
1096An email will be sent using the "abandon" template. The notify handling is ALL.
1097Notifications are suppressed on WIP changes that have never started review.
1098
Logan Hanks87607412017-05-30 13:49:04 -07001099[options="header",cols="1,2"]
Logan Hankse43b68e2017-05-23 13:16:22 -07001100|=============================
Logan Hanks87607412017-05-30 13:49:04 -07001101|WIP State |notify=ALL
Logan Hankse43b68e2017-05-23 13:16:22 -07001102|Ready for review|owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1103|Work in progress|not sent
1104|Reviewable WIP |owner, reviewers, CCs, stars, ABANDONED_CHANGES watchers
1105|=============================
1106
Edwin Kempined5364b2013-02-22 10:39:33 +01001107[[restore-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001108=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001109--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001110'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001111--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001112
Edwin Kempined5364b2013-02-22 10:39:33 +01001113Restores a change.
1114
1115The request body does not need to include a link:#restore-input[
1116RestoreInput] entity if no review comment is added.
1117
1118.Request
1119----
1120 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
1121----
1122
1123As response a link:#change-info[ChangeInfo] entity is returned that
1124describes the restored change.
1125
1126.Response
1127----
1128 HTTP/1.1 200 OK
1129 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001130 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001131
1132 )]}'
1133 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001134 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1135 "project": "myProject",
1136 "branch": "master",
1137 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1138 "subject": "Implementing Feature X",
1139 "status": "NEW",
1140 "created": "2013-02-01 09:59:32.126000000",
1141 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001142 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001143 "insertions": 2,
1144 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +01001145 "_number": 3965,
1146 "owner": {
1147 "name": "John Doe"
1148 }
1149 }
1150----
1151
1152If the change cannot be restored because the change state doesn't
1153allow restoring the change, the response is "`409 Conflict`" and
1154the error message is contained in the response body.
1155
1156.Response
1157----
1158 HTTP/1.1 409 Conflict
1159 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001160 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001161
1162 change is new
1163----
1164
Edwin Kempincdae63b2013-03-15 15:06:59 +01001165[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001166=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001167--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001168'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001169--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001170
1171Rebases a change.
1172
Zalan Blenessy874aed72015-01-12 13:26:18 +01001173Optionally, the parent revision can be changed to another patch set through the
1174link:#rebase-input[RebaseInput] entity.
1175
Edwin Kempincdae63b2013-03-15 15:06:59 +01001176.Request
1177----
1178 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01001179 Content-Type: application/json;charset=UTF-8
1180
1181 {
1182 "base" : "1234",
1183 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01001184----
1185
1186As response a link:#change-info[ChangeInfo] entity is returned that
1187describes the rebased change. Information about the current patch set
1188is included.
1189
1190.Response
1191----
1192 HTTP/1.1 200 OK
1193 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001194 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001195
1196 )]}'
1197 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01001198 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1199 "project": "myProject",
1200 "branch": "master",
1201 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1202 "subject": "Implement Feature X",
1203 "status": "NEW",
1204 "created": "2013-02-01 09:59:32.126000000",
1205 "updated": "2013-02-21 11:16:36.775000000",
1206 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001207 "insertions": 33,
1208 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +01001209 "_number": 4799,
1210 "owner": {
1211 "name": "John Doe"
1212 },
1213 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
1214 "revisions": {
1215 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09001216 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001217 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01001218 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001219 "fetch": {
1220 "http": {
1221 "url": "http://gerrit:8080/myProject",
1222 "ref": "refs/changes/99/4799/2"
1223 }
1224 },
1225 "commit": {
1226 "parents": [
1227 {
1228 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
1229 "subject": "Implement Feature A"
1230 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00001231 ],
1232 "author": {
1233 "name": "John Doe",
1234 "email": "john.doe@example.com",
1235 "date": "2013-05-07 15:21:27.000000000",
1236 "tz": 120
1237 },
1238 "committer": {
1239 "name": "Gerrit Code Review",
1240 "email": "gerrit-server@example.com",
1241 "date": "2013-05-07 15:35:43.000000000",
1242 "tz": 120
1243 },
1244 "subject": "Implement Feature X",
1245 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01001246 }
1247 }
1248 }
1249----
1250
1251If the change cannot be rebased, e.g. due to conflicts, the response is
1252"`409 Conflict`" and the error message is contained in the response
1253body.
1254
1255.Response
1256----
1257 HTTP/1.1 409 Conflict
1258 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001259 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001260
1261 The change could not be rebased due to a path conflict during merge.
1262----
1263
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301264[[move-change]]
1265=== Move Change
1266--
1267'POST /changes/link:#change-id[\{change-id\}]/move'
1268--
1269
1270Move a change.
1271
1272The destination branch must be provided in the request body inside a
1273link:#move-input[MoveInput] entity.
1274
1275.Request
1276----
1277 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0
1278 Content-Type: application/json; charset=UTF-8
1279
1280 {
1281 "destination_branch" : "release-branch"
1282 }
1283
1284----
1285
1286As response a link:#change-info[ChangeInfo] entity is returned that
1287describes the moved change.
1288
1289.Response
1290----
1291 HTTP/1.1 200 OK
1292 Content-Disposition: attachment
1293 Content-Type: application/json; charset=UTF-8
1294
1295 )]}'
1296 {
1297 "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940",
1298 "project": "myProject",
1299 "branch": "release-branch",
1300 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1301 "subject": "Implementing Feature X",
1302 "status": "NEW",
1303 "created": "2013-02-01 09:59:32.126000000",
1304 "updated": "2013-02-21 11:16:36.775000000",
1305 "mergeable": true,
1306 "insertions": 2,
1307 "deletions": 13,
1308 "_number": 3965,
1309 "owner": {
1310 "name": "John Doe"
1311 }
1312 }
1313----
1314
1315If the change cannot be moved because the change state doesn't
1316allow moving the change, the response is "`409 Conflict`" and
1317the error message is contained in the response body.
1318
1319.Response
1320----
1321 HTTP/1.1 409 Conflict
1322 Content-Disposition: attachment
1323 Content-Type: text/plain; charset=UTF-8
1324
1325 change is merged
1326----
1327
1328If the change cannot be moved because the user doesn't have
1329abandon permission on the change or upload permission on the destination,
1330the response is "`409 Conflict`" and the error message is contained in the
1331response body.
1332
1333.Response
1334----
1335 HTTP/1.1 409 Conflict
1336 Content-Disposition: attachment
1337 Content-Type: text/plain; charset=UTF-8
1338
1339 move not permitted
1340----
1341
Edwin Kempind2ec4152013-02-22 12:17:19 +01001342[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001343=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001344--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001345'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001346--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001347
Edwin Kempind2ec4152013-02-22 12:17:19 +01001348Reverts a change.
1349
1350The request body does not need to include a link:#revert-input[
1351RevertInput] entity if no review comment is added.
1352
1353.Request
1354----
Michael Zhou10270492016-03-24 22:35:40 -04001355 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0
Edwin Kempind2ec4152013-02-22 12:17:19 +01001356----
1357
1358As response a link:#change-info[ChangeInfo] entity is returned that
1359describes the reverting change.
1360
1361.Response
1362----
1363 HTTP/1.1 200 OK
1364 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001365 Content-Type: application/json; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001366
1367 )]}'
1368 {
Edwin Kempind2ec4152013-02-22 12:17:19 +01001369 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1370 "project": "myProject",
1371 "branch": "master",
1372 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1373 "subject": "Revert \"Implementing Feature X\"",
1374 "status": "NEW",
1375 "created": "2013-02-01 09:59:32.126000000",
1376 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempind2ec4152013-02-22 12:17:19 +01001377 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001378 "insertions": 6,
1379 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +01001380 "_number": 3965,
1381 "owner": {
1382 "name": "John Doe"
1383 }
1384 }
1385----
1386
1387If the change cannot be reverted because the change state doesn't
1388allow reverting the change, the response is "`409 Conflict`" and
1389the error message is contained in the response body.
1390
1391.Response
1392----
1393 HTTP/1.1 409 Conflict
1394 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001395 Content-Type: text/plain; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001396
1397 change is new
1398----
1399
Edwin Kempin0eddba02013-02-22 15:30:12 +01001400[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001401=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001402--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001403'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001404--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001405
Edwin Kempin0eddba02013-02-22 15:30:12 +01001406Submits a change.
1407
1408The request body only needs to include a link:#submit-input[
David Pursehousea8f48f82016-03-10 15:27:47 +09001409SubmitInput] entity if submitting on behalf of another user.
Edwin Kempin0eddba02013-02-22 15:30:12 +01001410
1411.Request
1412----
1413 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001414 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001415
1416 {
David Pursehousea8f48f82016-03-10 15:27:47 +09001417 "on_behalf_of": 1001439
Edwin Kempin0eddba02013-02-22 15:30:12 +01001418 }
1419----
1420
1421As response a link:#change-info[ChangeInfo] entity is returned that
1422describes the submitted/merged change.
1423
1424.Response
1425----
1426 HTTP/1.1 200 OK
1427 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001428 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001429
1430 )]}'
1431 {
Edwin Kempin0eddba02013-02-22 15:30:12 +01001432 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1433 "project": "myProject",
1434 "branch": "master",
1435 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1436 "subject": "Implementing Feature X",
1437 "status": "MERGED",
1438 "created": "2013-02-01 09:59:32.126000000",
1439 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001440 "submitted": "2013-02-21 11:16:36.615000000",
Edwin Kempin0eddba02013-02-22 15:30:12 +01001441 "_number": 3965,
1442 "owner": {
1443 "name": "John Doe"
1444 }
1445 }
1446----
1447
1448If the change cannot be submitted because the submit rule doesn't allow
1449submitting the change, the response is "`409 Conflict`" and the error
1450message is contained in the response body.
1451
1452.Response
1453----
1454 HTTP/1.1 409 Conflict
1455 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001456 Content-Type: text/plain; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001457
1458 blocked by Verified
1459----
1460
David Pursehouse025c1af2015-11-20 17:02:50 +09001461[[submitted-together]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001462=== Changes Submitted Together
Stefan Bellera7ad6612015-06-26 10:05:43 -07001463--
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001464'GET /changes/link:#change-id[\{change-id\}]/submitted_together?o=NON_VISIBLE_CHANGES'
Stefan Bellera7ad6612015-06-26 10:05:43 -07001465--
1466
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001467Computes list of all changes which are submitted when
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001468link:#submit-change[Submit] is called for this change,
Stefan Beller460f3542015-07-20 14:10:41 -07001469including the current change itself.
1470
Stefan Bellera7ad6612015-06-26 10:05:43 -07001471The list consists of:
1472
1473* The given change.
1474* If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1475 is enabled, include all open changes with the same topic.
1476* For each change whose submit type is not CHERRY_PICK, include unmerged
1477 ancestors targeting the same branch.
1478
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001479As a special case, the list is empty if this change would be
1480submitted by itself (without other changes).
1481
1482.Request
1483----
1484 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0
1485 Content-Type: application/json; charset=UTF-8
1486----
1487
1488As a response a link:#submitted-together-info[SubmittedTogetherInfo]
1489entity is returned that describes what would happen if the change were
1490submitted. This response contains a list of changes and a count of
1491changes that are not visible to the caller that are part of the set of
1492changes to be merged.
1493
1494The listed changes use the same format as in
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001495link:#list-changes[Query Changes] with the
1496link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`],
Jonathan Niedercb51d742016-09-23 11:37:57 -07001497link:#current-revision[`CURRENT_REVISION`],
1498link:#current-commit[`CURRENT_COMMIT`], and
1499link:#submittable[`SUBMITTABLE`] options set.
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001500
Shawn Pearce8080c3d2016-09-19 19:15:04 -07001501Standard link:#query-options[formatting options] can be specified
1502with the `o` parameter, as well as the `submitted_together` specific
1503option `NON_VISIBLE_CHANGES`.
1504
Stefan Bellera7ad6612015-06-26 10:05:43 -07001505.Response
1506----
1507 HTTP/1.1 200 OK
1508 Content-Disposition: attachment
1509 Content-Type: application/json; charset=UTF-8
1510
1511)]}'
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001512{
1513 "changes": [
1514 {
1515 "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1516 "project": "gerrit",
1517 "branch": "master",
1518 "hashtags": [],
1519 "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1520 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1521 "status": "NEW",
1522 "created": "2015-05-01 15:39:57.979000000",
1523 "updated": "2015-05-20 19:25:21.592000000",
1524 "mergeable": true,
1525 "insertions": 303,
1526 "deletions": 210,
1527 "_number": 1779,
1528 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001529 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001530 },
1531 "labels": {
1532 "Code-Review": {
1533 "approved": {
1534 "_account_id": 1000000
1535 },
1536 "all": [
1537 {
1538 "value": 2,
1539 "date": "2015-05-20 19:25:21.592000000",
1540 "_account_id": 1000000
1541 }
1542 ],
1543 "values": {
1544 "-2": "This shall not be merged",
1545 "-1": "I would prefer this is not merged as is",
1546 " 0": "No score",
1547 "+1": "Looks good to me, but someone else must approve",
1548 "+2": "Looks good to me, approved"
1549 },
1550 "default_value": 0
1551 },
1552 "Verified": {
1553 "approved": {
1554 "_account_id": 1000000
1555 },
1556 "all": [
1557 {
1558 "value": 1,
1559 "date": "2015-05-20 19:25:21.592000000",
1560 "_account_id": 1000000
1561 }
1562 ],
1563 "values": {
1564 "-1": "Fails",
1565 " 0": "No score",
1566 "+1": "Verified"
1567 },
1568 "default_value": 0
1569 }
1570 },
1571 "permitted_labels": {
1572 "Code-Review": [
1573 "-2",
1574 "-1",
1575 " 0",
1576 "+1",
1577 "+2"
1578 ],
1579 "Verified": [
1580 "-1",
1581 " 0",
1582 "+1"
1583 ]
1584 },
1585 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001586 {
1587 "_account_id": 1000000
1588 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001589 ],
1590 "reviewers": {
1591 "REVIEWER": [
1592 {
1593 "_account_id": 1000000
1594 }
1595 ]
1596 },
1597 "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1598 "revisions": {
1599 "9adb9f4c7b40eeee0646e235de818d09164d7379": {
David Pursehouse4de41112016-06-28 09:24:08 +09001600 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001601 "_number": 1,
1602 "created": "2015-05-01 15:39:57.979000000",
1603 "uploader": {
1604 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001605 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001606 "ref": "refs/changes/79/1779/1",
1607 "fetch": {},
1608 "commit": {
1609 "parents": [
1610 {
1611 "commit": "2d3176497a2747faed075f163707e57d9f961a1c",
1612 "subject": "Merge changes from topic \u0027submodule-subscription-tests-and-fixes-3\u0027"
1613 }
1614 ],
1615 "author": {
1616 "name": "Stefan Beller",
1617 "email": "sbeller@google.com",
1618 "date": "2015-04-29 21:36:52.000000000",
1619 "tz": -420
1620 },
1621 "committer": {
1622 "name": "Stefan Beller",
1623 "email": "sbeller@google.com",
1624 "date": "2015-05-01 00:11:16.000000000",
1625 "tz": -420
1626 },
1627 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1628 "message": "ChangeMergeQueue: Rewrite such that it works on set of changes\n\nChangeMergeQueue used to work on branches rather than sets of changes.\nThis change is a first step to merge sets of changes (e.g. grouped by a\ntopic and `changes.submitWholeTopic` enabled) in an atomic fashion.\nThis change doesn\u0027t aim to implement these changes, but only as a step\ntowards it.\n\nMergeOp keeps its functionality and behavior as is. A new class\nMergeOpMapper is introduced which will map the set of changes to\nthe set of branches. Additionally the MergeOpMapper is also\nresponsible for the threading done right now, which was part of\nthe ChangeMergeQueue before.\n\nChange-Id: I1ffe09a505e25f15ce1521bcfb222e51e62c2a14\n"
1629 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001630 }
1631 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001632 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001633 {
1634 "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22",
1635 "project": "gerrit",
1636 "branch": "master",
1637 "hashtags": [],
1638 "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22",
1639 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1640 "status": "NEW",
1641 "created": "2015-05-01 15:39:57.979000000",
1642 "updated": "2015-05-20 19:25:21.546000000",
1643 "mergeable": true,
1644 "insertions": 15,
1645 "deletions": 6,
1646 "_number": 1780,
1647 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001648 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001649 },
1650 "labels": {
1651 "Code-Review": {
1652 "approved": {
1653 "_account_id": 1000000
1654 },
1655 "all": [
1656 {
1657 "value": 2,
1658 "date": "2015-05-20 19:25:21.546000000",
1659 "_account_id": 1000000
1660 }
1661 ],
1662 "values": {
1663 "-2": "This shall not be merged",
1664 "-1": "I would prefer this is not merged as is",
1665 " 0": "No score",
1666 "+1": "Looks good to me, but someone else must approve",
1667 "+2": "Looks good to me, approved"
1668 },
1669 "default_value": 0
1670 },
1671 "Verified": {
1672 "approved": {
1673 "_account_id": 1000000
1674 },
1675 "all": [
1676 {
1677 "value": 1,
1678 "date": "2015-05-20 19:25:21.546000000",
1679 "_account_id": 1000000
1680 }
1681 ],
1682 "values": {
1683 "-1": "Fails",
1684 " 0": "No score",
1685 "+1": "Verified"
1686 },
1687 "default_value": 0
1688 }
1689 },
1690 "permitted_labels": {
1691 "Code-Review": [
1692 "-2",
1693 "-1",
1694 " 0",
1695 "+1",
1696 "+2"
1697 ],
1698 "Verified": [
1699 "-1",
1700 " 0",
1701 "+1"
1702 ]
1703 },
1704 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001705 {
1706 "_account_id": 1000000
1707 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001708 ],
1709 "reviewers": {
1710 "REVIEWER": [
1711 {
1712 "_account_id": 1000000
1713 }
1714 ]
1715 },
1716 "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4",
1717 "revisions": {
1718 "1bd7c12a38854a2c6de426feec28800623f492c4": {
David Pursehouse4de41112016-06-28 09:24:08 +09001719 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001720 "_number": 1,
1721 "created": "2015-05-01 15:39:57.979000000",
1722 "uploader": {
1723 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001724 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001725 "ref": "refs/changes/80/1780/1",
1726 "fetch": {},
1727 "commit": {
1728 "parents": [
1729 {
1730 "commit": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1731 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes"
1732 }
1733 ],
1734 "author": {
1735 "name": "Stefan Beller",
1736 "email": "sbeller@google.com",
1737 "date": "2015-04-25 00:11:59.000000000",
1738 "tz": -420
1739 },
1740 "committer": {
1741 "name": "Stefan Beller",
1742 "email": "sbeller@google.com",
1743 "date": "2015-05-01 00:11:16.000000000",
1744 "tz": -420
1745 },
1746 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1747 "message": "AbstractSubmoduleSubscription: Split up createSubscription\n\nLater we want to have subscriptions to more submodules, so we need to\nfind a way to add more submodule entries into the file. By splitting up\nthe createSubscription() method, that is very easy by using the\naddSubmoduleSubscription method multiple times.\n\nChange-Id: I7fe807e63792b3d26776fd1422e5e790a5697e22\n"
1748 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001749 }
1750 }
1751 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001752 ],
1753 "non_visible_changes": 0
1754}
Stefan Bellera7ad6612015-06-26 10:05:43 -07001755----
1756
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001757If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then
1758instead of a link:#submitted-together-info[SubmittedTogetherInfo]
1759entity, the response is a list of changes, or a 403 response with a
1760message if the set of changes to be submitted with this change
1761includes changes the caller cannot read.
1762
Stefan Bellera7ad6612015-06-26 10:05:43 -07001763
David Ostrovsky0d69c232013-09-10 23:10:23 +02001764[[publish-draft-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001765=== Publish Draft Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001766--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001767'POST /changes/link:#change-id[\{change-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001768--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001769
1770Publishes a draft change.
1771
1772.Request
1773----
1774 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/publish HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001775 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001776----
1777
1778.Response
1779----
1780 HTTP/1.1 204 No Content
1781----
1782
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02001783[[delete-change]]
1784=== Delete Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001785--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001786'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001787--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001788
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02001789Deletes a change.
1790
Paladox none580ae0e2017-02-12 18:15:48 +00001791New or abandoned changes can be deleted by their owner if the user is granted
1792the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission,
1793otherwise only by administrators.
1794
1795Draft changes can only be deleted by their owner or other users who have the
1796permissions to view and delete drafts. If the draft workflow is disabled, only
1797administrators with those permissions may delete draft changes.
David Ostrovsky0d69c232013-09-10 23:10:23 +02001798
1799.Request
1800----
1801 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001802 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001803----
1804
1805.Response
1806----
1807 HTTP/1.1 204 No Content
1808----
1809
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001810[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001811=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001812--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001813'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001814--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001815
1816Retrieves the branches and tags in which a change is included. As result
1817an link:#included-in-info[IncludedInInfo] entity is returned.
1818
1819.Request
1820----
1821 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
1822----
1823
1824.Response
1825----
1826 HTTP/1.1 200 OK
1827 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001828 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001829
1830 )]}'
1831 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001832 "branches": [
1833 "master"
1834 ],
1835 "tags": []
1836 }
1837----
1838
David Pursehouse4e38b972014-05-30 10:36:40 +09001839[[index-change]]
1840=== Index Change
1841--
1842'POST /changes/link:#change-id[\{change-id\}]/index'
1843--
1844
1845Adds or updates the change in the secondary index.
1846
1847.Request
1848----
1849 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
1850----
1851
1852.Response
1853----
1854 HTTP/1.1 204 No Content
1855----
1856
Dave Borowitz23fec2b2015-04-28 17:40:07 -07001857[[list-change-comments]]
1858=== List Change Comments
1859--
1860'GET /changes/link:#change-id[\{change-id\}]/comments'
1861--
1862
1863Lists the published comments of all revisions of the change.
1864
1865Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1866entries. The entries in the map are sorted by file path, and the
1867comments for each path are sorted by patch set number. Each comment has
1868the `patch_set` and `author` fields set.
1869
1870.Request
1871----
1872 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
1873----
1874
1875.Response
1876----
1877 HTTP/1.1 200 OK
1878 Content-Disposition: attachment
1879 Content-Type: application/json; charset=UTF-8
1880
1881 )]}'
1882 {
1883 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1884 {
1885 "patch_set": 1,
1886 "id": "TvcXrmjM",
1887 "line": 23,
1888 "message": "[nit] trailing whitespace",
1889 "updated": "2013-02-26 15:40:43.986000000"
1890 "author": {
1891 "_account_id": 1000096,
1892 "name": "John Doe",
1893 "email": "john.doe@example.com"
1894 }
1895 },
1896 {
1897 "patch_set": 2,
1898 "id": "TveXwFiA",
1899 "line": 49,
1900 "in_reply_to": "TfYX-Iuo",
1901 "message": "Done",
1902 "updated": "2013-02-26 15:40:45.328000000"
1903 "author": {
1904 "_account_id": 1000097,
1905 "name": "Jane Roe",
1906 "email": "jane.roe@example.com"
1907 }
1908 }
1909 ]
1910 }
1911----
1912
Changcheng Xiao9b04c042016-12-28 12:45:29 +01001913[[list-change-robot-comments]]
1914=== List Change Robot Comments
1915--
1916'GET /changes/link:#change-id[\{change-id\}]/robotcomments'
1917--
1918
1919Lists the robot comments of all revisions of the change.
1920
1921Return a map that maps the file path to a list of
1922link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
1923map are sorted by file path.
1924
1925.Request
1926----
1927 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0
1928----
1929
1930.Response
1931----
1932 HTTP/1.1 200 OK
1933 Content-Disposition: attachment
1934 Content-Type: application/json; charset=UTF-8
1935
1936 )]}'
1937 {
1938 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1939 {
1940 "id": "TvcXrmjM",
1941 "line": 23,
1942 "message": "unused import",
1943 "updated": "2016-02-26 15:40:43.986000000",
1944 "author": {
1945 "_account_id": 1000110,
1946 "name": "Code Analyzer",
1947 "email": "code.analyzer@example.com"
1948 },
1949 "robotId": "importChecker",
1950 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
1951 },
1952 {
1953 "id": "TveXwFiA",
1954 "line": 49,
1955 "message": "wrong indention",
1956 "updated": "2016-02-26 15:40:45.328000000",
1957 "author": {
1958 "_account_id": 1000110,
1959 "name": "Code Analyzer",
1960 "email": "code.analyzer@example.com"
1961 },
1962 "robotId": "styleChecker",
1963 "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b"
1964 }
1965 ]
1966 }
1967----
1968
Dave Borowitz23fec2b2015-04-28 17:40:07 -07001969[[list-change-drafts]]
1970=== List Change Drafts
1971--
1972'GET /changes/link:#change-id[\{change-id\}]/drafts'
1973--
1974
1975Lists the draft comments of all revisions of the change that belong to
1976the calling user.
1977
1978Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1979entries. The entries in the map are sorted by file path, and the
1980comments for each path are sorted by patch set number. Each comment has
1981the `patch_set` field set, and no `author`.
1982
1983.Request
1984----
1985 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0
1986----
1987
1988.Response
1989----
1990 HTTP/1.1 200 OK
1991 Content-Disposition: attachment
1992 Content-Type: application/json; charset=UTF-8
1993
1994 )]}'
1995 {
1996 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1997 {
1998 "patch_set": 1,
1999 "id": "TvcXrmjM",
2000 "line": 23,
2001 "message": "[nit] trailing whitespace",
2002 "updated": "2013-02-26 15:40:43.986000000"
2003 },
2004 {
2005 "patch_set": 2,
2006 "id": "TveXwFiA",
2007 "line": 49,
2008 "in_reply_to": "TfYX-Iuo",
2009 "message": "Done",
2010 "updated": "2013-02-26 15:40:45.328000000"
2011 }
2012 ]
2013 }
2014----
2015
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002016[[check-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002017=== Check Change
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002018--
2019'GET /changes/link:#change-id[\{change-id\}]/check'
2020--
2021
2022Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05002023link:#change-info[ChangeInfo] entity with the `problems` field set to a
2024list of link:#problem-info[ProblemInfo] entities.
2025
2026Depending on the type of problem, some fields not marked optional may be
2027missing from the result. At least `id`, `project`, `branch`, and
2028`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002029
2030.Request
2031----
2032 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2033----
2034
2035.Response
2036----
2037 HTTP/1.1 200 OK
2038 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002039 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002040
2041 )]}'
2042 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05002043 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2044 "project": "myProject",
2045 "branch": "master",
2046 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2047 "subject": "Implementing Feature X",
2048 "status": "NEW",
2049 "created": "2013-02-01 09:59:32.126000000",
2050 "updated": "2013-02-21 11:16:36.775000000",
2051 "mergeable": true,
2052 "insertions": 34,
2053 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05002054 "_number": 3965,
2055 "owner": {
2056 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002057 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05002058 "problems": [
2059 {
2060 "message": "Current patch set 1 not found"
2061 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002062 ]
2063 }
2064----
2065
Dave Borowitz3be39d02014-12-03 17:57:38 -08002066[[fix-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002067=== Fix Change
Dave Borowitz3be39d02014-12-03 17:57:38 -08002068--
2069'POST /changes/link:#change-id[\{change-id\}]/check'
2070--
2071
2072Performs consistency checks on the change as with link:#check-change[GET
2073/check], and additionally fixes any problems that can be fixed
2074automatically. The returned field values reflect any fixes.
2075
Dave Borowitzbad53ee2015-06-11 10:10:18 -04002076Some fixes have options controlling their behavior, which can be set in the
2077link:#fix-input[FixInput] entity body.
2078
Dave Borowitz3be39d02014-12-03 17:57:38 -08002079Only the change owner, a project owner, or an administrator may fix changes.
2080
2081.Request
2082----
2083 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2084----
2085
2086.Response
2087----
2088 HTTP/1.1 200 OK
2089 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002090 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08002091
2092 )]}'
2093 {
2094 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2095 "project": "myProject",
2096 "branch": "master",
2097 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2098 "subject": "Implementing Feature X",
2099 "status": "MERGED",
2100 "created": "2013-02-01 09:59:32.126000000",
2101 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08002102 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08002103 "mergeable": true,
2104 "insertions": 34,
2105 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08002106 "_number": 3965,
2107 "owner": {
2108 "name": "John Doe"
2109 },
2110 "problems": [
2111 {
2112 "message": "Current patch set 2 not found"
2113 },
2114 {
2115 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
2116 "status": FIXED,
2117 "outcome": "Marked change as merged"
2118 }
2119 ]
2120 }
2121----
2122
Alan Tokaev392cfca2017-04-28 11:11:31 +02002123[[set-work-in-pogress]]
2124== Set Work-In-Progress
2125--
2126'POST /changes/link:#change-id[\{change-id\}]/wip'
2127--
2128
2129Marks the change as not ready for review yet.
2130
2131The request body does not need to include a
2132link:#work-in-progress-input[WorkInProgressInput] entity if no review comment
2133is added. Actions that create a new patch set in a WIP change default to
2134notifying *OWNER* instead of *ALL*.
2135
2136.Request
2137----
2138 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/wip HTTP/1.0
2139 Content-Type: application/json; charset=UTF-8
2140
2141 {
2142 "message": "Refactoring needs to be done before we can proceed here."
2143 }
2144----
2145
2146.Response
2147----
2148 HTTP/1.1 200 OK
2149----
2150
2151[[set-ready-for-review]]
2152== Set Ready-For-Review
2153--
2154'POST /changes/link:#change-id[\{change-id\}]/ready'
2155--
2156
2157Marks the change as ready for review (set WIP property to false).
2158
2159Activates notifications of reviewer. The request body does not need
2160to include a link:#work-in-progress-input[WorkInProgressInput] entity
2161if no review comment is added.
2162
2163.Request
2164----
2165 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ready HTTP/1.0
2166 Content-Type: application/json;charset=UTF-8
2167
2168 {
2169 "message": "Refactoring is done."
2170 }
2171
2172----
2173
2174.Response
2175----
2176 HTTP/1.1 200 OK
2177----
2178
David Pursehouse7c5c3a52017-04-10 11:37:23 +09002179[[mark-private]]
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002180=== Mark Private
2181--
Edwin Kempin364a86b2017-04-27 12:34:00 +02002182'POST /changes/link:#change-id[\{change-id\}]/private'
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002183--
2184
David Pursehouse540c8422017-05-10 16:41:59 +09002185Marks the change to be private. Changes may only be marked private by the
2186owner or site administrators.
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002187
Edwin Kempin364a86b2017-04-27 12:34:00 +02002188A message can be specified in the request body inside a
2189link:#private-input[PrivateInput] entity.
2190
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002191.Request
2192----
Edwin Kempin364a86b2017-04-27 12:34:00 +02002193 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2194 Content-Type: application/json; charset=UTF-8
2195
2196 {
2197 "message": "After this security fix has been released we can make it public now."
2198 }
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002199----
2200
2201.Response
2202----
2203 HTTP/1.1 201 Created
2204----
2205
2206If the change was already private the response is "`200 OK`".
2207
2208[[unmark-private]]
2209=== Unmark Private
2210--
2211'DELETE /changes/link:#change-id[\{change-id\}]/private'
2212--
2213
2214Marks the change to be non-private. Note users can only unmark own private
2215changes.
2216
Edwin Kempin364a86b2017-04-27 12:34:00 +02002217A message can be specified in the request body inside a
2218link:#private-input[PrivateInput] entity.
2219
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002220.Request
2221----
2222 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
Edwin Kempin364a86b2017-04-27 12:34:00 +02002223 Content-Type: application/json; charset=UTF-8
2224
2225 {
2226 "message": "This is a security fix that must not be public."
2227 }
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002228----
2229
2230.Response
2231----
2232 HTTP/1.1 204 No Content
2233----
2234
2235If the change was already not private, the response is "`409 Conflict`".
2236
Edwin Kempin364a86b2017-04-27 12:34:00 +02002237Please note that some proxies prohibit request bodies for DELETE
2238requests. In this case, if you want to set a message options, use a
2239POST request:
2240
2241.Request
2242----
2243 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private.delete HTTP/1.0
2244 Content-Type: application/json; charset=UTF-8
2245
2246 {
2247 "message": "This is a security fix that must not be public."
2248 }
2249----
2250
David Pursehoused656fa82017-04-28 06:51:26 +02002251[[ignore]]
2252=== Ignore
2253--
2254'PUT /changes/link:#change-id[\{change-id\}]/ignore'
2255--
2256
2257Marks a change as ignored. The change will not be shown in the incoming
2258reviews dashboard, and email notifications will be suppressed.
2259
2260.Request
2261----
2262 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/ignore HTTP/1.0
2263----
2264
2265[[unignore]]
2266=== Unignore
2267--
2268'PUT /changes/link:#change-id[\{change-id\}]/unignore'
2269--
2270
2271Un-marks a change as ignored.
2272
2273.Request
2274----
2275 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unignore HTTP/1.0
2276----
2277
Gustaf Lundhe8647c62017-04-28 06:51:26 +02002278[[mute]]
2279=== Mute
2280--
2281'PUT /changes/link:#change-id[\{change-id\}]/mute'
2282--
2283
2284Marks a change as muted.
2285
2286This allows users to "de-highlight" changes in their dashboard until a new
2287patch set is uploaded.
2288
2289This differs from the link:#ignore[ignore] endpoint, which will mute
2290emails and hide the change from dashboard completely until it is
2291link:#unignore[unignored] again.
2292
2293
2294.Request
2295----
2296 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/mute HTTP/1.0
2297----
2298
2299[[unmute]]
2300=== Unmute
2301--
2302'PUT /changes/link:#change-id[\{change-id\}]/unmute'
2303--
2304
2305Unmutes a change.
2306
2307.Request
2308----
2309 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/unmute HTTP/1.0
2310----
2311
David Ostrovsky1a49f622014-07-29 00:40:02 +02002312[[edit-endpoints]]
2313== Change Edit Endpoints
2314
David Ostrovsky1a49f622014-07-29 00:40:02 +02002315[[get-edit-detail]]
2316=== Get Change Edit Details
2317--
2318'GET /changes/link:#change-id[\{change-id\}]/edit
2319--
2320
2321Retrieves a change edit details.
2322
2323.Request
2324----
2325 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2326----
2327
2328As response an link:#edit-info[EditInfo] entity is returned that
2329describes the change edit, or "`204 No Content`" when change edit doesn't
2330exist for this change. Change edits are stored on special branches and there
2331can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02002332When request parameter `list` is provided the response also includes the file
2333list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02002334against this base revision. When request parameter `download-commands` is
2335provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02002336
2337.Response
2338----
2339 HTTP/1.1 200 OK
2340 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002341 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02002342
2343 )]}'
2344 {
2345 "commit":{
2346 "parents":[
2347 {
2348 "commit":"1eee2c9d8f352483781e772f35dc586a69ff5646",
2349 }
2350 ],
2351 "author":{
2352 "name":"Shawn O. Pearce",
2353 "email":"sop@google.com",
2354 "date":"2012-04-24 18:08:08.000000000",
2355 "tz":-420
2356 },
2357 "committer":{
2358 "name":"Shawn O. Pearce",
2359 "email":"sop@google.com",
2360 "date":"2012-04-24 18:08:08.000000000",
2361 "tz":-420
2362 },
2363 "subject":"Use an EventBus to manage star icons",
2364 "message":"Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2365 },
Michael Zhoud03fe282016-04-25 17:13:17 -04002366 "base_revision":"c35558e0925e6985c91f3a16921537d5e572b7a3"
David Ostrovsky1a49f622014-07-29 00:40:02 +02002367 }
2368----
David Pursehouse4e38b972014-05-30 10:36:40 +09002369
David Ostrovskya5ab8292014-08-01 02:11:39 +02002370[[put-edit-file]]
2371=== Change file content in Change Edit
2372--
2373'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2374--
2375
2376Put content of a file to a change edit.
2377
2378.Request
2379----
2380 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2381----
2382
2383When change edit doesn't exist for this change yet it is created. When file
2384content isn't provided, it is wiped out for that file. As response
2385"`204 No Content`" is returned.
2386
2387.Response
2388----
2389 HTTP/1.1 204 No Content
2390----
2391
David Ostrovsky138edb42014-08-15 21:31:43 +02002392[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01002393=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02002394--
2395'POST /changes/link:#change-id[\{change-id\}]/edit
2396--
2397
David Ostrovskya00c9532015-01-21 00:17:49 +01002398Creates empty change edit, restores file content or renames files in change
2399edit. The request body needs to include a
2400link:#change-edit-input[ChangeEditInput] entity when a file within change
2401edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02002402
2403.Request
2404----
2405 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002406 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02002407
2408 {
David Ostrovskybd12e172014-08-21 23:08:15 +02002409 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02002410 }
2411----
2412
David Ostrovskya00c9532015-01-21 00:17:49 +01002413or for rename:
2414
2415.Request
2416----
2417 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2418 Content-Type: application/json; charset=UTF-8
2419
2420 {
2421 "old_path": "foo",
2422 "new_path": "bar"
2423 }
2424----
2425
David Ostrovsky138edb42014-08-15 21:31:43 +02002426When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01002427and restore flag are provided in request body, this file is restored. When
2428old and new file names are provided, the file is renamed. As response
2429"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02002430
2431.Response
2432----
2433 HTTP/1.1 204 No Content
2434----
2435
David Ostrovskyc967e152014-10-24 17:36:16 +02002436[[put-change-edit-message]]
2437=== Change commit message in Change Edit
2438--
2439'PUT /changes/link:#change-id[\{change-id\}]/edit:message
2440--
2441
2442Modify commit message. The request body needs to include a
2443link:#change-edit-message-input[ChangeEditMessageInput]
2444entity.
2445
2446.Request
2447----
2448 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002449 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02002450
2451 {
2452 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
2453 }
2454----
2455
2456If a change edit doesn't exist for this change yet, it is created. As
2457response "`204 No Content`" is returned.
2458
2459.Response
2460----
2461 HTTP/1.1 204 No Content
2462----
2463
David Ostrovsky2830c292014-08-01 02:24:31 +02002464[[delete-edit-file]]
2465=== Delete file in Change Edit
2466--
2467'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
2468--
2469
2470Deletes a file from a change edit. This deletes the file from the repository
2471completely. This is not the same as reverting or restoring a file to its
2472previous contents.
2473
2474.Request
2475----
2476 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2477----
2478
2479When change edit doesn't exist for this change yet it is created.
2480
2481.Response
2482----
2483 HTTP/1.1 204 No Content
2484----
2485
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002486[[get-edit-file]]
2487=== Retrieve file content from Change Edit
2488--
2489'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2490--
2491
2492Retrieves content of a file from a change edit.
2493
2494.Request
2495----
2496 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2497----
2498
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002499The content of the file is returned as text encoded inside base64.
2500The Content-Type header will always be `text/plain` reflecting the
2501outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
2502can be examined to find the server detected content type of the file.
2503
2504When the specified file was deleted in the change edit
2505"`204 No Content`" is returned.
2506
2507If only the content type is required, callers should use HEAD to
2508avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002509
Michael Zhou551ad0c2016-04-26 01:21:42 -04002510If the `base` parameter is set to true, the returned content is from the
2511revision that the edit is based on.
2512
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002513.Response
2514----
2515 HTTP/1.1 200 OK
2516 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002517 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002518 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002519 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002520
2521 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
2522----
2523
David Ostrovskyd0078672015-02-06 21:51:04 +01002524Alternatively, if the only value of the Accept request header is
2525`application/json` the content is returned as JSON string and
2526`X-FYI-Content-Encoding` is set to `json`.
2527
David Ostrovsky9ea9c112015-01-25 00:12:38 +01002528[[get-edit-meta-data]]
2529=== Retrieve meta data of a file from Change Edit
2530--
2531'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
2532--
2533
2534Retrieves meta data of a file from a change edit. Currently only
2535web links are returned.
2536
2537.Request
2538----
2539 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
2540----
2541
2542This REST endpoint retrieves additional information for a file in a
2543change edit. As result an link:#edit-file-info[EditFileInfo] entity is
2544returned.
2545
2546.Response
2547----
2548 HTTP/1.1 200 OK
2549 Content-Disposition: attachment
2550 Content-Type: application/json; charset=UTF-8
2551
2552 )]}'
2553 {
2554 "web_links":[
2555 {
2556 "show_on_side_by_side_diff_view": true,
2557 "name": "side-by-side preview diff",
2558 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
2559 "url": "#/x/xdocs/c/42/1..0/README.md",
2560 "target": "_self"
2561 },
2562 {
2563 "show_on_unified_diff_view": true,
2564 "name": "unified preview diff",
2565 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
2566 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
2567 "target": "_self"
2568 }
2569 ]}
2570----
2571
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002572[[get-edit-message]]
2573=== Retrieve commit message from Change Edit or current patch set of the change
2574--
2575'GET /changes/link:#change-id[\{change-id\}]/edit:message
2576--
2577
David Ostrovsky25ad15e2014-12-15 21:18:59 +01002578Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002579
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02002580If the `base` parameter is set to true, the returned message is from the
2581revision that the edit is based on.
2582
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002583.Request
2584----
2585 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
2586----
2587
2588The commit message is returned as base64 encoded string.
2589
2590.Response
2591----
2592 HTTP/1.1 200 OK
2593
2594 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
2595M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
2596----
2597
David Ostrovskyd0078672015-02-06 21:51:04 +01002598Alternatively, if the only value of the Accept request header is
2599`application/json` the commit message is returned as JSON string:
2600
2601.Response
2602----
2603 HTTP/1.1 200 OK
2604
2605)]}'
2606"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
2607----
2608
2609
David Ostrovskye9988f92014-08-01 09:56:34 +02002610[[publish-edit]]
2611=== Publish Change Edit
2612--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002613'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02002614--
2615
2616Promotes change edit to a regular patch set.
2617
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02002618Options can be provided in the request body as a
2619link:#publish-change-edit-input[PublishChangeEditInput] entity.
2620
David Ostrovskye9988f92014-08-01 09:56:34 +02002621.Request
2622----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002623 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02002624 Content-Type: application/json; charset=UTF-8
2625
2626 {
2627 "notify": "NONE"
2628 }
David Ostrovskye9988f92014-08-01 09:56:34 +02002629----
2630
2631As response "`204 No Content`" is returned.
2632
2633.Response
2634----
2635 HTTP/1.1 204 No Content
2636----
2637
David Ostrovsky46999d22014-08-16 02:19:13 +02002638[[rebase-edit]]
2639=== Rebase Change Edit
2640--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002641'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02002642--
2643
2644Rebases change edit on top of latest patch set.
2645
2646.Request
2647----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002648 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02002649----
2650
2651When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09002652"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02002653based on top of the latest patch set, the response
2654"`409 Conflict`" is returned.
2655
2656.Response
2657----
2658 HTTP/1.1 204 No Content
2659----
2660
David Ostrovsky8e75f502014-08-10 00:36:31 +02002661[[delete-edit]]
2662=== Delete Change Edit
2663--
2664'DELETE /changes/link:#change-id[\{change-id\}]/edit'
2665--
2666
2667Deletes change edit.
2668
2669.Request
2670----
2671 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2672----
2673
2674As response "`204 No Content`" is returned.
2675
2676.Response
2677----
2678 HTTP/1.1 204 No Content
2679----
2680
Edwin Kempin9a9f1c02017-01-02 15:10:49 +01002681[[get-hashtags]]
2682=== Get Hashtags
2683--
2684'GET /changes/link:#change-id[\{change-id\}]/hashtags'
2685--
2686
2687Gets the hashtags associated with a change.
2688
2689[NOTE] Hashtags are only available when NoteDb is enabled.
2690
2691.Request
2692----
2693 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2694----
2695
2696As response the change's hashtags are returned as a list of strings.
2697
2698.Response
2699----
2700 HTTP/1.1 200 OK
2701 Content-Disposition: attachment
2702 Content-Type: application/json; charset=UTF-8
2703
2704 )]}'
2705 [
2706 "hashtag1",
2707 "hashtag2"
2708 ]
2709----
2710
2711[[set-hashtags]]
2712=== Set Hashtags
2713--
2714'POST /changes/link:#change-id[\{change-id\}]/hashtags'
2715--
2716
2717Adds and/or removes hashtags from a change.
2718
2719[NOTE] Hashtags are only available when NoteDb is enabled.
2720
2721The hashtags to add or remove must be provided in the request body inside a
2722link:#hashtags-input[HashtagsInput] entity.
2723
2724.Request
2725----
2726 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2727 Content-Type: application/json; charset=UTF-8
2728
2729 {
2730 "add" : [
2731 "hashtag3"
2732 ],
2733 "remove" : [
2734 "hashtag2"
2735 ]
2736 }
2737----
2738
2739As response the change's hashtags are returned as a list of strings.
2740
2741.Response
2742----
2743 HTTP/1.1 200 OK
2744 Content-Disposition: attachment
2745 Content-Type: application/json; charset=UTF-8
2746
2747 )]}'
2748 [
2749 "hashtag1",
2750 "hashtag3"
2751 ]
2752----
2753
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002754[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002755== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002756
2757[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002758=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002759--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002760'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002761--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002762
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002763Lists the reviewers of a change.
2764
2765As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
2766
2767.Request
2768----
2769 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0
2770----
2771
2772.Response
2773----
2774 HTTP/1.1 200 OK
2775 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002776 Content-Type: application/json; charset=UTF-8
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002777
2778 )]}'
2779 [
2780 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002781 "approvals": {
2782 "Verified": "+1",
2783 "Code-Review": "+2"
2784 },
2785 "_account_id": 1000096,
2786 "name": "John Doe",
2787 "email": "john.doe@example.com"
2788 },
2789 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002790 "approvals": {
2791 "Verified": " 0",
2792 "Code-Review": "-1"
2793 },
2794 "_account_id": 1000097,
2795 "name": "Jane Roe",
2796 "email": "jane.roe@example.com"
2797 }
2798 ]
2799----
2800
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002801[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002802=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002803--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002804'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002805--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002806
2807Suggest the reviewers for a given query `q` and result limit `n`. If result
2808limit is not passed, then the default 10 is used.
2809
2810As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
2811
2812.Request
2813----
2814 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0
2815----
2816
2817.Response
2818----
2819 HTTP/1.1 200 OK
2820 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002821 Content-Type: application/json; charset=UTF-8
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002822
2823 )]}'
2824 [
2825 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002826 "account": {
2827 "_account_id": 1000097,
2828 "name": "Jane Roe",
2829 "email": "jane.roe@example.com"
Logan Hanksab3c81e2016-07-20 15:42:52 -07002830 },
2831 "count": 1
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002832 },
2833 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002834 "group": {
2835 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
2836 "name": "Joiner"
Logan Hanksab3c81e2016-07-20 15:42:52 -07002837 },
2838 "count": 5
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002839 }
2840 ]
2841----
2842
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002843[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002844=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002845--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002846'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 -08002847--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002848
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002849Retrieves a reviewer of a change.
2850
2851As response a link:#reviewer-info[ReviewerInfo] entity is returned that
2852describes the reviewer.
2853
2854.Request
2855----
2856 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
2857----
2858
2859.Response
2860----
2861 HTTP/1.1 200 OK
2862 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002863 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002864
2865 )]}'
2866 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002867 "approvals": {
2868 "Verified": "+1",
2869 "Code-Review": "+2"
2870 },
2871 "_account_id": 1000096,
2872 "name": "John Doe",
2873 "email": "john.doe@example.com"
2874 }
2875----
2876
Edwin Kempin392328e2013-02-25 12:50:03 +01002877[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002878=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002879--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002880'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002881--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002882
Edwin Kempin392328e2013-02-25 12:50:03 +01002883Adds one user or all members of one group as reviewer to the change.
2884
2885The reviewer to be added to the change must be provided in the request
2886body as a link:#reviewer-input[ReviewerInput] entity.
2887
2888.Request
2889----
2890 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002891 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002892
2893 {
2894 "reviewer": "john.doe@example.com"
2895 }
2896----
2897
2898As response an link:#add-reviewer-result[AddReviewerResult] entity is
2899returned that describes the newly added reviewers.
2900
2901.Response
2902----
2903 HTTP/1.1 200 OK
2904 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002905 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002906
2907 )]}'
2908 {
Aaron Gable8c650212017-04-25 12:03:37 -07002909 "input": "john.doe@example.com",
Edwin Kempin392328e2013-02-25 12:50:03 +01002910 "reviewers": [
2911 {
Aaron Gable8c650212017-04-25 12:03:37 -07002912 "_account_id": 1000096,
2913 "name": "John Doe",
2914 "email": "john.doe@example.com"
Edwin Kempin392328e2013-02-25 12:50:03 +01002915 "approvals": {
2916 "Verified": " 0",
2917 "Code-Review": " 0"
2918 },
Edwin Kempin392328e2013-02-25 12:50:03 +01002919 }
2920 ]
2921 }
2922----
2923
2924If a group is specified, adding the group members as reviewers is an
2925atomic operation. This means if an error is returned, none of the
2926members are added as reviewer.
2927
2928If a group with many members is added as reviewer a confirmation may be
2929required.
2930
2931.Request
2932----
2933 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002934 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002935
2936 {
2937 "reviewer": "MyProjectVerifiers"
2938 }
2939----
2940
2941.Response
2942----
2943 HTTP/1.1 200 OK
2944 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002945 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002946
2947 )]}'
2948 {
Logan Hanks23e70282016-07-06 14:31:56 -07002949 "input": "MyProjectVerifiers",
Edwin Kempin392328e2013-02-25 12:50:03 +01002950 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
2951 "confirm": true
2952 }
2953----
2954
2955To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01002956`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01002957
2958.Request
2959----
2960 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002961 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002962
2963 {
Logan Hanks23e70282016-07-06 14:31:56 -07002964 "input": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01002965 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01002966 }
2967----
2968
Patrick Hiesel11873ef2017-03-17 17:36:05 +01002969If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set
2970for the project, reviewers and CCs are not required to have a Gerrit account. If you POST
2971an email address of a reviewer or CC then, they will be added to the change even if they
2972don't have a Gerrit account.
2973
2974If this option is disabled, the request would fail with `400 Bad Request` if the email
2975address can't be resolved to an active Gerrit account.
2976
2977Note that the name is optional so both "un.registered@reviewer.com" and
2978"John Doe <un.registered@reviewer.com>" are valid inputs.
2979
2980Reviewers without Gerrit accounts can only be added on changes visible to anonymous users.
2981
2982.Request
2983----
2984 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
2985 Content-Type: application/json; charset=UTF-8
2986
2987 {
2988 "reviewer": "John Doe <un.registered@reviewer.com>"
2989 }
2990----
2991
2992.Response
2993----
2994 HTTP/1.1 200 OK
2995 Content-Disposition: attachment
2996 Content-Type: application/json; charset=UTF-8
2997
2998 )]}'
2999 {
3000 "input": "John Doe <un.registered@reviewer.com>"
3001 }
3002----
3003
Logan Hanksf03040e2017-05-03 09:40:56 -07003004.Notifications
3005
3006An email will be sent using the "newchange" template.
3007
3008[options="header",cols="1,1,1"]
3009|=============================
3010|WIP State |Default|notify=ALL
3011|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs
3012|Work in progress|not sent|owner, reviewers, CCs
3013|=============================
3014
Edwin Kempin53301072013-02-25 12:57:07 +01003015[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003016=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003017--
Edwin Kempin407fca32016-08-29 12:01:00 +02003018'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' +
3019'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 -08003020--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003021
Edwin Kempin53301072013-02-25 12:57:07 +01003022Deletes a reviewer from a change.
3023
Edwin Kempin407fca32016-08-29 12:01:00 +02003024Options can be provided in the request body as a
3025link:#delete-reviewer-input[DeleteReviewerInput] entity.
3026
Edwin Kempin53301072013-02-25 12:57:07 +01003027.Request
3028----
3029 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
Edwin Kempin407fca32016-08-29 12:01:00 +02003030 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3031----
3032
3033Please note that some proxies prohibit request bodies for DELETE
3034requests. In this case, if you want to specify options, use a POST
3035request:
3036
3037.Request
3038----
3039 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
3040 Content-Type: application/json; charset=UTF-8
3041
3042 {
3043 "notify": "NONE"
3044 }
Edwin Kempin53301072013-02-25 12:57:07 +01003045----
3046
3047.Response
3048----
3049 HTTP/1.1 204 No Content
3050----
3051
Logan Hanks87607412017-05-30 13:49:04 -07003052.Notifications
3053
3054An email will be sent using the "deleteReviewer" template. If deleting the
3055reviewer resulted in one or more approvals being removed, then the deleted
3056reviewer will also receive a notification (unless notify=NONE).
3057
3058[options="header",cols="1,5"]
3059|=============================
3060|WIP State |Default Recipients
3061|Ready for review|notify=ALL: deleted reviewer (if voted), owner, reviewers, CCs, stars, ALL_COMMENTS watchers
3062|Work in progress|notify=NONE: deleted reviewer (if voted)
3063|=============================
3064
David Ostrovskybeb0b842014-12-13 00:24:29 +01003065[[list-votes]]
3066=== List Votes
3067--
3068'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
3069--
3070
3071Lists the votes for a specific reviewer of the change.
3072
3073.Request
3074----
Edwin Kempin314f10a2016-07-11 11:39:05 +02003075 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0
David Ostrovskybeb0b842014-12-13 00:24:29 +01003076----
3077
3078As result a map is returned that maps the label name to the label value.
3079The entries in the map are sorted by label name.
3080
3081.Response
3082----
3083 HTTP/1.1 200 OK
3084 Content-Disposition: attachment
3085 Content-Type: application/json;charset=UTF-8
3086
3087 )]}'
3088 {
3089 "Code-Review": -1,
3090 "Verified": 1
3091 "Work-In-Progress": 1,
3092 }
3093----
3094
3095[[delete-vote]]
3096=== Delete Vote
3097--
Edwin Kempin5488dc12016-08-29 11:13:31 +02003098'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 +02003099'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 +01003100--
3101
3102Deletes a single vote from a change. Note, that even when the last vote of
3103a reviewer is removed the reviewer itself is still listed on the change.
3104
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003105Options can be provided in the request body as a
3106link:#delete-vote-input[DeleteVoteInput] entity.
3107
David Ostrovskybeb0b842014-12-13 00:24:29 +01003108.Request
3109----
3110 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
Edwin Kempin1dfecb62016-06-16 10:45:00 +02003111 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3112----
3113
3114Please note that some proxies prohibit request bodies for DELETE
3115requests. In this case, if you want to specify options, use a POST
3116request:
3117
3118.Request
3119----
3120 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
3121 Content-Type: application/json; charset=UTF-8
3122
3123 {
3124 "notify": "NONE"
3125 }
David Ostrovskybeb0b842014-12-13 00:24:29 +01003126----
3127
3128.Response
3129----
3130 HTTP/1.1 204 No Content
3131----
3132
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003133[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003134== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003135
Shawn Pearce728ba882013-07-08 23:13:08 -07003136[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003137=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003138--
Shawn Pearce728ba882013-07-08 23:13:08 -07003139'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003140--
Shawn Pearce728ba882013-07-08 23:13:08 -07003141
3142Retrieves a parsed commit of a revision.
3143
3144.Request
3145----
3146 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
3147----
3148
3149As response a link:#commit-info[CommitInfo] entity is returned that
3150describes the revision.
3151
3152.Response
3153----
3154 HTTP/1.1 200 OK
3155 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003156 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07003157
3158 )]}'
3159 {
Edwin Kempinc8237402015-07-15 18:27:55 +02003160 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07003161 "parents": [
3162 {
3163 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3164 "subject": "Migrate contributor agreements to All-Projects."
3165 }
3166 ],
3167 "author": {
3168 "name": "Shawn O. Pearce",
3169 "email": "sop@google.com",
3170 "date": "2012-04-24 18:08:08.000000000",
3171 "tz": -420
3172 },
3173 "committer": {
3174 "name": "Shawn O. Pearce",
3175 "email": "sop@google.com",
3176 "date": "2012-04-24 18:08:08.000000000",
3177 "tz": -420
3178 },
3179 "subject": "Use an EventBus to manage star icons",
3180 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3181 }
3182----
3183
Sven Selbergd26bd542014-11-21 16:28:10 +01003184Adding query parameter `links` (for example `/changes/.../commit?links`)
3185returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07003186
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08003187[[get-description]]
3188=== Get Description
3189--
3190'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3191--
3192
3193Retrieves the description of a patch set.
3194
3195.Request
3196----
3197 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3198----
3199
3200.Response
3201----
3202 HTTP/1.1 200 OK
3203 Content-Disposition: attachment
3204 Content-Type: application/json; charset=UTF-8
3205
3206 )]}'
3207 "Added Documentation"
3208----
3209
3210If the patch set does not have a description an empty string is returned.
3211
3212[[set-description]]
3213=== Set Description
3214--
3215'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3216--
3217
3218Sets the description of a patch set.
3219
3220The new description must be provided in the request body inside a
3221link:#description-input[DescriptionInput] entity.
3222
3223.Request
3224----
3225 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3226 Content-Type: application/json; charset=UTF-8
3227
3228 {
3229 "description": "Added Documentation"
3230 }
3231----
3232
3233As response the new description is returned.
3234
3235.Response
3236----
3237 HTTP/1.1 200 OK
3238 Content-Disposition: attachment
3239 Content-Type: application/json; charset=UTF-8
3240
3241 )]}'
3242 "Added Documentation"
3243----
3244
Edwin Kempin0f229442016-09-09 13:06:12 +02003245[[get-merge-list]]
3246=== Get Merge List
3247--
3248'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist'
3249--
3250
3251Returns the list of commits that are being integrated into a target
3252branch by a merge commit. By default the first parent is assumed to be
3253uninteresting. By using the `parent` option another parent can be set
3254as uninteresting (parents are 1-based).
3255
3256The list of commits is returned as a list of
3257link:#commit-info[CommitInfo] entities. Web links are only included if
3258the `links` option was set.
3259
3260.Request
3261----
3262 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0
3263----
3264
3265.Response
3266----
3267HTTP/1.1 200 OK
3268 Content-Disposition: attachment
3269 Content-Type: application/json; charset=UTF-8
3270
3271 )]}'
3272 [
3273 {
3274 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
3275 "parents": [
3276 {
3277 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3278 "subject": "Migrate contributor agreements to All-Projects."
3279 }
3280 ],
3281 "author": {
3282 "name": "Shawn O. Pearce",
3283 "email": "sop@google.com",
3284 "date": "2012-04-24 18:08:08.000000000",
3285 "tz": -420
3286 },
3287 "committer": {
3288 "name": "Shawn O. Pearce",
3289 "email": "sop@google.com",
3290 "date": "2012-04-24 18:08:08.000000000",
3291 "tz": -420
3292 },
3293 "subject": "Use an EventBus to manage star icons",
3294 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3295 }
3296 ]
3297----
3298
Stefan Bellerc7259662015-02-12 17:23:05 -08003299[[get-revision-actions]]
3300=== Get Revision Actions
3301--
3302'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
3303--
3304
3305Retrieves revision link:#action-info[actions] of the revision of a change.
3306
3307.Request
3308----
3309 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
3310----
3311
3312.Response
3313----
3314 HTTP/1.1 200 OK
3315 Content-Disposition: attachment
3316 Content-Type: application/json; charset=UTF-8
3317
3318 )]}'
3319
3320{
3321 "submit": {
3322 "method": "POST",
3323 "label": "Submit",
3324 "title": "Submit patch set 1 into master",
3325 "enabled": true
3326 },
3327 "cherrypick": {
3328 "method": "POST",
3329 "label": "Cherry Pick",
3330 "title": "Cherry pick change to a different branch",
3331 "enabled": true
3332 }
3333}
3334----
3335
3336The response is a flat map of possible revision actions mapped to their
3337link:#action-info[ActionInfo].
3338
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003339[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003340=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003341--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003342'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003343--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003344
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003345Retrieves a review of a revision.
3346
3347.Request
3348----
3349 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3350----
3351
3352As response a link:#change-info[ChangeInfo] entity with
3353link:#detailed-labels[detailed labels] and link:#detailed-accounts[
3354detailed accounts] is returned that describes the review of the
3355revision. The revision for which the review is retrieved is contained
3356in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05003357set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003358revision of the change. Please note that the returned labels are always
3359for the current patch set.
3360
3361.Response
3362----
3363 HTTP/1.1 200 OK
3364 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003365 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003366
3367 )]}'
3368 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003369 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
3370 "project": "myProject",
3371 "branch": "master",
3372 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
3373 "subject": "Implementing Feature X",
3374 "status": "NEW",
3375 "created": "2013-02-01 09:59:32.126000000",
3376 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003377 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003378 "insertions": 34,
3379 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003380 "_number": 3965,
3381 "owner": {
3382 "_account_id": 1000096,
3383 "name": "John Doe",
3384 "email": "john.doe@example.com"
3385 },
3386 "labels": {
3387 "Verified": {
3388 "all": [
3389 {
3390 "value": 0,
3391 "_account_id": 1000096,
3392 "name": "John Doe",
3393 "email": "john.doe@example.com"
3394 },
3395 {
3396 "value": 0,
3397 "_account_id": 1000097,
3398 "name": "Jane Roe",
3399 "email": "jane.roe@example.com"
3400 }
3401 ],
3402 "values": {
3403 "-1": "Fails",
3404 " 0": "No score",
3405 "+1": "Verified"
3406 }
3407 },
3408 "Code-Review": {
3409 "all": [
3410 {
3411 "value": -1,
3412 "_account_id": 1000096,
3413 "name": "John Doe",
3414 "email": "john.doe@example.com"
3415 },
3416 {
3417 "value": 1,
3418 "_account_id": 1000097,
3419 "name": "Jane Roe",
3420 "email": "jane.roe@example.com"
3421 }
3422 ]
3423 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +04003424 "-2": "This shall not be merged",
3425 "-1": "I would prefer this is not merged as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003426 " 0": "No score",
3427 "+1": "Looks good to me, but someone else must approve",
3428 "+2": "Looks good to me, approved"
3429 }
3430 }
3431 },
3432 "permitted_labels": {
3433 "Verified": [
3434 "-1",
3435 " 0",
3436 "+1"
3437 ],
3438 "Code-Review": [
3439 "-2",
3440 "-1",
3441 " 0",
3442 "+1",
3443 "+2"
3444 ]
3445 },
3446 "removable_reviewers": [
3447 {
3448 "_account_id": 1000096,
3449 "name": "John Doe",
3450 "email": "john.doe@example.com"
3451 },
3452 {
3453 "_account_id": 1000097,
3454 "name": "Jane Roe",
3455 "email": "jane.roe@example.com"
3456 }
3457 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08003458 "reviewers": {
3459 "REVIEWER": [
3460 {
3461 "_account_id": 1000096,
3462 "name": "John Doe",
3463 "email": "john.doe@example.com"
3464 },
3465 {
3466 "_account_id": 1000097,
3467 "name": "Jane Roe",
3468 "email": "jane.roe@example.com"
3469 }
3470 ]
3471 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003472 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
3473 "revisions": {
3474 "674ac754f91e64a0efb8087e59a176484bd534d1": {
David Pursehouse4de41112016-06-28 09:24:08 +09003475 "kind": "REWORK",
3476 "_number": 2,
3477 "ref": "refs/changes/65/3965/2",
3478 "fetch": {
3479 "http": {
3480 "url": "http://gerrit/myProject",
3481 "ref": "refs/changes/65/3965/2"
3482 }
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003483 }
3484 }
3485 }
3486 }
3487----
3488
David Pursehouse669f2512014-07-18 11:41:42 +09003489[[get-related-changes]]
3490=== Get Related Changes
3491--
3492'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
3493--
3494
3495Retrieves related changes of a revision. Related changes are changes that either
3496depend on, or are dependencies of the revision.
3497
3498.Request
3499----
3500 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
3501----
3502
3503As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
3504describing the related changes.
3505
3506.Response
3507----
3508 HTTP/1.1 200 OK
3509 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003510 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09003511
3512 )]}'
3513 {
3514 "changes": [
3515 {
3516 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
3517 "commit": {
3518 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
3519 "parents": [
3520 {
3521 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
3522 }
3523 ],
3524 "author": {
3525 "name": "David Ostrovsky",
3526 "email": "david@ostrovsky.org",
3527 "date": "2014-07-12 15:04:24.000000000",
3528 "tz": 120
3529 },
3530 "subject": "Remove Solr"
3531 },
3532 "_change_number": 58478,
3533 "_revision_number": 2,
3534 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003535 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003536 },
3537 {
3538 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
3539 "commit": {
3540 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
3541 "parents": [
3542 {
3543 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
3544 }
3545 ],
3546 "author": {
3547 "name": "David Pursehouse",
3548 "email": "david.pursehouse@sonymobile.com",
3549 "date": "2014-06-24 02:01:28.000000000",
3550 "tz": 540
3551 },
3552 "subject": "Add support for secondary index with Elasticsearch"
3553 },
3554 "_change_number": 58081,
3555 "_revision_number": 10,
3556 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003557 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003558 }
3559 ]
3560 }
3561----
3562
3563
Edwin Kempin67498de2013-02-25 16:15:34 +01003564[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003565=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003566--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003567'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003568--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003569
Logan Hanksf03040e2017-05-03 09:40:56 -07003570Sets a review on a revision, optionally also publishing draft comments, setting
3571labels, and adding reviewers or CCs.
Edwin Kempin67498de2013-02-25 16:15:34 +01003572
3573The review must be provided in the request body as a
3574link:#review-input[ReviewInput] entity.
3575
Aaron Gable8c650212017-04-25 12:03:37 -07003576A review cannot be set on a change edit. Trying to post a review for a
3577change edit fails with `409 Conflict`.
3578
Logan Hanksf03040e2017-05-03 09:40:56 -07003579Here is an example of using this method to set labels:
Aaron Gable8c650212017-04-25 12:03:37 -07003580
Edwin Kempin67498de2013-02-25 16:15:34 +01003581.Request
3582----
3583 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003584 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003585
3586 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01003587 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01003588 "message": "Some nits need to be fixed.",
3589 "labels": {
3590 "Code-Review": -1
3591 },
3592 "comments": {
3593 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3594 {
3595 "line": 23,
3596 "message": "[nit] trailing whitespace"
3597 },
3598 {
3599 "line": 49,
3600 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09003601 },
3602 {
3603 "range": {
3604 "start_line": 50,
3605 "start_character": 0,
3606 "end_line": 55,
3607 "end_character": 20
3608 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09003609 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01003610 }
3611 ]
3612 }
3613 }
3614----
3615
Aaron Gable843b0c12017-04-21 08:25:27 -07003616As response a link:#review-result[ReviewResult] entity is returned that
Aaron Gable8c650212017-04-25 12:03:37 -07003617describes the applied labels and any added reviewers (e.g. yourself,
3618if you set a label but weren't previously a reviewer on this CL).
Edwin Kempin67498de2013-02-25 16:15:34 +01003619
3620.Response
3621----
3622 HTTP/1.1 200 OK
3623 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003624 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003625
3626 )]}'
3627 {
3628 "labels": {
3629 "Code-Review": -1
3630 }
3631 }
3632----
3633
Aaron Gable8c650212017-04-25 12:03:37 -07003634It is also possible to add one or more reviewers or CCs
Logan Hanksf03040e2017-05-03 09:40:56 -07003635to a change simultaneously with a review:
Logan Hanks5f1c7592016-07-06 14:39:33 -07003636
3637.Request
3638----
3639 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3640 Content-Type: application/json; charset=UTF-8
3641
3642 {
Aaron Gable8c650212017-04-25 12:03:37 -07003643 "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 -07003644 "reviewers": [
3645 {
3646 "reviewer": "jane.roe@example.com"
3647 },
3648 {
Aaron Gable8c650212017-04-25 12:03:37 -07003649 "reviewer": "john.doe@example.com",
3650 "state": "CC"
3651 }
3652 {
3653 "reviewer": "MyProjectVerifiers",
Logan Hanks5f1c7592016-07-06 14:39:33 -07003654 }
3655 ]
3656 }
3657----
3658
3659Each element of the `reviewers` list is an instance of
3660link:#reviewer-input[ReviewerInput]. The corresponding result of
Aaron Gable8c650212017-04-25 12:03:37 -07003661adding each reviewer will be returned in a map of inputs to
3662link:#add-reviewer-result[AddReviewerResult]s.
Logan Hanks5f1c7592016-07-06 14:39:33 -07003663
3664.Response
3665----
3666 HTTP/1.1 200 OK
3667 Content-Disposition: attachment
3668 Content-Type: application/json; charset=UTF-8
3669
3670 )]}'
3671 {
Aaron Gable8c650212017-04-25 12:03:37 -07003672 "reviewers": {
3673 "jane.roe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07003674 "input": "jane.roe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07003675 "reviewers": [
3676 {
3677 "_account_id": 1000097,
3678 "name": "Jane Roe",
3679 "email": "jane.roe@example.com"
3680 "approvals": {
3681 "Verified": " 0",
3682 "Code-Review": " 0"
3683 },
3684 },
3685 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07003686 },
Aaron Gable8c650212017-04-25 12:03:37 -07003687 "john.doe@example.com": {
Logan Hanks5f1c7592016-07-06 14:39:33 -07003688 "input": "john.doe@example.com",
Aaron Gable8c650212017-04-25 12:03:37 -07003689 "ccs": [
3690 {
3691 "_account_id": 1000096,
3692 "name": "John Doe",
3693 "email": "john.doe@example.com"
3694 "approvals": {
3695 "Verified": " 0",
3696 "Code-Review": " 0"
3697 },
3698 }
3699 ]
3700 },
3701 "MyProjectVerifiers": {
3702 "input": "MyProjectVerifiers",
3703 "reviewers": [
3704 {
3705 "_account_id": 1000098,
3706 "name": "Alice Ansel",
3707 "email": "alice.ansel@example.com"
3708 "approvals": {
3709 "Verified": " 0",
3710 "Code-Review": " 0"
3711 },
3712 },
3713 {
3714 "_account_id": 1000099,
3715 "name": "Bob Bollard",
3716 "email": "bob.bollard@example.com"
3717 "approvals": {
3718 "Verified": " 0",
3719 "Code-Review": " 0"
3720 },
3721 },
3722 ]
Logan Hanks5f1c7592016-07-06 14:39:33 -07003723 }
Aaron Gable8c650212017-04-25 12:03:37 -07003724 }
Logan Hanks5f1c7592016-07-06 14:39:33 -07003725 }
3726----
3727
Logan Hankse2aacef2016-07-22 15:54:52 -07003728If there are any errors returned for reviewers, the entire review request will
Aaron Gable8c650212017-04-25 12:03:37 -07003729be rejected with `400 Bad Request`. None of the entries will have the
3730`reviewers` or `ccs` field set, and those which specifically failed will have
3731the `errors` field set containing details of why they failed.
Logan Hankse2aacef2016-07-22 15:54:52 -07003732
3733.Error Response
3734----
3735 HTTP/1.1 400 Bad Request
3736 Content-Disposition: attachment
3737 Content-Type: application/json; charset=UTF-8
3738
3739 )]}'
3740 {
3741 "reviewers": {
Aaron Gable8c650212017-04-25 12:03:37 -07003742 "jane.roe@example.com": {
3743 "input": "jane.roe@example.com",
3744 "error": "Account of jane.roe@example.com is inactive."
3745 },
3746 "john.doe@example.com": {
3747 "input": "john.doe@example.com"
3748 },
Logan Hankse2aacef2016-07-22 15:54:52 -07003749 "MyProjectVerifiers": {
3750 "input": "MyProjectVerifiers",
3751 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
3752 "confirm": true
3753 }
3754 }
3755 }
3756----
3757
Logan Hanksfc055962017-06-12 14:20:53 -07003758.Notifications
3759
3760An email will be sent using the "comment" template.
3761
3762If the top-level notify property is null or not set, then notification behavior
3763depends on whether the change is WIP, whether it has started review, and whether
3764the tag property is null.
3765
3766NOTE: If adding reviewers, the notify property of each ReviewerInput is *ignored*.
3767Use the notify property of the top-level link:#review-input[ReviewInput] instead.
3768
3769For the purposes of this table, *everyone* means *owner, reviewers, CCs, stars, and ALL_COMMENTS
3770watchers*.
3771
3772[options="header",cols="1,1,1,1,1,1,1"]
3773|=============================
3774|WIP State |Review Started|Tag Given|Default|notify=ALL|notify=OWNER_REVIEWERS|notify=OWNER
3775|Ready for review|N/A|N/A|everyone|everyone|owner, reviewers, CCs|owner
3776|Work in progress|no |no |not sent|everyone|owner, reviewers, CCs|owner
3777|Work in progress|no |yes|owner |everyone|owner, reviewers, CCs|owner
3778|Work in progress|yes|no |everyone|everyone|owner, reviewers, CCs|owner
3779|Work in progress|yes|yes|owner |everyone|owner, reviewers, CCs|owner
3780|=============================
3781
3782If reviewers are added, then a second email will be sent using the "newchange"
3783template. The notification logic for this email is the same as for
3784link:#add-reviewer[Add Reviewer].
3785
3786[options="header",cols="1,1,1,1,1"]
3787|=============================
3788|WIP State |Default|notify=ALL|notify=OWNER_REVIEWERS|notify=OWNER
3789|Ready for review|owner, reviewers, CCs|owner, reviewers, CCs|owner, reviewers, CCs|owner
3790|Work in progress|not sent|owner, reviewers, CCs|owner, reviewers, CCs|owner
3791|=============================
3792
3793
Edwin Kempincdae63b2013-03-15 15:06:59 +01003794[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003795=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003796--
Edwin Kempincdae63b2013-03-15 15:06:59 +01003797'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003798--
Edwin Kempincdae63b2013-03-15 15:06:59 +01003799
3800Rebases a revision.
3801
Zalan Blenessy874aed72015-01-12 13:26:18 +01003802Optionally, the parent revision can be changed to another patch set through the
3803link:#rebase-input[RebaseInput] entity.
3804
Edwin Kempincdae63b2013-03-15 15:06:59 +01003805.Request
3806----
3807 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01003808 Content-Type: application/json;charset=UTF-8
3809
3810 {
3811 "base" : "1234",
3812 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01003813----
3814
3815As response a link:#change-info[ChangeInfo] entity is returned that
3816describes the rebased change. Information about the current patch set
3817is included.
3818
3819.Response
3820----
3821 HTTP/1.1 200 OK
3822 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003823 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01003824
3825 )]}'
3826 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01003827 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
3828 "project": "myProject",
3829 "branch": "master",
3830 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
3831 "subject": "Implement Feature X",
3832 "status": "NEW",
3833 "created": "2013-02-01 09:59:32.126000000",
3834 "updated": "2013-02-21 11:16:36.775000000",
3835 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003836 "insertions": 21,
3837 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01003838 "_number": 4799,
3839 "owner": {
3840 "name": "John Doe"
3841 },
3842 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
3843 "revisions": {
3844 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09003845 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01003846 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01003847 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01003848 "fetch": {
3849 "http": {
3850 "url": "http://gerrit:8080/myProject",
3851 "ref": "refs/changes/99/4799/2"
3852 }
3853 },
3854 "commit": {
3855 "parents": [
3856 {
3857 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
3858 "subject": "Implement Feature A"
3859 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00003860 ],
3861 "author": {
3862 "name": "John Doe",
3863 "email": "john.doe@example.com",
3864 "date": "2013-05-07 15:21:27.000000000",
3865 "tz": 120
3866 },
3867 "committer": {
3868 "name": "Gerrit Code Review",
3869 "email": "gerrit-server@example.com",
3870 "date": "2013-05-07 15:35:43.000000000",
3871 "tz": 120
3872 },
3873 "subject": "Implement Feature X",
3874 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01003875 }
3876 }
3877 }
3878----
3879
3880If the revision cannot be rebased, e.g. due to conflicts, the response is
3881"`409 Conflict`" and the error message is contained in the response
3882body.
3883
3884.Response
3885----
3886 HTTP/1.1 409 Conflict
3887 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003888 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01003889
3890 The change could not be rebased due to a path conflict during merge.
3891----
3892
Edwin Kempin14b58112013-02-26 16:30:19 +01003893[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003894=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003895--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003896'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003897--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003898
Edwin Kempin14b58112013-02-26 16:30:19 +01003899Submits a revision.
3900
Edwin Kempin14b58112013-02-26 16:30:19 +01003901.Request
3902----
3903 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003904 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003905----
3906
3907As response a link:#submit-info[SubmitInfo] entity is returned that
3908describes the status of the submitted change.
3909
3910.Response
3911----
3912 HTTP/1.1 200 OK
3913 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003914 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003915
3916 )]}'
3917 {
3918 "status": "MERGED"
3919 }
3920----
3921
3922If the revision cannot be submitted, e.g. because the submit rule
3923doesn't allow submitting the revision or the revision is not the
3924current revision, the response is "`409 Conflict`" and the error
3925message is contained in the response body.
3926
3927.Response
3928----
3929 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003930 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003931
3932 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
3933----
3934
David Ostrovsky0d69c232013-09-10 23:10:23 +02003935[[publish-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003936=== Publish Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003937--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003938'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003939--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003940
3941Publishes a draft revision.
3942
3943.Request
3944----
3945 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/publish HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003946 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02003947----
3948
3949.Response
3950----
3951 HTTP/1.1 204 No Content
3952----
3953
3954[[delete-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003955=== Delete Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003956--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003957'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003958--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003959
3960Deletes a draft revision.
3961
3962.Request
3963----
3964 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003965 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02003966----
3967
3968.Response
3969----
3970 HTTP/1.1 204 No Content
3971----
3972
Edwin Kempin257d70f2013-03-28 14:31:14 +01003973[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003974=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003975--
Edwin Kempin257d70f2013-03-28 14:31:14 +01003976'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003977--
Edwin Kempin257d70f2013-03-28 14:31:14 +01003978
3979Gets the formatted patch for one revision.
3980
3981.Request
3982----
3983 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
3984----
3985
Shawn Pearce98361f72013-05-10 16:27:36 -07003986The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01003987
3988.Response
3989----
3990 HTTP/1.1 200 OK
3991 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003992 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07003993 X-FYI-Content-Encoding: base64
3994 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01003995
Shawn Pearce98361f72013-05-10 16:27:36 -07003996 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01003997----
3998
David Ostrovsky973f38b2013-08-22 00:24:51 -07003999Adding query parameter `zip` (for example `/changes/.../patch?zip`)
4000returns the patch as a single file inside of a ZIP archive. Clients
4001can expand the ZIP to obtain the plain text patch, avoiding the
4002need for a base64 decoding step. This option implies `download`.
4003
4004Query parameter `download` (e.g. `/changes/.../patch?download`)
4005will suggest the browser save the patch as `commitsha1.diff.base64`,
4006for later processing by command line tools.
4007
Kasper Nilsson81448072016-10-17 15:04:33 -07004008If the `path` parameter is set, the returned content is a diff of the single
4009file that the path refers to.
4010
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004011[[submit-preview]]
Edwin Kempin807eb4b2016-10-18 15:49:41 +02004012=== Submit Preview
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004013--
4014'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/preview_submit'
4015--
4016Gets a file containing thin bundles of all modified projects if this
4017change was submitted. The bundles are named `${ProjectName}.git`.
4018Each thin bundle contains enough to construct the state in which a project would
4019be in if this change were submitted. The base of the thin bundles are the
4020current target branches, so to make use of this call in a non-racy way, first
4021get the bundles and then fetch all projects contained in the bundle.
4022(This assumes no non-fastforward pushes).
4023
4024You need to give a parameter '?format=zip' or '?format=tar' to specify the
Stefan Beller3e586742016-10-05 15:23:22 -07004025format for the outer container. It is always possible to use tgz, even if
4026tgz is not in the list of allowed archive formats.
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07004027
4028To make good use of this call, you would roughly need code as found at:
4029----
4030 $ curl -Lo preview_submit_test.sh http://review.example.com:8080/tools/scripts/preview_submit_test.sh
4031----
4032.Request
4033----
4034 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/preview_submit?zip HTTP/1.0
4035----
4036
4037.Response
4038----
4039 HTTP/1.1 200 OK
4040 Date: Tue, 13 Sep 2016 19:13:46 GMT
4041 Content-Disposition: attachment; filename="submit-preview-147.zip"
4042 X-Content-Type-Options: nosniff
4043 Cache-Control: no-cache, no-store, max-age=0, must-revalidate
4044 Pragma: no-cache
4045 Expires: Mon, 01 Jan 1990 00:00:00 GMT
4046 Content-Type: application/x-zip
4047 Transfer-Encoding: chunked
4048
4049 [binary stuff]
4050----
4051
4052In case of an error, the response is not a zip file but a regular json response,
4053containing only the error message:
4054
4055.Response
4056----
4057 HTTP/1.1 200 OK
4058 Content-Disposition: attachment
4059 Content-Type: application/json; charset=UTF-8
4060
4061 )]}'
4062 "Anonymous users cannot submit"
4063----
4064
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004065[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004066=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004067--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004068'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004069--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004070
4071Gets the method the server will use to submit (merge) the change and
4072an indicator if the change is currently mergeable.
4073
4074.Request
4075----
4076 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
4077----
4078
Saša Živkov499873f2014-05-05 13:34:18 +02004079As response a link:#mergeable-info[MergeableInfo] entity is returned.
4080
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004081.Response
4082----
4083 HTTP/1.1 200 OK
4084 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004085 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004086
4087 )]}'
4088 {
4089 submit_type: "MERGE_IF_NECESSARY",
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004090 strategy: "recursive",
4091 mergeable: true
Shawn Pearce3a2a2472013-07-17 16:40:45 -07004092 }
4093----
4094
Saša Živkov697cab22014-04-29 16:46:50 +02004095If the `other-branches` parameter is specified, the mergeability will also be
Zhen Chen6729b632016-11-11 17:32:32 -08004096checked for all other branches which are listed in the
4097link:config-project-config.html#branchOrder-section[branchOrder] section in the
4098project.config file.
Saša Živkov697cab22014-04-29 16:46:50 +02004099
4100.Request
4101----
4102 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
4103----
4104
4105The response will then contain a list of all other branches where this changes
4106could merge cleanly.
4107
4108.Response
4109----
4110 HTTP/1.1 200 OK
4111 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004112 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02004113
4114 )]}'
4115 {
4116 submit_type: "MERGE_IF_NECESSARY",
4117 mergeable: true,
4118 mergeable_into: [
4119 "refs/heads/stable-2.7",
4120 "refs/heads/stable-2.8",
4121 ]
4122 }
4123----
4124
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004125[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004126=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004127--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004128'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004129--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004130
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004131Gets the method the server will use to submit (merge) the change.
4132
4133.Request
4134----
4135 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
4136----
4137
4138.Response
4139----
4140 HTTP/1.1 200 OK
4141 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004142 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004143
4144 )]}'
4145 "MERGE_IF_NECESSARY"
4146----
4147
4148[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004149=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004150--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004151'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004152--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004153
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004154Tests the submit_type Prolog rule in the project, or the one given.
4155
4156Request body may be either the Prolog code as `text/plain` or a
4157link:#rule-input[RuleInput] object. The query parameter `filters`
4158may be set to `SKIP` to bypass parent project filters while testing
4159a project-specific rule.
4160
4161.Request
4162----
4163 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004164 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004165
4166 submit_type(cherry_pick).
4167----
4168
4169.Response
4170----
4171 HTTP/1.1 200 OK
4172 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004173 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004174
4175 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07004176 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004177----
4178
4179[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004180=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004181--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004182'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004183--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004184
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004185Tests the submit_rule Prolog rule in the project, or the one given.
4186
4187Request body may be either the Prolog code as `text/plain` or a
4188link:#rule-input[RuleInput] object. The query parameter `filters`
4189may be set to `SKIP` to bypass parent project filters while testing
4190a project-specific rule.
4191
4192.Request
4193----
Shawn Pearcea3cce712014-03-21 08:16:11 -07004194 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004195 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004196
4197 submit_rule(submit(R)) :-
4198 R = label('Any-Label-Name', reject(_)).
4199----
4200
4201The response is a list of link:#submit-record[SubmitRecord] entries
4202describing the permutations that satisfy the tested submit rule.
4203
4204.Response
4205----
4206 HTTP/1.1 200 OK
4207 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004208 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08004209
4210 )]}'
4211 [
4212 {
4213 "status": "NOT_READY",
4214 "reject": {
4215 "Any-Label-Name": {}
4216 }
4217 }
4218 ]
4219----
4220
Shawn Pearceb42e3032015-04-02 10:28:10 -07004221When testing with the `curl` command line client the
4222`--data-binary @rules.pl` flag should be used to ensure
4223all LFs are included in the Prolog code:
4224
4225----
4226 curl -X POST \
4227 -H 'Content-Type: text/plain; charset=UTF-8' \
4228 --data-binary @rules.pl \
4229 http://.../test.submit_rule
4230----
4231
Edwin Kempincb6724a2013-02-26 16:58:51 +01004232[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004233=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004234--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004235'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004236--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004237
Edwin Kempin3ca57192013-02-27 07:44:01 +01004238Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01004239user.
4240
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004241Returns a map of file paths to lists of link:#comment-info[CommentInfo]
4242entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004243
4244.Request
4245----
4246 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
4247----
4248
4249.Response
4250----
4251 HTTP/1.1 200 OK
4252 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004253 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01004254
4255 )]}'
4256 {
4257 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4258 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004259 "id": "TvcXrmjM",
4260 "line": 23,
4261 "message": "[nit] trailing whitespace",
4262 "updated": "2013-02-26 15:40:43.986000000"
4263 },
4264 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004265 "id": "TveXwFiA",
4266 "line": 49,
4267 "in_reply_to": "TfYX-Iuo",
4268 "message": "Done",
4269 "updated": "2013-02-26 15:40:45.328000000"
4270 }
4271 ]
4272 }
4273----
4274
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004275[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004276=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004277--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004278'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004279--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004280
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004281Creates a draft comment on a revision.
4282
4283The new draft comment must be provided in the request body inside a
4284link:#comment-input[CommentInput] entity.
4285
4286.Request
4287----
4288 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004289 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004290
4291 {
4292 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4293 "line": 23,
4294 "message": "[nit] trailing whitespace"
4295 }
4296----
4297
4298As response a link:#comment-info[CommentInfo] entity is returned that
4299describes the draft comment.
4300
4301.Response
4302----
4303 HTTP/1.1 200 OK
4304 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004305 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004306
4307 )]}'
4308 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004309 "id": "TvcXrmjM",
4310 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4311 "line": 23,
4312 "message": "[nit] trailing whitespace",
4313 "updated": "2013-02-26 15:40:43.986000000"
4314 }
4315----
4316
Edwin Kempin3ca57192013-02-27 07:44:01 +01004317[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004318=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004319--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004320'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 -08004321--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004322
Edwin Kempin3ca57192013-02-27 07:44:01 +01004323Retrieves a draft comment of a revision that belongs to the calling
4324user.
4325
4326.Request
4327----
4328 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4329----
4330
4331As response a link:#comment-info[CommentInfo] entity is returned that
4332describes the draft comment.
4333
4334.Response
4335----
4336 HTTP/1.1 200 OK
4337 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004338 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01004339
4340 )]}'
4341 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01004342 "id": "TvcXrmjM",
4343 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4344 "line": 23,
4345 "message": "[nit] trailing whitespace",
4346 "updated": "2013-02-26 15:40:43.986000000"
4347 }
4348----
4349
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004350[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004351=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004352--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004353'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 -08004354--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004355
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004356Updates a draft comment on a revision.
4357
4358The new draft comment must be provided in the request body inside a
4359link:#comment-input[CommentInput] entity.
4360
4361.Request
4362----
4363 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004364 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004365
4366 {
4367 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4368 "line": 23,
4369 "message": "[nit] trailing whitespace"
4370 }
4371----
4372
4373As response a link:#comment-info[CommentInfo] entity is returned that
4374describes the draft comment.
4375
4376.Response
4377----
4378 HTTP/1.1 200 OK
4379 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004380 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004381
4382 )]}'
4383 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004384 "id": "TvcXrmjM",
4385 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4386 "line": 23,
4387 "message": "[nit] trailing whitespace",
4388 "updated": "2013-02-26 15:40:43.986000000"
4389 }
4390----
4391
4392[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004393=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004394--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004395'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 -08004396--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004397
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004398Deletes a draft comment from a revision.
4399
4400.Request
4401----
4402 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4403----
4404
4405.Response
4406----
4407 HTTP/1.1 204 No Content
4408----
4409
John Spurlock5e402f02013-03-24 11:35:04 -04004410[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004411=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004412--
John Spurlock5e402f02013-03-24 11:35:04 -04004413'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004414--
John Spurlock5e402f02013-03-24 11:35:04 -04004415
4416Lists the published comments of a revision.
4417
4418As result a map is returned that maps the file path to a list of
4419link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07004420sorted by file path and only include file (or inline) comments. Use
4421the link:#get-change-detail[Get Change Detail] endpoint to retrieve
4422the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04004423
4424.Request
4425----
4426 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
4427----
4428
4429.Response
4430----
4431 HTTP/1.1 200 OK
4432 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004433 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004434
4435 )]}'
4436 {
4437 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4438 {
John Spurlock5e402f02013-03-24 11:35:04 -04004439 "id": "TvcXrmjM",
4440 "line": 23,
4441 "message": "[nit] trailing whitespace",
4442 "updated": "2013-02-26 15:40:43.986000000",
4443 "author": {
4444 "_account_id": 1000096,
4445 "name": "John Doe",
4446 "email": "john.doe@example.com"
4447 }
4448 },
4449 {
John Spurlock5e402f02013-03-24 11:35:04 -04004450 "id": "TveXwFiA",
4451 "line": 49,
4452 "in_reply_to": "TfYX-Iuo",
4453 "message": "Done",
4454 "updated": "2013-02-26 15:40:45.328000000",
4455 "author": {
4456 "_account_id": 1000097,
4457 "name": "Jane Roe",
4458 "email": "jane.roe@example.com"
4459 }
4460 }
4461 ]
4462 }
4463----
4464
4465[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004466=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004467--
John Spurlock5e402f02013-03-24 11:35:04 -04004468'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 -08004469--
John Spurlock5e402f02013-03-24 11:35:04 -04004470
4471Retrieves a published comment of a revision.
4472
4473.Request
4474----
4475 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
4476----
4477
4478As response a link:#comment-info[CommentInfo] entity is returned that
4479describes the published comment.
4480
4481.Response
4482----
4483 HTTP/1.1 200 OK
4484 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004485 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004486
4487 )]}'
4488 {
John Spurlock5e402f02013-03-24 11:35:04 -04004489 "id": "TvcXrmjM",
4490 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4491 "line": 23,
4492 "message": "[nit] trailing whitespace",
4493 "updated": "2013-02-26 15:40:43.986000000",
4494 "author": {
4495 "_account_id": 1000096,
4496 "name": "John Doe",
4497 "email": "john.doe@example.com"
4498 }
4499 }
4500----
4501
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01004502[[delete-comment]]
4503=== Delete Comment
4504--
4505'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]' +
4506'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/link:#comment-id[\{comment-id\}]/delete'
4507--
4508
4509Deletes a published comment of a revision. Instead of deleting the
4510whole comment, this endpoint just replaces the comment's message
4511with a new message, which contains the name of the user who deletes
4512the comment and the reason why it's deleted. The reason can be
4513provided in the request body as a
4514link:#delete-comment-input[DeleteCommentInput] entity.
4515
4516Note that only users with the
4517link:access-control.html#capability_administrateServer[Administrate Server]
4518global capability are permitted to delete a comment.
4519
4520Please note that some proxies prohibit request bodies for DELETE
4521requests. In this case, if you want to specify options, use a
4522POST request:
4523
4524.Request
4525----
4526 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM/delete HTTP/1.0
4527 Content-Type: application/json; charset=UTF-8
4528
4529 {
4530 "reason": "contains confidential information"
4531 }
4532----
4533
4534As response a link:#comment-info[CommentInfo] entity is returned that
4535describes the updated comment.
4536
4537.Response
4538----
4539 HTTP/1.1 200 OK
4540 Content-Disposition: attachment
4541 Content-Type: application/json; charset=UTF-8
4542
4543 )]}'
4544 {
4545 "id": "TvcXrmjM",
4546 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4547 "line": 23,
4548 "message": "Comment removed by: Administrator; Reason: contains confidential information",
4549 "updated": "2013-02-26 15:40:43.986000000",
4550 "author": {
4551 "_account_id": 1000096,
4552 "name": "John Doe",
4553 "email": "john.doe@example.com"
4554 }
4555 }
4556----
4557
Edwin Kempinb050a482016-12-01 09:11:19 +01004558[[list-robot-comments]]
Edwin Kempin3fde7e42016-09-19 15:35:10 +02004559=== List Robot Comments
4560--
4561'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/'
4562--
4563
4564Lists the link:config-robot-comments.html[robot comments] of a
4565revision.
4566
4567As result a map is returned that maps the file path to a list of
4568link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
4569map are sorted by file path.
4570
4571.Request
4572----
4573 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0
4574----
4575
4576.Response
4577----
4578 HTTP/1.1 200 OK
4579 Content-Disposition: attachment
4580 Content-Type: application/json; charset=UTF-8
4581
4582 )]}'
4583 {
4584 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4585 {
4586 "id": "TvcXrmjM",
4587 "line": 23,
4588 "message": "unused import",
4589 "updated": "2016-02-26 15:40:43.986000000",
4590 "author": {
4591 "_account_id": 1000110,
4592 "name": "Code Analyzer",
4593 "email": "code.analyzer@example.com"
4594 },
4595 "robotId": "importChecker",
4596 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
4597 },
4598 {
4599 "id": "TveXwFiA",
4600 "line": 49,
4601 "message": "wrong indention",
4602 "updated": "2016-02-26 15:40:45.328000000",
4603 "author": {
4604 "_account_id": 1000110,
4605 "name": "Code Analyzer",
4606 "email": "code.analyzer@example.com"
4607 },
4608 "robotId": "styleChecker",
4609 "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b"
4610 }
4611 ]
4612 }
4613----
4614
4615[[get-robot-comment]]
4616=== Get Robot Comment
4617--
4618'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]'
4619--
4620
4621Retrieves a link:config-robot-comments.html[robot comment] of a
4622revision.
4623
4624.Request
4625----
4626 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0
4627----
4628
4629As response a link:#robot-comment-info[RobotCommentInfo] entity is
4630returned that describes the robot comment.
4631
4632.Response
4633----
4634 HTTP/1.1 200 OK
4635 Content-Disposition: attachment
4636 Content-Type: application/json; charset=UTF-8
4637
4638 )]}'
4639 {
4640 "id": "TvcXrmjM",
4641 "line": 23,
4642 "message": "unused import",
4643 "updated": "2016-02-26 15:40:43.986000000",
4644 "author": {
4645 "_account_id": 1000110,
4646 "name": "Code Analyzer",
4647 "email": "code.analyzer@example.com"
4648 },
4649 "robotId": "importChecker",
4650 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
4651 }
4652----
4653
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01004654[[apply-fix]]
4655=== Apply Fix
4656--
4657'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply'
4658--
4659
4660Applies a suggested fix by creating a change edit which includes the
4661modifications indicated by the fix suggestion. If a change edit already exists,
4662it will be updated accordingly. A fix can only be applied if no change edit
4663exists and the fix refers to the current patch set, or the fix refers to the
4664patch set on which the change edit is based.
4665
4666.Request
4667----
4668 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0
4669----
4670
4671If the fix was successfully applied, an <<edit-info,EditInfo>> describing the
4672resulting change edit is returned.
4673
4674.Response
4675----
4676 HTTP/1.1 200 OK
4677 Content-Disposition: attachment
4678 Content-Type: application/json; charset=UTF-8
4679
4680 )]}'
4681 {
4682 "commit":{
4683 "parents":[
4684 {
4685 "commit":"1eee2c9d8f352483781e772f35dc586a69ff5646",
4686 }
4687 ],
4688 "author":{
4689 "name":"John Doe",
4690 "email":"john.doe@example.com",
4691 "date":"2013-05-07 15:21:27.000000000",
4692 "tz":120
4693 },
4694 "committer":{
4695 "name":"Jane Doe",
4696 "email":"jane.doe@example.com",
4697 "date":"2013-05-07 15:35:43.000000000",
4698 "tz":120
4699 },
4700 "subject":"Implement feature X",
4701 "message":"Implement feature X\n\nWith this feature ..."
4702 },
4703 "base_revision":"674ac754f91e64a0efb8087e59a176484bd534d1"
4704 }
4705----
4706
4707If the application failed e.g. due to conflicts with an existing change edit,
4708the response "`409 Conflict`" including an error message in the response body
4709is returned.
4710
4711.Response
4712----
4713 HTTP/1.1 409 Conflict
4714 Content-Disposition: attachment
4715 Content-Type: text/plain; charset=UTF-8
4716
4717 The existing change edit could not be merged with another tree.
4718----
4719
Edwin Kempin682ac712013-05-14 13:40:46 +02004720[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004721=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004722--
Edwin Kempin682ac712013-05-14 13:40:46 +02004723'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004724--
Edwin Kempin682ac712013-05-14 13:40:46 +02004725
4726Lists the files that were modified, added or deleted in a revision.
4727
4728.Request
4729----
4730 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
4731----
4732
David Pursehouse11badbb2017-03-27 10:58:05 +09004733As result a map is returned that maps the link:#file-id[file path] to a list of
Edwin Kempin682ac712013-05-14 13:40:46 +02004734link:#file-info[FileInfo] entries. The entries in the map are
4735sorted by file path.
4736
4737.Response
4738----
4739 HTTP/1.1 200 OK
4740 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004741 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02004742
4743 )]}'
4744 {
4745 "/COMMIT_MSG": {
4746 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02004747 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01004748 "size_delta": 551,
4749 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02004750 },
4751 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
4752 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02004753 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01004754 "size_delta": 98,
4755 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02004756 }
4757 }
4758----
4759
Shawn Pearce984747d2013-07-18 00:42:16 -07004760The request parameter `reviewed` changes the response to return a list
4761of the paths the caller has marked as reviewed. Clients that also
4762need the FileInfo should make two requests.
4763
Shawn Pearce8ca03a62015-01-02 22:03:20 -08004764The request parameter `q` changes the response to return a list
4765of all files (modified or unmodified) that contain that substring
4766in the path name. This is useful to implement suggestion services
4767finding a file by partial name.
4768
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01004769The integer-valued request parameter `parent` changes the response to return a
4770list of the files which are different in this commit compared to the given
4771parent commit. This is useful for supporting review of merge commits. The value
4772is the 1-based index of the parent's position in the commit object.
4773
Shawn Pearce984747d2013-07-18 00:42:16 -07004774.Request
4775----
4776 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
4777----
4778
4779.Response
4780----
4781 HTTP/1.1 200 OK
4782 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004783 Content-Type: application/json; charset=UTF-8
Shawn Pearce984747d2013-07-18 00:42:16 -07004784
4785 )]}'
4786 [
4787 "/COMMIT_MSG",
4788 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4789 ]
4790----
4791
Edwin Kempinaef44b02013-05-07 16:15:55 +02004792[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004793=== Get Content
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004794--
Edwin Kempinbea55a52013-05-14 13:53:39 +02004795'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/content'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004796--
Edwin Kempinaef44b02013-05-07 16:15:55 +02004797
4798Gets the content of a file from a certain revision.
4799
Patrick Hiesel38667d42017-05-02 13:12:48 +02004800The optional, integer-valued `parent` parameter can be specified to request
4801the named file from a parent commit of the specified revision. The value is
4802the 1-based index of the parent's position in the commit object. If the
4803parameter is omitted or the value is non-positive, the patch set is referenced.
4804
Edwin Kempinaef44b02013-05-07 16:15:55 +02004805.Request
4806----
4807 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
4808----
4809
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05004810The content is returned as base64 encoded string. The HTTP response
4811Content-Type is always `text/plain`, reflecting the base64 wrapping.
4812A Gerrit-specific `X-FYI-Content-Type` header is returned describing
4813the server detected content type of the file.
4814
4815If only the content type is required, callers should use HEAD to
4816avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02004817
4818.Response
4819----
4820 HTTP/1.1 200 OK
4821 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05004822 Content-Type: text/plain; charset=ISO-8859-1
4823 X-FYI-Content-Encoding: base64
4824 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02004825
4826 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
4827----
4828
David Ostrovskyd0078672015-02-06 21:51:04 +01004829Alternatively, if the only value of the Accept request header is
4830`application/json` the content is returned as JSON string and
4831`X-FYI-Content-Encoding` is set to `json`.
4832
David Pletcherd1efb452015-09-01 17:45:55 -07004833[[get-safe-content]]
4834=== Download Content
4835--
4836'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
4837--
4838
4839Downloads the content of a file from a certain revision, in a safe format
4840that poses no risk for inadvertent execution of untrusted code.
4841
4842If the content type is defined as safe, the binary file content is returned
4843verbatim. If the content type is not safe, the file is stored inside a ZIP
4844file, containing a single entry with a random, unpredictable name having the
4845same base and suffix as the true filename. The ZIP file is returned in
4846verbatim binary form.
4847
4848See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
4849for information about safe file type configuration.
4850
4851The HTTP resource Content-Type is dependent on the file type: the
4852applicable type for safe files, or "application/zip" for unsafe files.
4853
David Pletcherec622bf2015-09-18 14:30:05 -07004854The optional, integer-valued `parent` parameter can be specified to request
4855the named file from a parent commit of the specified revision. The value is
4856the 1-based index of the parent's position in the commit object. If the
4857parameter is omitted or the value non-positive, the patch set is referenced.
4858
4859Filenames are decorated with a suffix of `_new` for the current patch,
4860`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07004861
4862.Request
4863----
David Pursehouse6147f6d2016-10-18 05:40:44 +00004864 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/download HTTP/1.0
David Pletcherd1efb452015-09-01 17:45:55 -07004865----
4866
4867.Response
4868----
4869 HTTP/1.1 200 OK
4870 Content-Disposition: attachment; filename="logo.png"
4871 Content-Type: image/png
4872
4873 `[binary data for logo.png]`
4874----
4875
4876.Request
4877----
David Pursehouse6147f6d2016-10-18 05:40:44 +00004878 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 -07004879----
4880
4881.Response
4882----
4883 HTTP/1.1 200 OK
4884 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
4885 Content-Type:application/zip
4886
4887 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
4888----
4889
David Pursehouse882aef22013-06-05 10:56:37 +09004890[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004891=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004892--
David Pursehouse882aef22013-06-05 10:56:37 +09004893'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 -08004894--
David Pursehouse882aef22013-06-05 10:56:37 +09004895
4896Gets the diff of a file from a certain revision.
4897
4898.Request
4899----
4900 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
4901----
4902
4903As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
4904
4905.Response
4906----
4907 HTTP/1.1 200 OK
4908 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004909 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09004910
4911 )]
4912 {
4913 "meta_a": {
4914 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004915 "content_type": "text/x-java-source",
4916 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09004917 },
4918 "meta_b": {
4919 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004920 "content_type": "text/x-java-source",
4921 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09004922 },
4923 "change_type": "MODIFIED",
4924 "diff_header": [
4925 "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",
4926 "index 59b7670..9faf81c 100644",
4927 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4928 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
4929 ],
4930 "content": [
4931 {
4932 "ab": [
4933 "// Copyright (C) 2010 The Android Open Source Project",
4934 "//",
4935 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
4936 "// you may not use this file except in compliance with the License.",
4937 "// You may obtain a copy of the License at",
4938 "//",
4939 "// http://www.apache.org/licenses/LICENSE-2.0",
4940 "//",
4941 "// Unless required by applicable law or agreed to in writing, software",
4942 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
4943 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
4944 "// See the License for the specific language governing permissions and",
4945 "// limitations under the License."
4946 ]
4947 },
4948 {
4949 "b": [
4950 "//",
4951 "// Add some more lines in the header."
4952 ]
4953 },
4954 {
4955 "ab": [
4956 "",
4957 "package com.google.gerrit.server.project;",
4958 "",
4959 "import com.google.common.collect.Maps;",
4960 ...
4961 ]
4962 }
4963 ...
4964 ]
4965 }
4966----
4967
4968If the `intraline` parameter is specified, intraline differences are included in the diff.
4969
4970.Request
4971----
4972 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
4973----
4974
4975.Response
4976----
4977 HTTP/1.1 200 OK
4978 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004979 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09004980
4981 )]
4982 {
4983 "meta_a": {
4984 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004985 "content_type": "text/x-java-source",
4986 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09004987 },
4988 "meta_b": {
4989 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004990 "content_type": "text/x-java-source",
4991 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09004992 },
4993 "change_type": "MODIFIED",
4994 "diff_header": [
4995 "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",
4996 "index 59b7670..9faf81c 100644",
4997 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4998 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
4999 ],
5000 "content": [
5001 ...
5002 {
5003 "a": [
5004 "/** Manages access control for Git references (aka branches, tags). */"
5005 ],
5006 "b": [
5007 "/** Manages access control for the Git references (aka branches, tags). */"
5008 ],
5009 "edit_a": [],
5010 "edit_b": [
5011 [
5012 31,
5013 4
5014 ]
5015 ]
5016 }
5017 ]
5018 }
5019----
5020
5021The `base` parameter can be specified to control the base patch set from which the diff should
5022be generated.
5023
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005024The integer-valued request parameter `parent` can be specified to control the
5025parent commit number against which the diff should be generated. This is useful
5026for supporting review of merge commits. The value is the 1-based index of the
5027parent's position in the commit object.
5028
Edwin Kempin8cdce502014-12-06 10:55:38 +01005029[[weblinks-only]]
5030If the `weblinks-only` parameter is specified, only the diff web links are returned.
5031
David Pursehouse882aef22013-06-05 10:56:37 +09005032.Request
5033----
5034 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
5035----
5036
5037.Response
5038----
5039 HTTP/1.1 200 OK
5040 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005041 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09005042
5043 )]
5044 {
5045 "meta_a": {
5046 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005047 "content_type": "text/x-java-source",
5048 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005049 },
5050 "meta_b": {
5051 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08005052 "content_type": "text/x-java-source",
5053 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09005054 },
5055 "change_type": "MODIFIED",
5056 "content": [
5057 {
5058 "skip": 578
5059 }
5060 ]
5061 }
5062----
5063
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01005064The `whitespace` parameter can be specified to control how whitespace
5065differences are reported in the result. Valid values are `IGNORE_NONE`,
5066`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09005067
5068The `context` parameter can be specified to control the number of lines of surrounding context
5069in the diff. Valid values are `ALL` or number of lines.
5070
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005071[[get-blame]]
5072=== Get Blame
5073--
5074'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
5075--
5076
5077Gets the blame of a file from a certain revision.
5078
5079.Request
5080----
5081 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
5082----
5083
5084As response a link:#blame-info[BlameInfo] entity is returned that describes the
5085blame.
5086
5087.Response
5088----
5089 HTTP/1.1 200 OK
5090 Content-Disposition: attachment
5091 Content-Type: application/json; charset=UTF-8
5092
5093 )]
5094 {
5095 [
5096 {
5097 "author": "Joe Daw",
5098 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
5099 "time": 1421441349,
5100 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
5101 "ranges": [
5102 {
5103 "start": 1,
5104 "end": 10
5105 },
5106 {
5107 "start": 16,
5108 "end": 296
5109 }
5110 ]
5111 },
5112 {
5113 "author": "Jane Daw",
5114 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
5115 "time": 1421825421,
5116 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
5117 "ranges": [
5118 {
5119 "start": 13,
5120 "end": 13
5121 }
5122 ]
5123 }
5124 ]
5125 }
5126----
5127
5128The `base` parameter can be specified to control the base patch set from which
5129the blame should be generated.
5130
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005131[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005132=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005133--
Edwin Kempinbea55a52013-05-14 13:53:39 +02005134'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 -08005135--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005136
Edwin Kempinbea55a52013-05-14 13:53:39 +02005137Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005138
5139.Request
5140----
5141 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
5142----
5143
5144.Response
5145----
5146 HTTP/1.1 201 Created
5147----
5148
Edwin Kempinbea55a52013-05-14 13:53:39 +02005149If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005150response is "`200 OK`".
5151
5152[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005153=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005154--
Edwin Kempinbea55a52013-05-14 13:53:39 +02005155'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 -08005156--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01005157
Edwin Kempinbea55a52013-05-14 13:53:39 +02005158Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005159
5160.Request
5161----
5162 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
5163----
5164
5165.Response
5166----
5167 HTTP/1.1 204 No Content
5168----
5169
Gustaf Lundh019fb262012-11-28 14:20:22 +01005170[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005171=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005172--
Gustaf Lundh019fb262012-11-28 14:20:22 +01005173'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08005174--
Gustaf Lundh019fb262012-11-28 14:20:22 +01005175
5176Cherry picks a revision to a destination branch.
5177
5178The commit message and destination branch must be provided in the request body inside a
Han-Wen Nienhuys02272e02017-03-28 14:47:09 +02005179link:#cherrypick-input[CherryPickInput] entity. If the commit message
5180does not specify a Change-Id, a new one is picked for the destination change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005181
5182.Request
5183----
5184 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005185 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01005186
5187 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01005188 "message" : "Implementing Feature X",
5189 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01005190 }
5191----
5192
5193As response a link:#change-info[ChangeInfo] entity is returned that
5194describes the resulting cherry picked change.
5195
5196.Response
5197----
5198 HTTP/1.1 200 OK
5199 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09005200 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01005201
5202 )]}'
5203 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01005204 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
5205 "project": "myProject",
5206 "branch": "release-branch",
5207 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
5208 "subject": "Implementing Feature X",
5209 "status": "NEW",
5210 "created": "2013-02-01 09:59:32.126000000",
5211 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01005212 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01005213 "insertions": 12,
5214 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01005215 "_number": 3965,
5216 "owner": {
5217 "name": "John Doe"
5218 }
5219 }
5220----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005221
Changcheng Xiao2fcae692017-01-02 12:38:30 +01005222[[revision-reviewer-endpoints]]
5223== Revision Reviewer Endpoints
5224
5225[[list-revision-reviewers]]
5226=== List Revision Reviewers
5227--
5228'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/'
5229--
5230
5231Lists the reviewers of a revision.
5232
5233Please note that only the current revision is supported.
5234
5235As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
5236
5237.Request
5238----
5239 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0
5240----
5241
5242.Response
5243----
5244 HTTP/1.1 200 OK
5245 Content-Disposition: attachment
5246 Content-Type: application/json; charset=UTF-8
5247
5248 )]}'
5249 [
5250 {
5251 "approvals": {
5252 "Verified": "+1",
5253 "Code-Review": "+2"
5254 },
5255 "_account_id": 1000096,
5256 "name": "John Doe",
5257 "email": "john.doe@example.com"
5258 },
5259 {
5260 "approvals": {
5261 "Verified": " 0",
5262 "Code-Review": "-1"
5263 },
5264 "_account_id": 1000097,
5265 "name": "Jane Roe",
5266 "email": "jane.roe@example.com"
5267 }
5268 ]
5269----
5270
5271[[list-revision-votes]]
5272=== List Revision Votes
5273--
5274'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
5275--
5276
5277Lists the votes for a specific reviewer of the revision.
5278
5279Please note that only the current revision is supported.
5280
5281.Request
5282----
5283 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0
5284----
5285
5286As result a map is returned that maps the label name to the label value.
5287The entries in the map are sorted by label name.
5288
5289.Response
5290----
5291 HTTP/1.1 200 OK
5292 Content-Disposition: attachment
5293 Content-Type: application/json;charset=UTF-8
5294
5295 )]}'
5296 {
5297 "Code-Review": -1,
5298 "Verified": 1,
5299 "Work-In-Progress": 1
5300 }
5301----
5302
5303[[delete-revision-vote]]
5304=== Delete Revision Vote
5305--
5306'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
5307/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' +
5308'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
5309/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete'
5310--
5311
5312Deletes a single vote from a revision. The deletion will be possible only
5313if the revision is the current revision. By using this endpoint you can prevent
5314deleting the vote (with same label) from a newer patch set by mistake.
5315
5316Note, that even when the last vote of a reviewer is removed the reviewer itself
5317is still listed on the change.
5318
5319Options can be provided in the request body as a
5320link:#delete-vote-input[DeleteVoteInput] entity.
5321
5322.Request
5323----
5324 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
5325 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5326----
5327
5328Please note that some proxies prohibit request bodies for DELETE
5329requests. In this case, if you want to specify options, use a POST
5330request:
5331
5332.Request
5333----
5334 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5335 Content-Type: application/json; charset=UTF-8
5336
5337 {
5338 "notify": "NONE"
5339 }
5340----
5341
5342.Response
5343----
5344 HTTP/1.1 204 No Content
5345----
5346
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005347[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005348== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005349
Edwin Kempina3d02ef2013-02-22 16:31:53 +01005350[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005351=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01005352--
5353--
5354
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005355[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005356=== \{change-id\}
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005357Identifier that uniquely identifies one change.
5358
5359This can be:
5360
Patrick Hiesel4d2dd182017-05-09 17:35:18 +02005361* an ID of the change in the format "'$$<project>~<numericId>$$'"
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005362* an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'",
5363 where for the branch the `refs/heads/` prefix can be omitted
5364 ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$")
5365* a Change-Id if it uniquely identifies one change
5366 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
Patrick Hiesel4d2dd182017-05-09 17:35:18 +02005367* a numeric change ID ("4247")
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005368
John Spurlock5e402f02013-03-24 11:35:04 -04005369[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005370=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04005371UUID of a published comment.
5372
Edwin Kempin3ca57192013-02-27 07:44:01 +01005373[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005374=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01005375UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005376
David Ostrovskybeb0b842014-12-13 00:24:29 +01005377[[label-id]]
5378=== \{label-id\}
5379The name of the label.
5380
Edwin Kempinbea55a52013-05-14 13:53:39 +02005381[[file-id]]
David Pursehouseb10c2662016-12-06 08:41:33 +09005382=== \{file-id\}
Edwin Kempinbea55a52013-05-14 13:53:39 +02005383The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005384
David Pursehouse11badbb2017-03-27 10:58:05 +09005385The following magic paths are supported:
5386
5387* `/COMMIT_MSG`:
5388+
5389The commit message and headers with the parent commit(s), the author
5390information and the committer information.
5391
5392* `/MERGE_LIST` (for merge commits only):
5393+
5394The list of commits that are being integrated into the destination
5395branch by submitting the merge commit.
5396
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01005397[[fix-id]]
5398=== \{fix-id\}
5399UUID of a suggested fix.
5400
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005401[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005402=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005403Identifier that uniquely identifies one revision of a change.
5404
5405This can be:
5406
Shawn Pearce9c0722a2013-03-02 15:30:31 -08005407* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005408* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
5409* an abbreviated commit ID that uniquely identifies one revision of the
5410 change ("674ac754"), at least 4 digits are required
5411* a legacy numeric patch number ("1" for first patch set of the change)
Edwin Kempin8cc0bab2016-09-15 15:53:37 +02005412* "0" or the literal `edit` for a change edit
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005413
Edwin Kempine3446292013-02-19 16:40:14 +01005414[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005415== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01005416
Edwin Kempined5364b2013-02-22 10:39:33 +01005417[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005418=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01005419The `AbandonInput` entity contains information for abandoning a change.
5420
David Pursehouseae367192014-11-25 17:24:47 +09005421[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01005422|=============================
5423|Field Name ||Description
5424|`message` |optional|
Edwin Kempined5364b2013-02-22 10:39:33 +01005425Message to be added as review comment to the change when abandoning the
5426change.
Edwin Kempincd07df42016-12-01 09:10:09 +01005427|`notify` |optional|
Stephen Lie5fcdf72016-08-02 11:05:11 -07005428Notify handling that defines to whom email notifications should be sent after
5429the change is abandoned. +
5430Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5431If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01005432|`notify_details`|optional|
5433Additional information about whom to notify about the update as a map
5434of recipient type to link:#notify-info[NotifyInfo] entity.
5435|=============================
Edwin Kempined5364b2013-02-22 10:39:33 +01005436
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005437[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005438=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005439The `ActionInfo` entity describes a REST API call the client can
5440make to manipulate a resource. These are frequently implemented by
5441plugins and may be discovered at runtime.
5442
David Pursehouseae367192014-11-25 17:24:47 +09005443[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005444|====================================
5445|Field Name ||Description
5446|`method` |optional|
5447HTTP method to use with the action. Most actions use `POST`, `PUT`
5448or `DELETE` to cause state changes.
5449|`label` |optional|
5450Short title to display to a user describing the action. In the
5451Gerrit web interface the label is used as the text on the button
5452presented in the UI.
5453|`title` |optional|
5454Longer text to display describing the action. In a web UI this
5455should be the title attribute of the element, displaying when
5456the user hovers the mouse.
5457|`enabled` |optional|
5458If true the action is permitted at this time and the caller is
5459likely allowed to execute it. This may change if state is updated
5460at the server or permissions are modified. Not present if false.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005461|====================================
5462
Edwin Kempin392328e2013-02-25 12:50:03 +01005463[[add-reviewer-result]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005464=== AddReviewerResult
Edwin Kempin392328e2013-02-25 12:50:03 +01005465The `AddReviewerResult` entity describes the result of adding a
5466reviewer to a change.
5467
David Pursehouseae367192014-11-25 17:24:47 +09005468[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01005469|===========================
5470|Field Name ||Description
Logan Hanks23e70282016-07-06 14:31:56 -07005471|`input` ||
5472Value of the `reviewer` field from link:#reviewer-input[ReviewerInput]
5473set while adding the reviewer.
Edwin Kempin392328e2013-02-25 12:50:03 +01005474|`reviewers` |optional|
5475The newly added reviewers as a list of link:#reviewer-info[
5476ReviewerInfo] entities.
Logan Hanksee0a4182016-07-06 14:39:26 -07005477|`ccs` |optional|
5478The newly CCed accounts as a list of link:#reviewer-info[
5479ReviewerInfo] entities. This field will only appear if the requested
5480`state` for the reviewer was `CC` *and* NoteDb is enabled on the
5481server.
Edwin Kempin392328e2013-02-25 12:50:03 +01005482|`error` |optional|
5483Error message explaining why the reviewer could not be added. +
5484If a group was specified in the input and an error is returned, it
5485means that none of the members were added as reviewer.
5486|`confirm` |`false` if not set|
5487Whether adding the reviewer requires confirmation.
5488|===========================
5489
Edwin Kempine3446292013-02-19 16:40:14 +01005490[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005491=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005492The `ApprovalInfo` entity contains information about an approval from a
5493user for a label on a change.
5494
Edwin Kempin963dfd02013-02-27 12:39:32 +01005495`ApprovalInfo` has the same fields as
5496link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01005497In addition `ApprovalInfo` has the following fields:
5498
David Pursehouseae367192014-11-25 17:24:47 +09005499[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005500|===========================
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005501|Field Name ||Description
5502|`value` |optional|
Dave Borowitza30db912013-03-22 14:20:33 -07005503The vote that the user has given for the label. If present and zero, the
5504user is permitted to vote on the label. If absent, the user is not
5505permitted to vote on that label.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005506|`permitted_voting_range` |optional|
5507The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote
5508on that label. If present, the user is permitted to vote on the label
5509regarding the range values. If absent, the user is not permitted to vote
5510on that label.
5511|`date` |optional|
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01005512The time and date describing when the approval was made.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005513|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005514Value of the `tag` field from link:#review-input[ReviewInput] set
5515while posting the review.
5516NOTE: To apply different tags on on different votes/comments multiple
5517invocations of the REST call are required.
Dave Borowitze47fe472016-09-09 13:57:14 -04005518|`post_submit` |not set if `false`|
5519If true, this vote was made after the change was submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01005520|===========================
5521
Sven Selberg273a4aa2016-09-21 16:28:10 +02005522[[assignee-input]]
5523=== AssigneeInput
5524The `AssigneeInput` entity contains the identity of the user to be set as assignee.
5525
5526[options="header",cols="1,^1,5"]
5527|===========================
5528|Field Name ||Description
5529|`assignee` ||
5530The link:rest-api-accounts.html#account-id[ID] of one account that
5531should be added as assignee.
5532|===========================
5533
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005534[[blame-info]]
5535=== BlameInfo
5536The `BlameInfo` entity stores the commit metadata with the row coordinates where
5537it applies.
5538
5539[options="header",cols="1,6"]
5540|===========================
5541|Field Name | Description
5542|`author` | The author of the commit.
5543|`id` | The id of the commit.
5544|`time` | Commit time.
5545|`commit_msg` | The commit message.
5546|`ranges` |
5547The blame row coordinates as link:#range-info[RangeInfo] entities.
5548|===========================
5549
Edwin Kempin521c1242015-01-23 12:44:44 +01005550[[change-edit-input]]
5551=== ChangeEditInput
5552The `ChangeEditInput` entity contains information for restoring a
5553path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02005554
Edwin Kempin521c1242015-01-23 12:44:44 +01005555[options="header",cols="1,^1,5"]
5556|===========================
5557|Field Name ||Description
5558|`restore_path`|optional|Path to file to restore.
5559|`old_path` |optional|Old path to file to rename.
5560|`new_path` |optional|New path to file to rename.
5561|===========================
5562
5563[[change-edit-message-input]]
5564=== ChangeEditMessageInput
5565The `ChangeEditMessageInput` entity contains information for changing
5566the commit message within a change edit.
5567
5568[options="header",cols="1,^1,5"]
5569|===========================
5570|Field Name ||Description
5571|`message` ||New commit message.
5572|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02005573
Edwin Kempine3446292013-02-19 16:40:14 +01005574[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005575=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005576The `ChangeInfo` entity contains information about a change.
5577
David Pursehouseae367192014-11-25 17:24:47 +09005578[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005579|==================================
5580|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01005581|`id` ||
5582The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
John Spurlockd25fad12013-03-09 11:48:49 -05005583where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the
Edwin Kempine3446292013-02-19 16:40:14 +01005584`refs/heads/` prefix is omitted.
5585|`project` ||The name of the project.
5586|`branch` ||
5587The name of the target branch. +
5588The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01005589|`topic` |optional|The topic to which this change belongs.
Edwin Kempine3446292013-02-19 16:40:14 +01005590|`change_id` ||The Change-Id of the change.
5591|`subject` ||
5592The subject of the change (header line of the commit message).
5593|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07005594The status of the change (`NEW`, `MERGED`, `ABANDONED`, `DRAFT`).
Edwin Kempine3446292013-02-19 16:40:14 +01005595|`created` ||
5596The link:rest-api.html#timestamp[timestamp] of when the change was
5597created.
5598|`updated` ||
5599The link:rest-api.html#timestamp[timestamp] of when the change was last
5600updated.
Khai Do96a7caf2016-01-07 14:07:54 -08005601|`submitted` |only set for merged changes|
5602The link:rest-api.html#timestamp[timestamp] of when the change was
5603submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01005604|`starred` |not set if `false`|
Edwin Kempin9e972cc2016-04-15 10:39:13 +02005605Whether the calling user has starred this change with the default label.
5606|`stars` |optional|
5607A list of star labels that are applied by the calling user to this
5608change. The labels are lexicographically sorted.
Edwin Kempine3446292013-02-19 16:40:14 +01005609|`reviewed` |not set if `false`|
5610Whether the change was reviewed by the calling user.
Gustaf Lundh7626fc42017-04-28 14:37:33 +02005611|`muted` |not set if `false`|
5612Whether the change has been link:#mute[muted] by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07005613Only set if link:#reviewed[reviewed] is requested.
Dave Borowitzace32102015-12-17 13:08:25 -05005614|`submit_type` |optional|
5615The link:project-configuration.html#submit_type[submit type] of the change. +
5616Not set for merged changes.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01005617|`mergeable` |optional|
5618Whether the change is mergeable. +
Dave Borowitze5fbeeb2014-06-27 09:47:49 -07005619Not set for merged changes, or if the change has not yet been tested.
Shawn Pearce4cd05b22016-09-17 22:45:33 -07005620|`submittable` |optional|
5621Whether the change has been approved by the project submit rules. +
Jonathan Niedercb51d742016-09-23 11:37:57 -07005622Only set if link:#submittable[requested].
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01005623|`insertions` ||
5624Number of inserted lines.
5625|`deletions` ||
5626Number of deleted lines.
Changcheng Xiao81c48092017-02-08 13:04:07 +01005627|`unresolved_comment_count` |optional|
5628Number of unresolved comments. Not set if the current change index doesn't have the data.
Edwin Kempine3446292013-02-19 16:40:14 +01005629|`_number` ||The legacy numeric ID of the change.
5630|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01005631The owner of the change as an link:rest-api-accounts.html#account-info[
5632AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07005633|`actions` |optional|
5634Actions the caller might be able to perform on this revision. The
5635information is a map of view name to link:#action-info[ActionInfo]
5636entities.
Edwin Kempine3446292013-02-19 16:40:14 +01005637|`labels` |optional|
5638The labels of the change as a map that maps the label names to
5639link:#label-info[LabelInfo] entries. +
5640Only set if link:#labels[labels] or link:#detailed-labels[detailed
5641labels] are requested.
5642|`permitted_labels` |optional|
5643A map of the permitted labels that maps a label name to the list of
5644values that are allowed for that label. +
5645Only set if link:#detailed-labels[detailed labels] are requested.
5646|`removable_reviewers`|optional|
5647The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01005648link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Edwin Kempine3446292013-02-19 16:40:14 +01005649Only set if link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07005650|`reviewers` |optional|
Edwin Kempin66af3d82015-11-10 17:38:40 -08005651The reviewers as a map that maps a reviewer state to a list of
5652link:rest-api-accounts.html#account-info[AccountInfo] entities.
5653Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
5654`REVIEWER`: Users with at least one non-zero vote on the change. +
5655`CC`: Users that were added to the change, but have not voted. +
5656`REMOVED`: Users that were previously reviewers on the change, but have
5657been removed. +
5658Only set if link:#detailed-labels[detailed labels] are requested.
Logan Hanks296cd892017-05-03 15:14:41 -07005659|`pending_reviewers` |optional|
5660Updates to `reviewers` that have been made while the change was in the
5661WIP state. Only present on WIP changes and only if there are pending
5662reviewer updates to report. These are reviewers who have not yet been
5663notified about being added to or removed from the change. +
5664Only set if link:#detailed-labels[detailed labels] are requested.
Viktar Donich316bf7a2016-07-06 11:29:01 -07005665|`reviewer_updates`|optional|
5666Updates to reviewers set for the change as
5667link:#review-update-info[ReviewerUpdateInfo] entities.
5668Only set if link:#reviewer-updates[reviewer updates] are requested and
5669if NoteDb is enabled.
John Spurlock74a70cc2013-03-23 16:41:50 -04005670|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07005671Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04005672link:#change-message-info[ChangeMessageInfo] entities. +
5673Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005674|`current_revision` |optional|
5675The commit ID of the current patch set of this change. +
5676Only set if link:#current-revision[the current revision] is requested
5677or if link:#all-revisions[all revisions] are requested.
5678|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05005679All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01005680patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08005681Only set if link:#current-revision[the current revision] is requested
5682(in which case it will only contain a key for the current revision) or
5683if link:#all-revisions[all revisions] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005684|`_more_changes` |optional, not set if `false`|
5685Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08005686Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05005687|`problems` |optional|
5688A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08005689problems with this change. Only set if link:#check[CHECK] is set.
David Ostrovskycb19cec2017-04-28 11:55:45 +02005690|`is_private` |optional, not set if `false`|
5691When present, change is marked as private.
David Ostrovsky258849b2017-03-09 23:21:03 +01005692|`work_in_progress` |optional, not set if `false`|
5693When present, change is marked as Work In Progress.
Logan Hanks296cd892017-05-03 15:14:41 -07005694|`has_started_review` |optional, not set if `false`|
5695When present, change has been marked Ready at some point in time.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08005696|==================================
5697
5698[[change-input]]
5699=== ChangeInput
5700The `ChangeInput` entity contains information about creating a new change.
5701
5702[options="header",cols="1,^1,5"]
5703|==================================
5704|Field Name ||Description
5705|`project` ||The name of the project.
5706|`branch` ||
5707The name of the target branch. +
5708The `refs/heads/` prefix is omitted.
5709|`subject` ||
5710The subject of the change (header line of the commit message).
5711|`topic` |optional|The topic to which this change belongs.
5712|`status` |optional, default to `NEW`|
5713The status of the change (only `NEW` and `DRAFT` accepted here).
Edwin Kempin14d50ed2017-05-03 13:26:30 +02005714|`is_private` |optional, default to `false`|
5715Whether the new change should be marked as private.
5716|`work_in_progress` |optional, default to `false`|
5717Whether the new change should be set to work in progress.
David Ostrovsky9d8ec422014-12-24 00:52:09 +01005718|`base_change` |optional|
5719A link:#change-id[\{change-id\}] that identifies the base change for a create
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08005720change operation.
5721|`new_branch` |optional, default to `false`|
5722Allow creating a new branch when set to `true`.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07005723|`merge` |optional|
5724The detail of a merge commit as a link:#merge-input[MergeInput] entity.
Edwin Kempin5f8c3832017-01-13 11:45:06 +01005725|`notify` |optional|
5726Notify handling that defines to whom email notifications should be sent
5727after the change is created. +
5728Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5729If not set, the default is `ALL`.
5730|`notify_details` |optional|
5731Additional information about whom to notify about the change creation
5732as a map of recipient type to link:#notify-info[NotifyInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01005733|==================================
5734
John Spurlock74a70cc2013-03-23 16:41:50 -04005735[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005736=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04005737The `ChangeMessageInfo` entity contains information about a message
5738attached to a change.
5739
David Pursehouseae367192014-11-25 17:24:47 +09005740[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04005741|==================================
5742|Field Name ||Description
5743|`id` ||The ID of the message.
5744|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07005745Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04005746link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5747Unset if written by the Gerrit system.
Patrick Hiesel9221ef12017-03-23 16:44:36 +01005748|`real_author` |optional|
5749Real author of the message as an
5750link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5751Set if the message was posted on behalf of another user.
John Spurlock74a70cc2013-03-23 16:41:50 -04005752|`date` ||
5753The link:rest-api.html#timestamp[timestamp] this message was posted.
5754|`message` ||The text left by the user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005755|`tag` |optional|
5756Value of the `tag` field from link:#review-input[ReviewInput] set
5757while posting the review.
5758NOTE: To apply different tags on on different votes/comments multiple
5759invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04005760|`_revision_number` |optional|
5761Which patchset (if any) generated this message.
5762|==================================
5763
Gustaf Lundh019fb262012-11-28 14:20:22 +01005764[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005765=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01005766The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
5767
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005768[options="header",cols="1,^1,5"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01005769|===========================
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005770|Field Name ||Description
5771|`message` ||Commit message for the cherry-picked change
5772|`destination` ||Destination branch
Changcheng Xiaoe3332582017-05-26 15:29:41 +02005773|`base` |optional|
577440-hex digit SHA-1 of the commit which will be the parent commit of the newly created change.
5775If set, it must be a merged commit or a change revision on the destination branch.
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005776|`parent` |optional, defaults to 1|
5777Number of the parent relative to which the cherry-pick should be considered.
Changcheng Xiaoe04e8462017-05-23 09:39:03 +02005778|`notify` |optional|
5779Notify handling that defines to whom email notifications should be sent
5780after the cherry-pick. +
5781Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5782If not set, the default is `NONE`.
5783|`notify_details` |optional|
5784Additional information about whom to notify about the update as a map
5785of recipient type to link:#notify-info[NotifyInfo] entity.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005786|===========================
5787
Edwin Kempincb6724a2013-02-26 16:58:51 +01005788[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005789=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05005790The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005791
David Pursehouseae367192014-11-25 17:24:47 +09005792[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01005793|===========================
5794|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07005795|`patch_set` |optional|
5796The patch set number for the comment; only set in contexts where +
5797comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04005798|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005799|`path` |optional|
5800The path of the file for which the inline comment was done. +
5801Not set if returned in a map where the key is the file path.
5802|`side` |optional|
5803The side on which the comment was added. +
5804Allowed values are `REVISION` and `PARENT`. +
5805If not set, the default is `REVISION`.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005806|`parent` |optional|
5807The 1-based parent number. Used only for merge commits when `side == PARENT`.
5808When not set the comment is for the auto-merge tree.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005809|`line` |optional|
5810The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04005811If range is set, this equals the end line of the range. +
5812If neither line nor range is set, it's a file comment.
5813|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09005814The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04005815entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005816|`in_reply_to` |optional|
5817The URL encoded UUID of the comment to which this comment is a reply.
5818|`message` |optional|The comment message.
5819|`updated` ||
5820The link:rest-api.html#timestamp[timestamp] of when this comment was
5821written.
John Spurlock5e402f02013-03-24 11:35:04 -04005822|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09005823The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04005824link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5825Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005826|`tag` |optional|
5827Value of the `tag` field from link:#review-input[ReviewInput] set
5828while posting the review.
5829NOTE: To apply different tags on on different votes/comments multiple
5830invocations of the REST call are required.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08005831|`unresolved` |optional|
5832Whether or not the comment must be addressed by the user. The state of
5833resolution of a comment thread is stored in the last comment in that thread
5834chronologically.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005835|===========================
5836
Edwin Kempin67498de2013-02-25 16:15:34 +01005837[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005838=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03005839The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01005840comment.
5841
David Pursehouseae367192014-11-25 17:24:47 +09005842[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01005843|===========================
5844|Field Name ||Description
5845|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01005846The URL encoded UUID of the comment if an existing draft comment should
5847be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005848|`path` |optional|
5849The path of the file for which the inline comment should be added. +
5850Doesn't need to be set if contained in a map where the key is the file
5851path.
Edwin Kempin67498de2013-02-25 16:15:34 +01005852|`side` |optional|
5853The side on which the comment should be added. +
5854Allowed values are `REVISION` and `PARENT`. +
5855If not set, the default is `REVISION`.
5856|`line` |optional|
5857The number of the line for which the comment should be added. +
5858`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04005859If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09005860If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04005861|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09005862The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04005863entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01005864|`in_reply_to` |optional|
5865The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005866|`updated` |optional|
5867The link:rest-api.html#timestamp[timestamp] of this comment. +
5868Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01005869|`message` |optional|
5870The comment message. +
5871If not set and an existing draft comment is updated, the existing draft
5872comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04005873|`tag` |optional, drafts only|
5874Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
5875inputs; for published comments, use the `tag` field in +
5876link#review-input[ReviewInput]
Kasper Nilsson7ec30362016-12-20 14:13:21 -08005877|`unresolved` |optional|
5878Whether or not the comment must be addressed by the user. This value will
5879default to false if the comment is an orphan, or the value of the `in_reply_to`
5880comment if it is supplied.
Edwin Kempin67498de2013-02-25 16:15:34 +01005881|===========================
5882
Michael Zhou596c7682013-08-25 05:43:34 -04005883[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005884=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04005885The `CommentRange` entity describes the range of an inline comment.
5886
David Pursehouseae367192014-11-25 17:24:47 +09005887[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04005888|===========================
5889|Field Name ||Description
Alice Kober-Sotzekcd06fb62017-03-21 15:19:45 +01005890|`start_line` ||The start line number of the range. (1-based, inclusive)
5891|`start_character` ||The character position in the start line. (0-based, inclusive)
5892|`end_line` ||The end line number of the range. (1-based, exclusive)
5893|`end_character` ||The character position in the end line. (0-based, exclusive)
Michael Zhou596c7682013-08-25 05:43:34 -04005894|===========================
5895
Edwin Kempine3446292013-02-19 16:40:14 +01005896[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005897=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005898The `CommitInfo` entity contains information about a commit.
5899
Edwin Kempinf0c57152015-07-15 18:18:24 +02005900[options="header",cols="1,^1,5"]
5901|===========================
5902|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02005903|`commit` |Optional|
5904The commit ID. Not set if included in a link:#revision-info[
5905RevisionInfo] entity that is contained in a map which has the commit ID
5906as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005907|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01005908The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02005909link:#commit-info[CommitInfo] entities. In each parent
5910only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005911|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01005912link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005913|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01005914link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005915|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01005916The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02005917|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01005918|`web_links` |optional|
5919Links to the commit in external sites as a list of
5920link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005921|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01005922
Changcheng Xiaoe5b14ce2017-02-10 09:39:48 +01005923[[delete-comment-input]]
5924=== DeleteCommentInput
5925The `DeleteCommentInput` entity contains the option for deleting a comment.
5926
5927[options="header",cols="1,^1,5"]
5928|=============================
5929|Field Name ||Description
5930|`reason` |optional|
5931The reason why the comment should be deleted. +
5932If set, the comment's message will be replaced with
5933"Comment removed by: `name`; Reason: `reason`",
5934or just "Comment removed by: `name`." if not set.
5935|=============================
5936
Edwin Kempin407fca32016-08-29 12:01:00 +02005937[[delete-reviewer-input]]
5938=== DeleteReviewerInput
5939The `DeleteReviewerInput` entity contains options for the deletion of a
5940reviewer.
5941
5942[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01005943|=============================
5944|Field Name ||Description
5945|`notify` |optional|
Edwin Kempin407fca32016-08-29 12:01:00 +02005946Notify handling that defines to whom email notifications should be sent
5947after the reviewer is deleted. +
5948Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5949If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01005950|`notify_details`|optional|
5951Additional information about whom to notify about the update as a map
5952of recipient type to link:#notify-info[NotifyInfo] entity.
5953|=============================
Edwin Kempin407fca32016-08-29 12:01:00 +02005954
Edwin Kempin1dfecb62016-06-16 10:45:00 +02005955[[delete-vote-input]]
5956=== DeleteVoteInput
5957The `DeleteVoteInput` entity contains options for the deletion of a
5958vote.
5959
5960[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01005961|=============================
5962|Field Name ||Description
5963|`label` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02005964The label for which the vote should be deleted. +
5965If set, must match the label in the URL.
Edwin Kempincd07df42016-12-01 09:10:09 +01005966|`notify` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02005967Notify handling that defines to whom email notifications should be sent
5968after the vote is deleted. +
5969Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5970If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01005971|`notify_details`|optional|
5972Additional information about whom to notify about the update as a map
5973of recipient type to link:#notify-info[NotifyInfo] entity.
5974|=============================
Edwin Kempin1dfecb62016-06-16 10:45:00 +02005975
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08005976[[description-input]]
5977=== DescriptionInput
5978The `DescriptionInput` entity contains information for setting a description.
5979
5980[options="header",cols="1,6"]
5981|===========================
5982|Field Name |Description
5983|`description` |The description text.
5984|===========================
5985
David Pursehouse882aef22013-06-05 10:56:37 +09005986[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005987=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09005988The `DiffContent` entity contains information about the content differences
5989in a file.
5990
David Pursehouseae367192014-11-25 17:24:47 +09005991[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09005992|==========================
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02005993|Field Name ||Description
5994|`a` |optional|Content only in the file on side A (deleted in B).
5995|`b` |optional|Content only in the file on side B (added in B).
5996|`ab` |optional|Content in the file on both sides (unchanged).
5997|`edit_a` |only present during a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09005998Text sections deleted from side A as a
5999link:#diff-intraline-info[DiffIntralineInfo] entity.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006000|`edit_b` |only present during a replace, i.e. both `a` and `b` are present|
David Pursehouse882aef22013-06-05 10:56:37 +09006001Text sections inserted in side B as a
6002link:#diff-intraline-info[DiffIntralineInfo] entity.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006003|`due_to_rebase`|not set if `false`|Indicates whether this entry was introduced by a
6004rebase.
6005|`skip` |optional|count of lines skipped on both sides when the file is
David Pursehouse882aef22013-06-05 10:56:37 +09006006too large to include all common lines.
Alice Kober-Sotzek2f624862017-05-04 09:59:28 +02006007|`common` |optional|Set to `true` if the region is common according
Shawn Pearce425a2be2014-01-02 16:00:58 -08006008to the requested ignore-whitespace parameter, but a and b contain
6009differing amounts of whitespace. When present and true a and b are
6010used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09006011|==========================
6012
6013[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006014=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006015The `DiffFileMetaInfo` entity contains meta information about a file diff.
6016
David Pursehouseae367192014-11-25 17:24:47 +09006017[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006018|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02006019|Field Name ||Description
6020|`name` ||The name of the file.
6021|`content_type`||The content type of the file.
6022|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01006023|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02006024Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07006025link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09006026|==========================
6027
6028[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006029=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006030The `DiffInfo` entity contains information about the diff of a file
6031in a revision.
6032
Edwin Kempin8cdce502014-12-06 10:55:38 +01006033If the link:#weblinks-only[weblinks-only] parameter is specified, only
6034the `web_links` field is set.
6035
David Pursehouseae367192014-11-25 17:24:47 +09006036[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09006037|==========================
6038|Field Name ||Description
6039|`meta_a` |not present when the file is added|
6040Meta information about the file on side A as a
6041link:#diff-file-meta-info[DiffFileMetaInfo] entity.
6042|`meta_b` |not present when the file is deleted|
6043Meta information about the file on side B as a
6044link:#diff-file-meta-info[DiffFileMetaInfo] entity.
6045|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
6046`COPIED`, `REWRITE`).
6047|`intraline_status`|only set when the `intraline` parameter was specified in the request|
6048Intraline status (`OK`, `ERROR`, `TIMEOUT`).
6049|`diff_header` ||A list of strings representing the patch set diff header.
6050|`content` ||The content differences in the file as a list of
6051link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01006052|`web_links` |optional|
6053Links to the file diff in external sites as a list of
6054link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01006055|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09006056|==========================
6057
6058[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006059=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09006060The `DiffIntralineInfo` entity contains information about intraline edits in a
6061file.
6062
David Pursehouse31203f52013-06-08 17:05:45 +09006063The information consists of a list of `<skip length, mark length>` pairs, where
6064the skip length is the number of characters between the end of the previous edit
6065and the start of this edit, and the mark length is the number of edited characters
6066following the skip. The start of the edits is from the beginning of the related
6067diff content lines.
David Pursehouse882aef22013-06-05 10:56:37 +09006068
David Pursehouse31203f52013-06-08 17:05:45 +09006069Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07006070the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09006071
Edwin Kempin8cdce502014-12-06 10:55:38 +01006072[[diff-web-link-info]]
6073=== DiffWebLinkInfo
6074The `DiffWebLinkInfo` entity describes a link on a diff screen to an
6075external site.
6076
6077[options="header",cols="1,6"]
6078|=======================
6079|Field Name|Description
6080|`name` |The link name.
6081|`url` |The link URL.
6082|`image_url`|URL to the icon of the link.
6083|show_on_side_by_side_diff_view|
6084Whether the web link should be shown on the side-by-side diff screen.
6085|show_on_unified_diff_view|
6086Whether the web link should be shown on the unified diff screen.
6087|=======================
6088
David Ostrovsky9ea9c112015-01-25 00:12:38 +01006089[[edit-file-info]]
6090=== EditFileInfo
6091The `EditFileInfo` entity contains additional information
6092of a file within a change edit.
6093
6094[options="header",cols="1,^1,5"]
6095|===========================
6096|Field Name ||Description
6097|`web_links` |optional|
6098Links to the diff info in external sites as a list of
6099link:#web-link-info[WebLinkInfo] entities.
6100|===========================
6101
Edwin Kempin521c1242015-01-23 12:44:44 +01006102[[edit-info]]
6103=== EditInfo
6104The `EditInfo` entity contains information about a change edit.
6105
6106[options="header",cols="1,^1,5"]
6107|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04006108|Field Name ||Description
6109|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01006110link:#commit-info[CommitInfo] entity.
Michael Zhoud03fe282016-04-25 17:13:17 -04006111|`base_revision`||The revision of the patch set the change edit is based on.
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01006112|`fetch` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01006113Information about how to fetch this patch set. The fetch information is
6114provided as a map that maps the protocol name ("`git`", "`http`",
6115"`ssh`") to link:#fetch-info[FetchInfo] entities.
Michael Zhoud03fe282016-04-25 17:13:17 -04006116|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01006117The files of the change edit as a map that maps the file names to
6118link:#file-info[FileInfo] entities.
6119|===========================
6120
Edwin Kempine3446292013-02-19 16:40:14 +01006121[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006122=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006123The `FetchInfo` entity contains information about how to fetch a patch
6124set via a certain protocol.
6125
David Pursehouseae367192014-11-25 17:24:47 +09006126[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006127|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02006128|Field Name ||Description
6129|`url` ||The URL of the project.
6130|`ref` ||The ref of the patch set.
6131|`commands` |optional|
6132The download commands for this patch set as a map that maps the command
6133names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09006134Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01006135|==========================
6136
6137[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006138=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006139The `FileInfo` entity contains information about a file in a patch set.
6140
David Pursehouseae367192014-11-25 17:24:47 +09006141[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006142|=============================
6143|Field Name ||Description
6144|`status` |optional|
6145The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
6146"`C`"=Copied, "`W`"=Rewritten). +
6147Not set if the file was Modified ("`M`").
6148|`binary` |not set if `false`|Whether the file is binary.
6149|`old_path` |optional|
6150The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05006151Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01006152|`lines_inserted`|optional|
6153Number of inserted lines. +
6154Not set for binary files or if no lines were inserted.
6155|`lines_deleted` |optional|
6156Number of deleted lines. +
6157Not set for binary files or if no lines were deleted.
Edwin Kempin640f9842015-10-08 15:53:20 +02006158|`size_delta` ||
6159Number of bytes by which the file size increased/decreased.
Edwin Kempin971a5f52015-10-28 10:50:39 +01006160|`size` ||
6161File size in bytes.
Edwin Kempine3446292013-02-19 16:40:14 +01006162|=============================
6163
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006164[[fix-input]]
6165=== FixInput
6166The `FixInput` entity contains options for fixing commits using the
6167link:#fix-change[fix change] endpoint.
6168
6169[options="header",cols="1,6"]
6170|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07006171|Field Name |Description
6172|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006173database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07006174|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07006175merged into the destination branch as this exact SHA-1. If not, insert
6176a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04006177|==========================
6178
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006179[[fix-suggestion-info]]
6180=== FixSuggestionInfo
6181The `FixSuggestionInfo` entity represents a suggested fix.
6182
6183[options="header",cols="1,^1,5"]
6184|==========================
6185|Field Name ||Description
6186|`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested
6187fix. It will be generated automatically and hence will be ignored if it's set
6188for input objects.
6189|`description` ||A description of the suggested fix.
6190|`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>>
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01006191entities indicating how the content of one or several files should be modified.
6192Within a file, they should refer to non-overlapping regions.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006193|==========================
6194
6195[[fix-replacement-info]]
6196=== FixReplacementInfo
Alice Kober-Sotzek110f60f2016-12-19 14:53:40 +01006197The `FixReplacementInfo` entity describes how the content of a file should be
6198replaced by another content.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006199
6200[options="header",cols="1,6"]
6201|==========================
6202|Field Name |Description
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01006203|`path` |The path of the file which should be modified. Any file in
6204the repository may be modified.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006205|`range` |A <<comment-range,CommentRange>> indicating which content
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01006206of the file should be replaced. Lines in the file are assumed to be separated
6207by the line feed character, the carriage return character, the carriage return
6208followed by the line feed character, or one of the other Unicode linebreak
6209sequences supported by Java.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006210|`replacement` |The content which should be used instead of the current one.
6211|==========================
6212
Edwin Kempine3446292013-02-19 16:40:14 +01006213[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006214=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006215The `GitPersonInfo` entity contains information about the
6216author/committer of a commit.
6217
David Pursehouseae367192014-11-25 17:24:47 +09006218[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01006219|==========================
6220|Field Name |Description
6221|`name` |The name of the author/committer.
6222|`email` |The email address of the author/committer.
6223|`date` |The link:rest-api.html#timestamp[timestamp] of when
6224this identity was constructed.
6225|`tz` |The timezone offset from UTC of when this identity was
6226constructed.
6227|==========================
6228
Edwin Kempin521c1242015-01-23 12:44:44 +01006229[[group-base-info]]
6230=== GroupBaseInfo
6231The `GroupBaseInfo` entity contains base information about the group.
6232
6233[options="header",cols="1,6"]
6234|==========================
6235|Field Name |Description
Edwin Kempin703613c2016-11-25 16:06:04 +01006236|`id` |The UUID of the group.
Edwin Kempin521c1242015-01-23 12:44:44 +01006237|`name` |The name of the group.
6238|==========================
6239
David Pursehoused9dac372016-11-24 19:41:10 +09006240[[hashtags-input]]
6241=== HashtagsInput
6242
6243The `HashtagsInput` entity contains information about hashtags to add to,
6244and/or remove from, a change.
6245
6246[options="header",cols="1,^1,5"]
6247|=======================
6248|Field Name||Description
6249|`add` |optional|The list of hashtags to be added to the change.
6250|`remove |optional|The list of hashtags to be removed from the change.
6251|=======================
6252
Edwin Kempin521c1242015-01-23 12:44:44 +01006253[[included-in-info]]
6254=== IncludedInInfo
6255The `IncludedInInfo` entity contains information about the branches a
6256change was merged into and tags it was tagged with.
6257
Edwin Kempin78279ba2015-05-22 15:22:41 +02006258[options="header",cols="1,^1,5"]
6259|=======================
6260|Field Name||Description
6261|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01006262Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02006263|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01006264Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02006265|`external`|optional|A map that maps a name to a list of external
6266systems that include this change, e.g. a list of servers on which this
6267change is deployed.
6268|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01006269
Edwin Kempine3446292013-02-19 16:40:14 +01006270[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006271=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07006272The `LabelInfo` entity contains information about a label on a change, always
6273corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01006274
Dave Borowitz88159512013-06-14 14:21:50 -07006275There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07006276link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07006277
6278* For a quick summary of the state of labels, use `LABELS`.
6279* For detailed information about labels, including exact numeric votes for all
6280 users and the allowed range of votes for the current user, use `DETAILED_LABELS`.
6281
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006282==== Common fields
David Pursehouseae367192014-11-25 17:24:47 +09006283[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006284|===========================
6285|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01006286|`optional` |not set if `false`|
6287Whether the label is optional. Optional means the label may be set, but
6288it's neither necessary for submission nor does it block submission if
6289set.
Dave Borowitz88159512013-06-14 14:21:50 -07006290|===========================
6291
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006292==== Fields set by `LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09006293[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07006294|===========================
6295|Field Name ||Description
6296|`approved` |optional|One user who approved this label on the change
6297(voted the maximum value) as an
6298link:rest-api-accounts.html#account-info[AccountInfo] entity.
6299|`rejected` |optional|One user who rejected this label on the change
6300(voted the minimum value) as an
6301link:rest-api-accounts.html#account-info[AccountInfo] entity.
6302|`recommended` |optional|One user who recommended this label on the
6303change (voted positively, but not the maximum value) as an
6304link:rest-api-accounts.html#account-info[AccountInfo] entity.
6305|`disliked` |optional|One user who disliked this label on the change
6306(voted negatively, but not the minimum value) as an
6307link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01006308|`blocking` |optional|If `true`, the label blocks submit operation.
6309If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07006310|`value` |optional|The voting value of the user who
6311recommended/disliked this label on the change if it is not
6312"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07006313|`default_value`|optional|The default voting value for the label.
6314This value may be outside the range specified in permitted_labels.
Dave Borowitz88159512013-06-14 14:21:50 -07006315|===========================
6316
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006317==== Fields set by `DETAILED_LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09006318[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07006319|===========================
6320|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01006321|`all` |optional|List of all approvals for this label as a list
Aaron Gableea8a2112017-04-25 14:18:16 -07006322of link:#approval-info[ApprovalInfo] entities. Items in this list may
6323not represent actual votes cast by users; if a user votes on any label,
6324a corresponding ApprovalInfo will appear in this list for all labels.
Edwin Kempine3446292013-02-19 16:40:14 +01006325|`values` |optional|A map of all values that are allowed for this
6326label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07006327to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01006328|===========================
6329
Saša Živkov499873f2014-05-05 13:34:18 +02006330[[mergeable-info]]
6331=== MergeableInfo
6332The `MergeableInfo` entity contains information about the mergeability of a
6333change.
6334
David Pursehouseae367192014-11-25 17:24:47 +09006335[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02006336|============================
Saša Živkov697cab22014-04-29 16:46:50 +02006337|Field Name ||Description
6338|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02006339Submit type used for this change, can be `MERGE_IF_NECESSARY`,
6340`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
6341`CHERRY_PICK`.
Zhen Chenec13e452016-08-03 23:29:43 -07006342|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006343The strategy of the merge, can be `recursive`, `resolve`,
6344`simple-two-way-in-core`, `ours` or `theirs`.
Saša Živkov697cab22014-04-29 16:46:50 +02006345|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02006346`true` if this change is cleanly mergeable, `false` otherwise
Zhen Chen8f00d552016-07-26 16:54:59 -07006347|`commit_merged` |optional|
6348`true` if this change is already merged, `false` otherwise
6349|`content_merged` |optional|
6350`true` if the content of this change is already merged, `false` otherwise
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006351|`conflicts`|optional|
6352A list of paths with conflicts
Saša Živkov697cab22014-04-29 16:46:50 +02006353|`mergeable_into`|optional|
6354A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02006355|============================
Dave Borowitz88159512013-06-14 14:21:50 -07006356
Zhen Chenf7d85ea2016-05-02 15:14:43 -07006357[[merge-input]]
6358=== MergeInput
6359The `MergeInput` entity contains information about the merge
6360
6361[options="header",cols="1,^1,5"]
6362|============================
6363|Field Name ||Description
6364|`source` ||
6365The source to merge from, e.g. a complete or abbreviated commit SHA-1,
6366a complete reference name, a short reference name under refs/heads, refs/tags,
6367or refs/remotes namespace, etc.
6368|`strategy` |optional|
6369The strategy of the merge, can be `recursive`, `resolve`,
6370`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
6371|============================
6372
Zhen Chenb1e07e52016-09-23 12:59:48 -07006373[[merge-patch-set-input]]
6374=== MergePatchSetInput
6375The `MergePatchSetInput` entity contains information about updating a new
6376change by creating a new merge commit.
6377
6378[options="header",cols="1,^1,5"]
6379|==================================
6380|Field Name ||Description
6381|`subject` |optional|
6382The new subject for the change, if not specified, will reuse the current patch
6383set's subject
6384|`inheritParent` |optional, default to `false`|
6385Use the current patch set's first parent as the merge tip when set to `true`.
6386Otherwise, use the current branch tip of the destination branch.
6387|`merge` ||
6388The detail of the source commit for merge as a link:#merge-input[MergeInput]
6389entity.
6390|==================================
6391
Raviteja Sunkara791f3392015-11-03 13:24:50 +05306392[[move-input]]
6393=== MoveInput
6394The `MoveInput` entity contains information for moving a change to a new branch.
6395
6396[options="header",cols="1,^1,5"]
6397|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04006398|Field Name ||Description
6399|`destination_branch`||Destination branch
6400|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05306401A message to be posted in this change's comments
6402|===========================
6403
Edwin Kempincd07df42016-12-01 09:10:09 +01006404[[notify-info]]
6405=== NotifyInfo
6406The `NotifyInfo` entity contains detailed information about who should
6407be notified about an update. These notifications are sent out even if a
6408`notify` option in the request input disables normal notifications.
6409`NotifyInfo` entities are normally contained in a `notify_details` map
6410in the request input where the key is the recipient type. The recipient
6411type can be `TO`, `CC` and `BCC`.
6412
6413[options="header",cols="1,^1,5"]
6414|=======================
6415|Field Name||Description
6416|`accounts`|optional|
6417A list of link:rest-api-accounts.html#account-id[account IDs] that
6418identify the accounts that should be should be notified.
6419|=======================
6420
Edwin Kempin364a86b2017-04-27 12:34:00 +02006421[[private-input]]
6422=== PrivateInput
6423The `PrivateInput` entity contains information for changing the private
6424flag on a change.
6425
6426[options="header",cols="1,^1,5"]
6427|=======================
6428|Field Name||Description
6429|`message` |optional|Message describing why the private flag was changed.
6430|=======================
6431
Edwin Kempin521c1242015-01-23 12:44:44 +01006432[[problem-info]]
6433=== ProblemInfo
6434The `ProblemInfo` entity contains a description of a potential consistency problem
6435with a change. These are not related to the code review process, but rather
6436indicate some inconsistency in Gerrit's database or repository metadata related
6437to the enclosing change.
6438
6439[options="header",cols="1,^1,5"]
6440|===========================
6441|Field Name||Description
6442|`message` ||Plaintext message describing the problem with the change.
6443|`status` |optional|
6444The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
6445fix was attempted.
6446|`outcome` |optional|
6447If `status` is set, an additional plaintext message describing the
6448outcome of the fix.
6449|===========================
6450
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006451[[publish-change-edit-input]]
6452=== PublishChangeEditInput
6453The `PublishChangeEditInput` entity contains options for the publishing of
6454change edit.
6455
6456[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006457|=============================
6458|Field Name ||Description
6459|`notify` |optional|
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006460Notify handling that defines to whom email notifications should be sent
6461after the change edit is published. +
6462Allowed values are `NONE` and `ALL`. +
6463If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006464|`notify_details`|optional|
6465Additional information about whom to notify about the update as a map
6466of recipient type to link:#notify-info[NotifyInfo] entity.
6467|=============================
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006468
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04006469[[push-certificate-info]]
6470=== PushCertificateInfo
6471The `PushCertificateInfo` entity contains information about a push
6472certificate provided when the user pushed for review with `git push
6473--signed HEAD:refs/for/<branch>`. Only used when signed push is
6474link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
6475
6476[options="header",cols="1,6"]
6477|===========================
6478|Field Name|Description
6479|`certificate`|Signed certificate payload and GPG signature block.
6480|`key` |
6481Information about the key that signed the push, along with any problems
6482found while checking the signature or the key itself, as a
6483link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
6484|===========================
6485
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006486[[range-info]]
6487=== RangeInfo
6488The `RangeInfo` entity stores the coordinates of a range.
6489
6490[options="header",cols="1,6"]
6491|===========================
6492|Field Name | Description
6493|`start` | First index.
6494|`end` | Last index.
6495|===========================
6496
Zalan Blenessy874aed72015-01-12 13:26:18 +01006497[[rebase-input]]
6498=== RebaseInput
6499The `RebaseInput` entity contains information for changing parent when rebasing.
6500
6501[options="header",width="50%",cols="1,^1,5"]
6502|===========================
6503|Field Name ||Description
6504|`base` |optional|
6505The new parent revision. This can be a ref or a SHA1 to a concrete patchset. +
6506Alternatively, a change number can be specified, in which case the current
6507patch set is inferred. +
6508Empty string is used for rebasing directly on top of the target branch,
6509which effectively breaks dependency towards a parent change.
6510|===========================
6511
Edwin Kempin521c1242015-01-23 12:44:44 +01006512[[related-change-and-commit-info]]
6513=== RelatedChangeAndCommitInfo
6514
6515The `RelatedChangeAndCommitInfo` entity contains information about
6516a related change and commit.
6517
6518[options="header",cols="1,^1,5"]
6519|===========================
6520|Field Name ||Description
6521|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01006522|`commit` ||The commit as a
6523link:#commit-info[CommitInfo] entity.
6524|`_change_number` |optional|The change number.
6525|`_revision_number` |optional|The revision number.
6526|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07006527|`status` |optional|The status of the change. The status of
Stefan Beller0d3cab02015-07-10 13:32:57 -07006528the change is one of (`NEW`, `MERGED`, `ABANDONED`, `DRAFT`).
Edwin Kempin521c1242015-01-23 12:44:44 +01006529|===========================
6530
6531[[related-changes-info]]
6532=== RelatedChangesInfo
6533The `RelatedChangesInfo` entity contains information about related
6534changes.
6535
6536[options="header",cols="1,6"]
6537|===========================
6538|Field Name |Description
6539|`changes` |A list of
6540link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
6541describing the related changes. Sorted by git commit order, newest to
6542oldest. Empty if there are no related changes.
6543|===========================
6544
Edwin Kempined5364b2013-02-22 10:39:33 +01006545[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006546=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01006547The `RestoreInput` entity contains information for restoring a change.
6548
David Pursehouseae367192014-11-25 17:24:47 +09006549[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01006550|===========================
6551|Field Name ||Description
6552|`message` |optional|
6553Message to be added as review comment to the change when restoring the
6554change.
6555|===========================
6556
Edwin Kempind2ec4152013-02-22 12:17:19 +01006557[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006558=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01006559The `RevertInput` entity contains information for reverting a change.
6560
David Pursehouseae367192014-11-25 17:24:47 +09006561[options="header",cols="1,^1,5"]
Edwin Kempind2ec4152013-02-22 12:17:19 +01006562|===========================
6563|Field Name ||Description
6564|`message` |optional|
6565Message to be added as review comment to the change when reverting the
6566change.
6567|===========================
6568
Edwin Kempin67498de2013-02-25 16:15:34 +01006569[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006570=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01006571The `ReviewInfo` entity contains information about a review.
6572
David Pursehouseae367192014-11-25 17:24:47 +09006573[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01006574|===========================
6575|Field Name |Description
6576|`labels` |
6577The labels of the review as a map that maps the label names to the
6578voting values.
6579|===========================
6580
Viktar Donich316bf7a2016-07-06 11:29:01 -07006581[[review-update-info]]
6582=== ReviewerUpdateInfo
6583The `ReviewerUpdateInfo` entity contains information about updates to
6584change's reviewers set.
6585
6586[options="header",cols="1,6"]
6587|===========================
6588|Field Name |Description
6589|`updated`|
6590Timestamp of the update.
6591|`updated_by`|
6592The account which modified state of the reviewer in question as
6593link:rest-api-accounts.html#account-info[AccountInfo] entity.
6594|`reviewer`|
6595The reviewer account added or removed from the change as an
6596link:rest-api-accounts.html#account-info[AccountInfo] entity.
6597|`state`|
6598The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`.
6599|===========================
6600
Edwin Kempin67498de2013-02-25 16:15:34 +01006601[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006602=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01006603The `ReviewInput` entity contains information for adding a review to a
6604revision.
6605
David Pursehouseae367192014-11-25 17:24:47 +09006606[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01006607|============================
Bill Wendling692b4ec2015-10-19 15:40:57 -07006608|Field Name ||Description
6609|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006610The message to be added as review comment.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006611|`tag` |optional|
6612Apply this tag to the review comment message, votes, and inline
6613comments. Tags may be used by CI or other automated systems to
6614distinguish them from human reviews. Comments with specific tag
6615values can be filtered out in the web UI.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006616|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006617The votes that should be added to the revision as a map that maps the
6618label names to the voting values.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006619|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006620The comments that should be added as a map that maps a file path to a
6621list of link:#comment-input[CommentInput] entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006622|`robot_comments` |optional|
6623The robot comments that should be added as a map that maps a file path
6624to a list of link:#robot-comment-input[RobotCommentInput] entities.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006625|`strict_labels` |`true` if not set|
John Spurlockd25fad12013-03-09 11:48:49 -05006626Whether all labels are required to be within the user's permitted ranges
Edwin Kempin67498de2013-02-25 16:15:34 +01006627based on access controls. +
6628If `true`, attempting to use a label not granted to the user will fail
6629the entire modify operation early. +
6630If `false`, the operation will execute anyway, but the proposed labels
6631will be modified to be the "best" value allowed by the access controls.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006632|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006633Draft handling that defines how draft comments are handled that are
6634already in the database but that were not also described in this
6635input. +
David Ostrovsky8a1da032014-07-25 10:57:35 +02006636Allowed values are `DELETE`, `PUBLISH`, `PUBLISH_ALL_REVISIONS` and
6637`KEEP`. All values except `PUBLISH_ALL_REVISIONS` operate only on drafts
6638for a single revision. +
Dave Borowitzc0640542016-10-05 16:19:21 -04006639Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. +
6640If not set, the default is `DELETE`, unless `on_behalf_of` is set, in
6641which case the default is `KEEP` and any other value is disallowed.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006642|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006643Notify handling that defines to whom email notifications should be sent
6644after the review is stored. +
6645Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6646If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006647|`notify_details` |optional|
6648Additional information about whom to notify about the update as a map
6649of recipient type to link:#notify-info[NotifyInfo] entity.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006650|`omit_duplicate_comments`|optional|
6651If `true`, comments with the same content at the same place will be omitted.
6652|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07006653link:rest-api-accounts.html#account-id[\{account-id\}] the review
6654should be posted on behalf of. To use this option the caller must
6655have been granted `labelAs-NAME` permission for all keys of labels.
Patrick Hieselcf6d9352017-04-13 10:15:42 +02006656|`reviewers` |optional|
6657A list of link:rest-api-changes.html#reviewer-input[ReviewerInput]
6658representing reviewers that should be added to the change.
Edwin Kempin67498de2013-02-25 16:15:34 +01006659|============================
6660
Aaron Gable843b0c12017-04-21 08:25:27 -07006661[[review-result]]
6662=== ReviewResult
6663The `ReviewResult` entity contains information regarding the updates
6664that were made to a review.
6665
6666[options="header",cols="1,^1,5"]
6667|============================
6668|Field Name ||Description
6669|`labels` |optional|
6670Map of labels to values after the review was posted. Null if any reviewer
6671additions were rejected.
6672|`reviewers` |optional|
6673Map of account or group identifier to
6674link:rest-api-changes.html#add-reviewer-result[AddReviewerResult]
6675representing the outcome of adding as a reviewer.
6676Absent if no reviewer additions were requested.
6677|============================
6678
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006679[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006680=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006681The `ReviewerInfo` entity contains information about a reviewer and its
6682votes on a change.
6683
Edwin Kempin963dfd02013-02-27 12:39:32 +01006684`ReviewerInfo` has the same fields as
6685link:rest-api-accounts.html#account-info[AccountInfo] and includes
6686link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006687In addition `ReviewerInfo` has the following fields:
6688
David Pursehouseae367192014-11-25 17:24:47 +09006689[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006690|==========================
6691|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006692|`approvals` |
6693The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09006694approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Patrick Hiesel11873ef2017-03-17 17:36:05 +01006695|`_account_id` |
6696This field is inherited from `AccountInfo` but is optional here if an
6697unregistered reviewer was added by email. See
6698link:rest-api-changes.html#add-reviewer[add-reviewer] for details.
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006699|==========================
6700
Edwin Kempin392328e2013-02-25 12:50:03 +01006701[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006702=== ReviewerInput
Edwin Kempin392328e2013-02-25 12:50:03 +01006703The `ReviewerInput` entity contains information for adding a reviewer
6704to a change.
6705
David Pursehouseae367192014-11-25 17:24:47 +09006706[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006707|=============================
6708|Field Name ||Description
6709|`reviewer` ||
Edwin Kempin392328e2013-02-25 12:50:03 +01006710The link:rest-api-accounts.html#account-id[ID] of one account that
6711should be added as reviewer or the link:rest-api-groups.html#group-id[
6712ID] of one group for which all members should be added as reviewers. +
6713If an ID identifies both an account and a group, only the account is
6714added as reviewer to the change.
Edwin Kempincd07df42016-12-01 09:10:09 +01006715|`state` |optional|
Logan Hanksee0a4182016-07-06 14:39:26 -07006716Add reviewer in this state. Possible reviewer states are `REVIEWER`
6717and `CC`. If not given, defaults to `REVIEWER`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006718|`confirmed` |optional|
Edwin Kempin392328e2013-02-25 12:50:03 +01006719Whether adding the reviewer is confirmed. +
6720The Gerrit server may be configured to
6721link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
6722confirmation] when adding a group as reviewer that has many members.
Edwin Kempincd07df42016-12-01 09:10:09 +01006723|`notify` |optional|
Sven Selberg4d64f972016-09-26 16:15:02 +02006724Notify handling that defines to whom email notifications should be sent
6725after the reviewer is added. +
6726Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6727If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006728|`notify_details`|optional|
6729Additional information about whom to notify about the update as a map
6730of recipient type to link:#notify-info[NotifyInfo] entity.
6731|=============================
Edwin Kempin392328e2013-02-25 12:50:03 +01006732
Edwin Kempine3446292013-02-19 16:40:14 +01006733[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006734=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006735The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07006736Not all fields are returned by default. Additional fields can
6737be obtained by adding `o` parameters as described in
6738link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01006739
David Pursehouseae367192014-11-25 17:24:47 +09006740[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006741|===========================
6742|Field Name ||Description
6743|`draft` |not set if `false`|Whether the patch set is a draft.
David Pursehouse4de41112016-06-28 09:24:08 +09006744|`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`,
6745`MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`.
Edwin Kempine3446292013-02-19 16:40:14 +01006746|`_number` ||The patch set number.
Edwin Kempin04cbd342015-02-19 16:31:22 +01006747|`created` ||
6748The link:rest-api.html#timestamp[timestamp] of when the patch set was
6749created.
6750|`uploader` ||
6751The uploader of the patch set as an
6752link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempin4569ced2014-11-25 16:45:05 +01006753|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01006754|`fetch` ||
6755Information about how to fetch this patch set. The fetch information is
6756provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07006757"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
6758only included if a plugin implementing the
6759link:intro-project-owner.html#download-commands[download commands]
6760interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07006761|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01006762link:#commit-info[CommitInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07006763|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01006764The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07006765link:#file-info[FileInfo] entities. Only set if
6766link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
6767option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07006768|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006769Actions the caller might be able to perform on this revision. The
6770information is a map of view name to link:#action-info[ActionInfo]
6771entities.
Khai Dob3139b7532014-09-19 15:13:04 -07006772|`reviewed` |optional|
6773Indicates whether the caller is authenticated and has commented on the
6774current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07006775|`messageWithFooter` |optional|
6776If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
6777this is the current patch set, contains the full commit message with
6778Gerrit-specific commit footers, as if this revision were submitted
6779using the link:project-configuration.html#cherry_pick[Cherry Pick]
6780submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04006781|`push_certificate` |optional|
6782If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
6783contains the push certificate provided by the user when uploading this
6784patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
6785This field is always set if the option is requested; if no push
6786certificate was provided, it is set to an empty object.
Aaron Gable621c9b62017-04-21 09:24:20 -07006787|`description` |optional|
6788The description of this patchset, as displayed in the patchset
6789selector menu. May be null if no description is set.
Edwin Kempine3446292013-02-19 16:40:14 +01006790|===========================
6791
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006792[[robot-comment-info]]
6793=== RobotCommentInfo
6794The `RobotCommentInfo` entity contains information about a robot inline
6795comment.
6796
Alice Kober-Sotzek265805d2016-12-07 15:24:21 +01006797`RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>>.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006798In addition `RobotCommentInfo` has the following fields:
6799
6800[options="header",cols="1,^1,5"]
6801|===========================
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006802|Field Name ||Description
6803|`robot_id` ||The ID of the robot that generated this comment.
6804|`robot_run_id` ||An ID of the run of the robot.
6805|`url` |optional|URL to more information.
6806|`properties` |optional|Robot specific properties as map that maps arbitrary
6807keys to values.
6808|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
6809<<fix-suggestion-info,FixSuggestionInfo>> entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006810|===========================
6811
6812[[robot-comment-input]]
6813=== RobotCommentInput
6814The `RobotCommentInput` entity contains information for creating an inline
6815robot comment.
6816
Alice Kober-Sotzek265805d2016-12-07 15:24:21 +01006817`RobotCommentInput` has the same fields as
6818<<robot-comment-info,RobotCommentInfo>>.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006819
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006820[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006821=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006822The `RuleInput` entity contains information to test a Prolog rule.
6823
David Pursehouseae367192014-11-25 17:24:47 +09006824[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006825|===========================
6826|Field Name ||Description
6827|`rule`||
6828Prolog code to execute instead of the code in `refs/meta/config`.
6829|`filters`|`RUN` if not set|
6830When `RUN` filter rules in the parent projects are called to
6831post-process the results of the project specific rule. This
6832behavior matches how the rule will execute if installed. +
6833If `SKIP` the parent filters are not called, allowing the test
6834to return results from the input rule.
6835|===========================
6836
Edwin Kempin14b58112013-02-26 16:30:19 +01006837[[submit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006838=== SubmitInfo
Edwin Kempin14b58112013-02-26 16:30:19 +01006839The `SubmitInfo` entity contains information about the change status
6840after submitting.
6841
Stefan Bellere4785b42015-06-18 12:31:03 -07006842[options="header",cols="1,^1,5"]
Edwin Kempin14b58112013-02-26 16:30:19 +01006843|==========================
Stefan Bellere4785b42015-06-18 12:31:03 -07006844|Field Name ||Description
6845|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07006846The status of the change after submitting is `MERGED`.
David Ostrovsky868e3412014-01-30 19:50:57 +01006847|`on_behalf_of`|optional|
6848The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on
6849whose behalf the action should be done. To use this option the caller must
David Pursehouse22bd6f92014-02-20 21:11:01 +09006850have been granted both `Submit` and `Submit (On Behalf Of)` permissions.
6851The user named by `on_behalf_of` does not need to be granted the `Submit`
6852permission. This feature is aimed for CI solutions: the CI account can be
David Pursehousea61ee502016-09-06 16:27:09 +09006853granted both permissions, so individual users don't need `Submit` permission
6854themselves. Still the changes can be submitted on behalf of real users and
David Pursehouse22bd6f92014-02-20 21:11:01 +09006855not with the identity of the CI account.
Edwin Kempin14b58112013-02-26 16:30:19 +01006856|==========================
6857
Edwin Kempin0eddba02013-02-22 15:30:12 +01006858[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006859=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01006860The `SubmitInput` entity contains information for submitting a change.
6861
David Pursehouseae367192014-11-25 17:24:47 +09006862[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006863|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01006864|Field Name ||Description
Edwin Kempincd07df42016-12-01 09:10:09 +01006865|`on_behalf_of` |optional|
Dave Borowitzc6d143d2016-02-24 12:32:23 -05006866If set, submit the change on behalf of the given user. The value may take any
6867format link:rest-api-accounts.html#account-id[accepted by the accounts REST
6868API]. Using this option requires
6869link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
6870permission on the branch.
Edwin Kempincd07df42016-12-01 09:10:09 +01006871|`notify` |optional|
Stephen Lia5a5ef02016-03-31 16:55:53 -07006872Notify handling that defines to whom email notifications should be sent after
6873the change is submitted. +
6874Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6875If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006876|`notify_details`|optional|
6877Additional information about whom to notify about the update as a map
6878of recipient type to link:#notify-info[NotifyInfo] entity.
6879|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01006880
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006881[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006882=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006883The `SubmitRecord` entity describes results from a submit_rule.
Dave Borowitz6453fce2016-09-22 16:11:56 +02006884Fields in this entity roughly correspond to the fields set by `LABELS`
6885in link:#label-info[LabelInfo].
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006886
David Pursehouseae367192014-11-25 17:24:47 +09006887[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006888|===========================
6889|Field Name ||Description
6890|`status`||
6891`OK`, the change can be submitted. +
6892`NOT_READY`, additional labels are required before submit. +
6893`CLOSED`, closed changes cannot be submitted. +
6894`RULE_ERROR`, rule code failed with an error.
6895|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01006896Map of labels that are approved; an
6897link:rest-api-accounts.html#account-info[AccountInfo] identifies the
6898voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006899|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01006900Map of labels that are preventing submit;
6901link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006902|`need`|optional|
6903Map of labels that need to be given to submit. The value is
6904currently an empty object.
6905|`may`|optional|
6906Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01006907link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
6908if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006909|`impossible`|optional|
6910Map of labels that should have been in `need` but cannot be
6911used by any user because of access restrictions. The value
6912is currently an empty object.
6913|`error_message`|optional|
6914When status is RULE_ERROR this message provides some text describing
6915the failure of the rule predicate.
6916|===========================
6917
Jonathan Nieder2a629b02016-06-16 15:15:25 -07006918[[submitted-together-info]]
6919=== SubmittedTogetherInfo
6920The `SubmittedTogetherInfo` entity contains information about a
6921collection of changes that would be submitted together.
6922
6923[options="header",cols="1,6"]
6924|===========================
6925|Field Name |Description
6926|`changes` |
6927A list of ChangeInfo entities representing the changes to be submitted together.
6928|`non_visible_changes`|
6929The number of changes to be submitted together that the current user
6930cannot see. (This count includes changes that are visible to the
6931current user when their reason for being submitted together involves
6932changes the user cannot see.)
6933|===========================
6934
Edwin Kempin521c1242015-01-23 12:44:44 +01006935[[suggested-reviewer-info]]
6936=== SuggestedReviewerInfo
6937The `SuggestedReviewerInfo` entity contains information about a reviewer
6938that can be added to a change (an account or a group).
6939
6940`SuggestedReviewerInfo` has either the `account` field that contains
6941the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
6942the `group` field that contains the
6943link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
6944
Logan Hanksab3c81e2016-07-20 15:42:52 -07006945[options="header",cols="1,^1,5"]
6946|===========================
6947|Field Name ||Description
6948|`account` |optional|
6949An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the
6950suggestion is an account.
6951|`group` |optional|
6952A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the
6953suggestion is a group.
6954|`count` ||
6955The total number of accounts in the suggestion. This is `1` if `account` is
6956present. If `group` is present, the total number of accounts that are
6957members of the group is returned (this count includes members of nested
6958groups).
6959|`confirm` |optional|
6960True if `group` is present and `count` is above the threshold where the
6961`confirmed` flag must be passed to add the group as a reviewer.
6962|===========================
6963
Edwin Kempin64006bb2013-02-22 08:17:04 +01006964[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006965=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01006966The `TopicInput` entity contains information for setting a topic.
6967
David Pursehouseae367192014-11-25 17:24:47 +09006968[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01006969|===========================
6970|Field Name ||Description
6971|`topic` |optional|The topic. +
6972The topic will be deleted if not set.
Edwin Kempin64006bb2013-02-22 08:17:04 +01006973|===========================
6974
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006975[[voting-range-info]]
6976=== VotingRangeInfo
6977The `VotingRangeInfo` entity describes the continuous voting range from min
6978to max values.
6979
6980[options="header",cols="1,6"]
6981|======================
6982|Field Name|Description
6983|`min` |The minimum voting value.
6984|`max` |The maximum voting value.
6985|======================
6986
Edwin Kempinbd885ff2014-04-11 16:11:56 +02006987[[web-link-info]]
6988=== WebLinkInfo
6989The `WebLinkInfo` entity describes a link to an external site.
6990
David Pursehouseae367192014-11-25 17:24:47 +09006991[options="header",cols="1,6"]
Edwin Kempinbd885ff2014-04-11 16:11:56 +02006992|======================
6993|Field Name|Description
6994|`name` |The link name.
6995|`url` |The link URL.
Sven Selberg55484202014-06-26 08:48:51 +02006996|`image_url`|URL to the icon of the link.
Edwin Kempinbd885ff2014-04-11 16:11:56 +02006997|======================
6998
Alan Tokaev392cfca2017-04-28 11:11:31 +02006999[[work-in-progress-input]]
7000=== WorkInProgressInput
7001The `WorkInProgressInput` entity contains additional information for a change
7002set to WorkInProgress/ReadyForReview.
7003
7004[options="header",cols="1,^1,5"]
7005|=============================
7006|Field Name ||Description
7007|`message` |optional|
7008Message to be added as a review comment to the change being set WorkInProgress/ReadyForReview.
7009|=============================
7010
Edwin Kempind0a63922013-01-23 16:32:59 +01007011GERRIT
7012------
7013Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07007014
7015SEARCHBOX
7016---------