blob: eb142bf4247bcd3b8c31b8ebdb01a7a4f3787e05 [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
1094[[restore-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001095=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001096--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001097'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001098--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001099
Edwin Kempined5364b2013-02-22 10:39:33 +01001100Restores a change.
1101
1102The request body does not need to include a link:#restore-input[
1103RestoreInput] entity if no review comment is added.
1104
1105.Request
1106----
1107 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
1108----
1109
1110As response a link:#change-info[ChangeInfo] entity is returned that
1111describes the restored change.
1112
1113.Response
1114----
1115 HTTP/1.1 200 OK
1116 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001117 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001118
1119 )]}'
1120 {
Edwin Kempined5364b2013-02-22 10:39:33 +01001121 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1122 "project": "myProject",
1123 "branch": "master",
1124 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1125 "subject": "Implementing Feature X",
1126 "status": "NEW",
1127 "created": "2013-02-01 09:59:32.126000000",
1128 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +01001129 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001130 "insertions": 2,
1131 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +01001132 "_number": 3965,
1133 "owner": {
1134 "name": "John Doe"
1135 }
1136 }
1137----
1138
1139If the change cannot be restored because the change state doesn't
1140allow restoring the change, the response is "`409 Conflict`" and
1141the error message is contained in the response body.
1142
1143.Response
1144----
1145 HTTP/1.1 409 Conflict
1146 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001147 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +01001148
1149 change is new
1150----
1151
Edwin Kempincdae63b2013-03-15 15:06:59 +01001152[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001153=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001154--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001155'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001156--
Edwin Kempincdae63b2013-03-15 15:06:59 +01001157
1158Rebases a change.
1159
Zalan Blenessy874aed72015-01-12 13:26:18 +01001160Optionally, the parent revision can be changed to another patch set through the
1161link:#rebase-input[RebaseInput] entity.
1162
Edwin Kempincdae63b2013-03-15 15:06:59 +01001163.Request
1164----
1165 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01001166 Content-Type: application/json;charset=UTF-8
1167
1168 {
1169 "base" : "1234",
1170 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01001171----
1172
1173As response a link:#change-info[ChangeInfo] entity is returned that
1174describes the rebased change. Information about the current patch set
1175is included.
1176
1177.Response
1178----
1179 HTTP/1.1 200 OK
1180 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001181 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001182
1183 )]}'
1184 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01001185 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1186 "project": "myProject",
1187 "branch": "master",
1188 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
1189 "subject": "Implement Feature X",
1190 "status": "NEW",
1191 "created": "2013-02-01 09:59:32.126000000",
1192 "updated": "2013-02-21 11:16:36.775000000",
1193 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001194 "insertions": 33,
1195 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +01001196 "_number": 4799,
1197 "owner": {
1198 "name": "John Doe"
1199 },
1200 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
1201 "revisions": {
1202 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09001203 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001204 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01001205 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01001206 "fetch": {
1207 "http": {
1208 "url": "http://gerrit:8080/myProject",
1209 "ref": "refs/changes/99/4799/2"
1210 }
1211 },
1212 "commit": {
1213 "parents": [
1214 {
1215 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
1216 "subject": "Implement Feature A"
1217 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00001218 ],
1219 "author": {
1220 "name": "John Doe",
1221 "email": "john.doe@example.com",
1222 "date": "2013-05-07 15:21:27.000000000",
1223 "tz": 120
1224 },
1225 "committer": {
1226 "name": "Gerrit Code Review",
1227 "email": "gerrit-server@example.com",
1228 "date": "2013-05-07 15:35:43.000000000",
1229 "tz": 120
1230 },
1231 "subject": "Implement Feature X",
1232 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01001233 }
1234 }
1235 }
1236----
1237
1238If the change cannot be rebased, e.g. due to conflicts, the response is
1239"`409 Conflict`" and the error message is contained in the response
1240body.
1241
1242.Response
1243----
1244 HTTP/1.1 409 Conflict
1245 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001246 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001247
1248 The change could not be rebased due to a path conflict during merge.
1249----
1250
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301251[[move-change]]
1252=== Move Change
1253--
1254'POST /changes/link:#change-id[\{change-id\}]/move'
1255--
1256
1257Move a change.
1258
1259The destination branch must be provided in the request body inside a
1260link:#move-input[MoveInput] entity.
1261
1262.Request
1263----
1264 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0
1265 Content-Type: application/json; charset=UTF-8
1266
1267 {
1268 "destination_branch" : "release-branch"
1269 }
1270
1271----
1272
1273As response a link:#change-info[ChangeInfo] entity is returned that
1274describes the moved change.
1275
1276.Response
1277----
1278 HTTP/1.1 200 OK
1279 Content-Disposition: attachment
1280 Content-Type: application/json; charset=UTF-8
1281
1282 )]}'
1283 {
1284 "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940",
1285 "project": "myProject",
1286 "branch": "release-branch",
1287 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1288 "subject": "Implementing Feature X",
1289 "status": "NEW",
1290 "created": "2013-02-01 09:59:32.126000000",
1291 "updated": "2013-02-21 11:16:36.775000000",
1292 "mergeable": true,
1293 "insertions": 2,
1294 "deletions": 13,
1295 "_number": 3965,
1296 "owner": {
1297 "name": "John Doe"
1298 }
1299 }
1300----
1301
1302If the change cannot be moved because the change state doesn't
1303allow moving the change, the response is "`409 Conflict`" and
1304the error message is contained in the response body.
1305
1306.Response
1307----
1308 HTTP/1.1 409 Conflict
1309 Content-Disposition: attachment
1310 Content-Type: text/plain; charset=UTF-8
1311
1312 change is merged
1313----
1314
1315If the change cannot be moved because the user doesn't have
1316abandon permission on the change or upload permission on the destination,
1317the response is "`409 Conflict`" and the error message is contained in the
1318response body.
1319
1320.Response
1321----
1322 HTTP/1.1 409 Conflict
1323 Content-Disposition: attachment
1324 Content-Type: text/plain; charset=UTF-8
1325
1326 move not permitted
1327----
1328
Edwin Kempind2ec4152013-02-22 12:17:19 +01001329[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001330=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001331--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001332'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001333--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001334
Edwin Kempind2ec4152013-02-22 12:17:19 +01001335Reverts a change.
1336
1337The request body does not need to include a link:#revert-input[
1338RevertInput] entity if no review comment is added.
1339
1340.Request
1341----
Michael Zhou10270492016-03-24 22:35:40 -04001342 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0
Edwin Kempind2ec4152013-02-22 12:17:19 +01001343----
1344
1345As response a link:#change-info[ChangeInfo] entity is returned that
1346describes the reverting change.
1347
1348.Response
1349----
1350 HTTP/1.1 200 OK
1351 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001352 Content-Type: application/json; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001353
1354 )]}'
1355 {
Edwin Kempind2ec4152013-02-22 12:17:19 +01001356 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1357 "project": "myProject",
1358 "branch": "master",
1359 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1360 "subject": "Revert \"Implementing Feature X\"",
1361 "status": "NEW",
1362 "created": "2013-02-01 09:59:32.126000000",
1363 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempind2ec4152013-02-22 12:17:19 +01001364 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001365 "insertions": 6,
1366 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +01001367 "_number": 3965,
1368 "owner": {
1369 "name": "John Doe"
1370 }
1371 }
1372----
1373
1374If the change cannot be reverted because the change state doesn't
1375allow reverting the change, the response is "`409 Conflict`" and
1376the error message is contained in the response body.
1377
1378.Response
1379----
1380 HTTP/1.1 409 Conflict
1381 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001382 Content-Type: text/plain; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001383
1384 change is new
1385----
1386
Edwin Kempin0eddba02013-02-22 15:30:12 +01001387[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001388=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001389--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001390'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001391--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001392
Edwin Kempin0eddba02013-02-22 15:30:12 +01001393Submits a change.
1394
1395The request body only needs to include a link:#submit-input[
David Pursehousea8f48f82016-03-10 15:27:47 +09001396SubmitInput] entity if submitting on behalf of another user.
Edwin Kempin0eddba02013-02-22 15:30:12 +01001397
1398.Request
1399----
1400 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001401 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001402
1403 {
David Pursehousea8f48f82016-03-10 15:27:47 +09001404 "on_behalf_of": 1001439
Edwin Kempin0eddba02013-02-22 15:30:12 +01001405 }
1406----
1407
1408As response a link:#change-info[ChangeInfo] entity is returned that
1409describes the submitted/merged change.
1410
1411.Response
1412----
1413 HTTP/1.1 200 OK
1414 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001415 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001416
1417 )]}'
1418 {
Edwin Kempin0eddba02013-02-22 15:30:12 +01001419 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1420 "project": "myProject",
1421 "branch": "master",
1422 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1423 "subject": "Implementing Feature X",
1424 "status": "MERGED",
1425 "created": "2013-02-01 09:59:32.126000000",
1426 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001427 "submitted": "2013-02-21 11:16:36.615000000",
Edwin Kempin0eddba02013-02-22 15:30:12 +01001428 "_number": 3965,
1429 "owner": {
1430 "name": "John Doe"
1431 }
1432 }
1433----
1434
1435If the change cannot be submitted because the submit rule doesn't allow
1436submitting the change, the response is "`409 Conflict`" and the error
1437message is contained in the response body.
1438
1439.Response
1440----
1441 HTTP/1.1 409 Conflict
1442 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001443 Content-Type: text/plain; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001444
1445 blocked by Verified
1446----
1447
David Pursehouse025c1af2015-11-20 17:02:50 +09001448[[submitted-together]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001449=== Changes Submitted Together
Stefan Bellera7ad6612015-06-26 10:05:43 -07001450--
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001451'GET /changes/link:#change-id[\{change-id\}]/submitted_together?o=NON_VISIBLE_CHANGES'
Stefan Bellera7ad6612015-06-26 10:05:43 -07001452--
1453
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001454Computes list of all changes which are submitted when
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001455link:#submit-change[Submit] is called for this change,
Stefan Beller460f3542015-07-20 14:10:41 -07001456including the current change itself.
1457
Stefan Bellera7ad6612015-06-26 10:05:43 -07001458The list consists of:
1459
1460* The given change.
1461* If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1462 is enabled, include all open changes with the same topic.
1463* For each change whose submit type is not CHERRY_PICK, include unmerged
1464 ancestors targeting the same branch.
1465
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001466As a special case, the list is empty if this change would be
1467submitted by itself (without other changes).
1468
1469.Request
1470----
1471 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0
1472 Content-Type: application/json; charset=UTF-8
1473----
1474
1475As a response a link:#submitted-together-info[SubmittedTogetherInfo]
1476entity is returned that describes what would happen if the change were
1477submitted. This response contains a list of changes and a count of
1478changes that are not visible to the caller that are part of the set of
1479changes to be merged.
1480
1481The listed changes use the same format as in
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001482link:#list-changes[Query Changes] with the
1483link:#labels[`LABELS`], link:#detailed-labels[`DETAILED_LABELS`],
Jonathan Niedercb51d742016-09-23 11:37:57 -07001484link:#current-revision[`CURRENT_REVISION`],
1485link:#current-commit[`CURRENT_COMMIT`], and
1486link:#submittable[`SUBMITTABLE`] options set.
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001487
Shawn Pearce8080c3d2016-09-19 19:15:04 -07001488Standard link:#query-options[formatting options] can be specified
1489with the `o` parameter, as well as the `submitted_together` specific
1490option `NON_VISIBLE_CHANGES`.
1491
Stefan Bellera7ad6612015-06-26 10:05:43 -07001492.Response
1493----
1494 HTTP/1.1 200 OK
1495 Content-Disposition: attachment
1496 Content-Type: application/json; charset=UTF-8
1497
1498)]}'
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001499{
1500 "changes": [
1501 {
1502 "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1503 "project": "gerrit",
1504 "branch": "master",
1505 "hashtags": [],
1506 "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1507 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1508 "status": "NEW",
1509 "created": "2015-05-01 15:39:57.979000000",
1510 "updated": "2015-05-20 19:25:21.592000000",
1511 "mergeable": true,
1512 "insertions": 303,
1513 "deletions": 210,
1514 "_number": 1779,
1515 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001516 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001517 },
1518 "labels": {
1519 "Code-Review": {
1520 "approved": {
1521 "_account_id": 1000000
1522 },
1523 "all": [
1524 {
1525 "value": 2,
1526 "date": "2015-05-20 19:25:21.592000000",
1527 "_account_id": 1000000
1528 }
1529 ],
1530 "values": {
1531 "-2": "This shall not be merged",
1532 "-1": "I would prefer this is not merged as is",
1533 " 0": "No score",
1534 "+1": "Looks good to me, but someone else must approve",
1535 "+2": "Looks good to me, approved"
1536 },
1537 "default_value": 0
1538 },
1539 "Verified": {
1540 "approved": {
1541 "_account_id": 1000000
1542 },
1543 "all": [
1544 {
1545 "value": 1,
1546 "date": "2015-05-20 19:25:21.592000000",
1547 "_account_id": 1000000
1548 }
1549 ],
1550 "values": {
1551 "-1": "Fails",
1552 " 0": "No score",
1553 "+1": "Verified"
1554 },
1555 "default_value": 0
1556 }
1557 },
1558 "permitted_labels": {
1559 "Code-Review": [
1560 "-2",
1561 "-1",
1562 " 0",
1563 "+1",
1564 "+2"
1565 ],
1566 "Verified": [
1567 "-1",
1568 " 0",
1569 "+1"
1570 ]
1571 },
1572 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001573 {
1574 "_account_id": 1000000
1575 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001576 ],
1577 "reviewers": {
1578 "REVIEWER": [
1579 {
1580 "_account_id": 1000000
1581 }
1582 ]
1583 },
1584 "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1585 "revisions": {
1586 "9adb9f4c7b40eeee0646e235de818d09164d7379": {
David Pursehouse4de41112016-06-28 09:24:08 +09001587 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001588 "_number": 1,
1589 "created": "2015-05-01 15:39:57.979000000",
1590 "uploader": {
1591 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001592 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001593 "ref": "refs/changes/79/1779/1",
1594 "fetch": {},
1595 "commit": {
1596 "parents": [
1597 {
1598 "commit": "2d3176497a2747faed075f163707e57d9f961a1c",
1599 "subject": "Merge changes from topic \u0027submodule-subscription-tests-and-fixes-3\u0027"
1600 }
1601 ],
1602 "author": {
1603 "name": "Stefan Beller",
1604 "email": "sbeller@google.com",
1605 "date": "2015-04-29 21:36:52.000000000",
1606 "tz": -420
1607 },
1608 "committer": {
1609 "name": "Stefan Beller",
1610 "email": "sbeller@google.com",
1611 "date": "2015-05-01 00:11:16.000000000",
1612 "tz": -420
1613 },
1614 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1615 "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"
1616 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001617 }
1618 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001619 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001620 {
1621 "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22",
1622 "project": "gerrit",
1623 "branch": "master",
1624 "hashtags": [],
1625 "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22",
1626 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1627 "status": "NEW",
1628 "created": "2015-05-01 15:39:57.979000000",
1629 "updated": "2015-05-20 19:25:21.546000000",
1630 "mergeable": true,
1631 "insertions": 15,
1632 "deletions": 6,
1633 "_number": 1780,
1634 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001635 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001636 },
1637 "labels": {
1638 "Code-Review": {
1639 "approved": {
1640 "_account_id": 1000000
1641 },
1642 "all": [
1643 {
1644 "value": 2,
1645 "date": "2015-05-20 19:25:21.546000000",
1646 "_account_id": 1000000
1647 }
1648 ],
1649 "values": {
1650 "-2": "This shall not be merged",
1651 "-1": "I would prefer this is not merged as is",
1652 " 0": "No score",
1653 "+1": "Looks good to me, but someone else must approve",
1654 "+2": "Looks good to me, approved"
1655 },
1656 "default_value": 0
1657 },
1658 "Verified": {
1659 "approved": {
1660 "_account_id": 1000000
1661 },
1662 "all": [
1663 {
1664 "value": 1,
1665 "date": "2015-05-20 19:25:21.546000000",
1666 "_account_id": 1000000
1667 }
1668 ],
1669 "values": {
1670 "-1": "Fails",
1671 " 0": "No score",
1672 "+1": "Verified"
1673 },
1674 "default_value": 0
1675 }
1676 },
1677 "permitted_labels": {
1678 "Code-Review": [
1679 "-2",
1680 "-1",
1681 " 0",
1682 "+1",
1683 "+2"
1684 ],
1685 "Verified": [
1686 "-1",
1687 " 0",
1688 "+1"
1689 ]
1690 },
1691 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001692 {
1693 "_account_id": 1000000
1694 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001695 ],
1696 "reviewers": {
1697 "REVIEWER": [
1698 {
1699 "_account_id": 1000000
1700 }
1701 ]
1702 },
1703 "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4",
1704 "revisions": {
1705 "1bd7c12a38854a2c6de426feec28800623f492c4": {
David Pursehouse4de41112016-06-28 09:24:08 +09001706 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001707 "_number": 1,
1708 "created": "2015-05-01 15:39:57.979000000",
1709 "uploader": {
1710 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001711 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001712 "ref": "refs/changes/80/1780/1",
1713 "fetch": {},
1714 "commit": {
1715 "parents": [
1716 {
1717 "commit": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1718 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes"
1719 }
1720 ],
1721 "author": {
1722 "name": "Stefan Beller",
1723 "email": "sbeller@google.com",
1724 "date": "2015-04-25 00:11:59.000000000",
1725 "tz": -420
1726 },
1727 "committer": {
1728 "name": "Stefan Beller",
1729 "email": "sbeller@google.com",
1730 "date": "2015-05-01 00:11:16.000000000",
1731 "tz": -420
1732 },
1733 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1734 "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"
1735 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001736 }
1737 }
1738 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001739 ],
1740 "non_visible_changes": 0
1741}
Stefan Bellera7ad6612015-06-26 10:05:43 -07001742----
1743
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001744If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then
1745instead of a link:#submitted-together-info[SubmittedTogetherInfo]
1746entity, the response is a list of changes, or a 403 response with a
1747message if the set of changes to be submitted with this change
1748includes changes the caller cannot read.
1749
Stefan Bellera7ad6612015-06-26 10:05:43 -07001750
David Ostrovsky0d69c232013-09-10 23:10:23 +02001751[[publish-draft-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001752=== Publish Draft Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001753--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001754'POST /changes/link:#change-id[\{change-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001755--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001756
1757Publishes a draft change.
1758
1759.Request
1760----
1761 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/publish HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001762 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001763----
1764
1765.Response
1766----
1767 HTTP/1.1 204 No Content
1768----
1769
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02001770[[delete-change]]
1771=== Delete Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001772--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001773'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001774--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001775
Alice Kober-Sotzek31c83332016-10-19 14:23:03 +02001776Deletes a change.
1777
Paladox none580ae0e2017-02-12 18:15:48 +00001778New or abandoned changes can be deleted by their owner if the user is granted
1779the link:access-control.html#category_delete_own_changes[Delete Own Changes] permission,
1780otherwise only by administrators.
1781
1782Draft changes can only be deleted by their owner or other users who have the
1783permissions to view and delete drafts. If the draft workflow is disabled, only
1784administrators with those permissions may delete draft changes.
David Ostrovsky0d69c232013-09-10 23:10:23 +02001785
1786.Request
1787----
1788 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001789 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001790----
1791
1792.Response
1793----
1794 HTTP/1.1 204 No Content
1795----
1796
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001797[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001798=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001799--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001800'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001801--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001802
1803Retrieves the branches and tags in which a change is included. As result
1804an link:#included-in-info[IncludedInInfo] entity is returned.
1805
1806.Request
1807----
1808 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
1809----
1810
1811.Response
1812----
1813 HTTP/1.1 200 OK
1814 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001815 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001816
1817 )]}'
1818 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001819 "branches": [
1820 "master"
1821 ],
1822 "tags": []
1823 }
1824----
1825
David Pursehouse4e38b972014-05-30 10:36:40 +09001826[[index-change]]
1827=== Index Change
1828--
1829'POST /changes/link:#change-id[\{change-id\}]/index'
1830--
1831
1832Adds or updates the change in the secondary index.
1833
1834.Request
1835----
1836 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
1837----
1838
1839.Response
1840----
1841 HTTP/1.1 204 No Content
1842----
1843
Dave Borowitz23fec2b2015-04-28 17:40:07 -07001844[[list-change-comments]]
1845=== List Change Comments
1846--
1847'GET /changes/link:#change-id[\{change-id\}]/comments'
1848--
1849
1850Lists the published comments of all revisions of the change.
1851
1852Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1853entries. The entries in the map are sorted by file path, and the
1854comments for each path are sorted by patch set number. Each comment has
1855the `patch_set` and `author` fields set.
1856
1857.Request
1858----
1859 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
1860----
1861
1862.Response
1863----
1864 HTTP/1.1 200 OK
1865 Content-Disposition: attachment
1866 Content-Type: application/json; charset=UTF-8
1867
1868 )]}'
1869 {
1870 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1871 {
1872 "patch_set": 1,
1873 "id": "TvcXrmjM",
1874 "line": 23,
1875 "message": "[nit] trailing whitespace",
1876 "updated": "2013-02-26 15:40:43.986000000"
1877 "author": {
1878 "_account_id": 1000096,
1879 "name": "John Doe",
1880 "email": "john.doe@example.com"
1881 }
1882 },
1883 {
1884 "patch_set": 2,
1885 "id": "TveXwFiA",
1886 "line": 49,
1887 "in_reply_to": "TfYX-Iuo",
1888 "message": "Done",
1889 "updated": "2013-02-26 15:40:45.328000000"
1890 "author": {
1891 "_account_id": 1000097,
1892 "name": "Jane Roe",
1893 "email": "jane.roe@example.com"
1894 }
1895 }
1896 ]
1897 }
1898----
1899
Changcheng Xiao9b04c042016-12-28 12:45:29 +01001900[[list-change-robot-comments]]
1901=== List Change Robot Comments
1902--
1903'GET /changes/link:#change-id[\{change-id\}]/robotcomments'
1904--
1905
1906Lists the robot comments of all revisions of the change.
1907
1908Return a map that maps the file path to a list of
1909link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
1910map are sorted by file path.
1911
1912.Request
1913----
1914 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/robotcomments/ HTTP/1.0
1915----
1916
1917.Response
1918----
1919 HTTP/1.1 200 OK
1920 Content-Disposition: attachment
1921 Content-Type: application/json; charset=UTF-8
1922
1923 )]}'
1924 {
1925 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1926 {
1927 "id": "TvcXrmjM",
1928 "line": 23,
1929 "message": "unused import",
1930 "updated": "2016-02-26 15:40:43.986000000",
1931 "author": {
1932 "_account_id": 1000110,
1933 "name": "Code Analyzer",
1934 "email": "code.analyzer@example.com"
1935 },
1936 "robotId": "importChecker",
1937 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
1938 },
1939 {
1940 "id": "TveXwFiA",
1941 "line": 49,
1942 "message": "wrong indention",
1943 "updated": "2016-02-26 15:40:45.328000000",
1944 "author": {
1945 "_account_id": 1000110,
1946 "name": "Code Analyzer",
1947 "email": "code.analyzer@example.com"
1948 },
1949 "robotId": "styleChecker",
1950 "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b"
1951 }
1952 ]
1953 }
1954----
1955
Dave Borowitz23fec2b2015-04-28 17:40:07 -07001956[[list-change-drafts]]
1957=== List Change Drafts
1958--
1959'GET /changes/link:#change-id[\{change-id\}]/drafts'
1960--
1961
1962Lists the draft comments of all revisions of the change that belong to
1963the calling user.
1964
1965Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1966entries. The entries in the map are sorted by file path, and the
1967comments for each path are sorted by patch set number. Each comment has
1968the `patch_set` field set, and no `author`.
1969
1970.Request
1971----
1972 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0
1973----
1974
1975.Response
1976----
1977 HTTP/1.1 200 OK
1978 Content-Disposition: attachment
1979 Content-Type: application/json; charset=UTF-8
1980
1981 )]}'
1982 {
1983 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1984 {
1985 "patch_set": 1,
1986 "id": "TvcXrmjM",
1987 "line": 23,
1988 "message": "[nit] trailing whitespace",
1989 "updated": "2013-02-26 15:40:43.986000000"
1990 },
1991 {
1992 "patch_set": 2,
1993 "id": "TveXwFiA",
1994 "line": 49,
1995 "in_reply_to": "TfYX-Iuo",
1996 "message": "Done",
1997 "updated": "2013-02-26 15:40:45.328000000"
1998 }
1999 ]
2000 }
2001----
2002
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002003[[check-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002004=== Check Change
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002005--
2006'GET /changes/link:#change-id[\{change-id\}]/check'
2007--
2008
2009Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05002010link:#change-info[ChangeInfo] entity with the `problems` field set to a
2011list of link:#problem-info[ProblemInfo] entities.
2012
2013Depending on the type of problem, some fields not marked optional may be
2014missing from the result. At least `id`, `project`, `branch`, and
2015`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002016
2017.Request
2018----
2019 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2020----
2021
2022.Response
2023----
2024 HTTP/1.1 200 OK
2025 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002026 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002027
2028 )]}'
2029 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05002030 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2031 "project": "myProject",
2032 "branch": "master",
2033 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2034 "subject": "Implementing Feature X",
2035 "status": "NEW",
2036 "created": "2013-02-01 09:59:32.126000000",
2037 "updated": "2013-02-21 11:16:36.775000000",
2038 "mergeable": true,
2039 "insertions": 34,
2040 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05002041 "_number": 3965,
2042 "owner": {
2043 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002044 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05002045 "problems": [
2046 {
2047 "message": "Current patch set 1 not found"
2048 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08002049 ]
2050 }
2051----
2052
Dave Borowitz3be39d02014-12-03 17:57:38 -08002053[[fix-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09002054=== Fix Change
Dave Borowitz3be39d02014-12-03 17:57:38 -08002055--
2056'POST /changes/link:#change-id[\{change-id\}]/check'
2057--
2058
2059Performs consistency checks on the change as with link:#check-change[GET
2060/check], and additionally fixes any problems that can be fixed
2061automatically. The returned field values reflect any fixes.
2062
Dave Borowitzbad53ee2015-06-11 10:10:18 -04002063Some fixes have options controlling their behavior, which can be set in the
2064link:#fix-input[FixInput] entity body.
2065
Dave Borowitz3be39d02014-12-03 17:57:38 -08002066Only the change owner, a project owner, or an administrator may fix changes.
2067
2068.Request
2069----
2070 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2071----
2072
2073.Response
2074----
2075 HTTP/1.1 200 OK
2076 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002077 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08002078
2079 )]}'
2080 {
2081 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2082 "project": "myProject",
2083 "branch": "master",
2084 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2085 "subject": "Implementing Feature X",
2086 "status": "MERGED",
2087 "created": "2013-02-01 09:59:32.126000000",
2088 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08002089 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08002090 "mergeable": true,
2091 "insertions": 34,
2092 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08002093 "_number": 3965,
2094 "owner": {
2095 "name": "John Doe"
2096 },
2097 "problems": [
2098 {
2099 "message": "Current patch set 2 not found"
2100 },
2101 {
2102 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
2103 "status": FIXED,
2104 "outcome": "Marked change as merged"
2105 }
2106 ]
2107 }
2108----
2109
David Pursehouse7c5c3a52017-04-10 11:37:23 +09002110[[mark-private]]
Edwin Kempin98ddc8a2017-02-21 11:56:08 +01002111=== Mark Private
2112--
2113'PUT /changes/link:#change-id[\{change-id\}]/private'
2114--
2115
2116Marks the change to be private. Note users can only mark own changes as private.
2117
2118.Request
2119----
2120 Set /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2121----
2122
2123.Response
2124----
2125 HTTP/1.1 201 Created
2126----
2127
2128If the change was already private the response is "`200 OK`".
2129
2130[[unmark-private]]
2131=== Unmark Private
2132--
2133'DELETE /changes/link:#change-id[\{change-id\}]/private'
2134--
2135
2136Marks the change to be non-private. Note users can only unmark own private
2137changes.
2138
2139.Request
2140----
2141 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/private HTTP/1.0
2142----
2143
2144.Response
2145----
2146 HTTP/1.1 204 No Content
2147----
2148
2149If the change was already not private, the response is "`409 Conflict`".
2150
David Ostrovsky1a49f622014-07-29 00:40:02 +02002151[[edit-endpoints]]
2152== Change Edit Endpoints
2153
David Ostrovsky1a49f622014-07-29 00:40:02 +02002154[[get-edit-detail]]
2155=== Get Change Edit Details
2156--
2157'GET /changes/link:#change-id[\{change-id\}]/edit
2158--
2159
2160Retrieves a change edit details.
2161
2162.Request
2163----
2164 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2165----
2166
2167As response an link:#edit-info[EditInfo] entity is returned that
2168describes the change edit, or "`204 No Content`" when change edit doesn't
2169exist for this change. Change edits are stored on special branches and there
2170can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02002171When request parameter `list` is provided the response also includes the file
2172list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02002173against this base revision. When request parameter `download-commands` is
2174provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02002175
2176.Response
2177----
2178 HTTP/1.1 200 OK
2179 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002180 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02002181
2182 )]}'
2183 {
2184 "commit":{
2185 "parents":[
2186 {
2187 "commit":"1eee2c9d8f352483781e772f35dc586a69ff5646",
2188 }
2189 ],
2190 "author":{
2191 "name":"Shawn O. Pearce",
2192 "email":"sop@google.com",
2193 "date":"2012-04-24 18:08:08.000000000",
2194 "tz":-420
2195 },
2196 "committer":{
2197 "name":"Shawn O. Pearce",
2198 "email":"sop@google.com",
2199 "date":"2012-04-24 18:08:08.000000000",
2200 "tz":-420
2201 },
2202 "subject":"Use an EventBus to manage star icons",
2203 "message":"Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2204 },
Michael Zhoud03fe282016-04-25 17:13:17 -04002205 "base_revision":"c35558e0925e6985c91f3a16921537d5e572b7a3"
David Ostrovsky1a49f622014-07-29 00:40:02 +02002206 }
2207----
David Pursehouse4e38b972014-05-30 10:36:40 +09002208
David Ostrovskya5ab8292014-08-01 02:11:39 +02002209[[put-edit-file]]
2210=== Change file content in Change Edit
2211--
2212'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2213--
2214
2215Put content of a file to a change edit.
2216
2217.Request
2218----
2219 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2220----
2221
2222When change edit doesn't exist for this change yet it is created. When file
2223content isn't provided, it is wiped out for that file. As response
2224"`204 No Content`" is returned.
2225
2226.Response
2227----
2228 HTTP/1.1 204 No Content
2229----
2230
David Ostrovsky138edb42014-08-15 21:31:43 +02002231[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01002232=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02002233--
2234'POST /changes/link:#change-id[\{change-id\}]/edit
2235--
2236
David Ostrovskya00c9532015-01-21 00:17:49 +01002237Creates empty change edit, restores file content or renames files in change
2238edit. The request body needs to include a
2239link:#change-edit-input[ChangeEditInput] entity when a file within change
2240edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02002241
2242.Request
2243----
2244 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002245 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02002246
2247 {
David Ostrovskybd12e172014-08-21 23:08:15 +02002248 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02002249 }
2250----
2251
David Ostrovskya00c9532015-01-21 00:17:49 +01002252or for rename:
2253
2254.Request
2255----
2256 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2257 Content-Type: application/json; charset=UTF-8
2258
2259 {
2260 "old_path": "foo",
2261 "new_path": "bar"
2262 }
2263----
2264
David Ostrovsky138edb42014-08-15 21:31:43 +02002265When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01002266and restore flag are provided in request body, this file is restored. When
2267old and new file names are provided, the file is renamed. As response
2268"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02002269
2270.Response
2271----
2272 HTTP/1.1 204 No Content
2273----
2274
David Ostrovskyc967e152014-10-24 17:36:16 +02002275[[put-change-edit-message]]
2276=== Change commit message in Change Edit
2277--
2278'PUT /changes/link:#change-id[\{change-id\}]/edit:message
2279--
2280
2281Modify commit message. The request body needs to include a
2282link:#change-edit-message-input[ChangeEditMessageInput]
2283entity.
2284
2285.Request
2286----
2287 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002288 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02002289
2290 {
2291 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
2292 }
2293----
2294
2295If a change edit doesn't exist for this change yet, it is created. As
2296response "`204 No Content`" is returned.
2297
2298.Response
2299----
2300 HTTP/1.1 204 No Content
2301----
2302
David Ostrovsky2830c292014-08-01 02:24:31 +02002303[[delete-edit-file]]
2304=== Delete file in Change Edit
2305--
2306'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
2307--
2308
2309Deletes a file from a change edit. This deletes the file from the repository
2310completely. This is not the same as reverting or restoring a file to its
2311previous contents.
2312
2313.Request
2314----
2315 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2316----
2317
2318When change edit doesn't exist for this change yet it is created.
2319
2320.Response
2321----
2322 HTTP/1.1 204 No Content
2323----
2324
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002325[[get-edit-file]]
2326=== Retrieve file content from Change Edit
2327--
2328'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2329--
2330
2331Retrieves content of a file from a change edit.
2332
2333.Request
2334----
2335 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2336----
2337
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002338The content of the file is returned as text encoded inside base64.
2339The Content-Type header will always be `text/plain` reflecting the
2340outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
2341can be examined to find the server detected content type of the file.
2342
2343When the specified file was deleted in the change edit
2344"`204 No Content`" is returned.
2345
2346If only the content type is required, callers should use HEAD to
2347avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002348
Michael Zhou551ad0c2016-04-26 01:21:42 -04002349If the `base` parameter is set to true, the returned content is from the
2350revision that the edit is based on.
2351
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002352.Response
2353----
2354 HTTP/1.1 200 OK
2355 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002356 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002357 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002358 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002359
2360 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
2361----
2362
David Ostrovskyd0078672015-02-06 21:51:04 +01002363Alternatively, if the only value of the Accept request header is
2364`application/json` the content is returned as JSON string and
2365`X-FYI-Content-Encoding` is set to `json`.
2366
David Ostrovsky9ea9c112015-01-25 00:12:38 +01002367[[get-edit-meta-data]]
2368=== Retrieve meta data of a file from Change Edit
2369--
2370'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
2371--
2372
2373Retrieves meta data of a file from a change edit. Currently only
2374web links are returned.
2375
2376.Request
2377----
2378 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
2379----
2380
2381This REST endpoint retrieves additional information for a file in a
2382change edit. As result an link:#edit-file-info[EditFileInfo] entity is
2383returned.
2384
2385.Response
2386----
2387 HTTP/1.1 200 OK
2388 Content-Disposition: attachment
2389 Content-Type: application/json; charset=UTF-8
2390
2391 )]}'
2392 {
2393 "web_links":[
2394 {
2395 "show_on_side_by_side_diff_view": true,
2396 "name": "side-by-side preview diff",
2397 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
2398 "url": "#/x/xdocs/c/42/1..0/README.md",
2399 "target": "_self"
2400 },
2401 {
2402 "show_on_unified_diff_view": true,
2403 "name": "unified preview diff",
2404 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
2405 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
2406 "target": "_self"
2407 }
2408 ]}
2409----
2410
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002411[[get-edit-message]]
2412=== Retrieve commit message from Change Edit or current patch set of the change
2413--
2414'GET /changes/link:#change-id[\{change-id\}]/edit:message
2415--
2416
David Ostrovsky25ad15e2014-12-15 21:18:59 +01002417Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002418
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02002419If the `base` parameter is set to true, the returned message is from the
2420revision that the edit is based on.
2421
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002422.Request
2423----
2424 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
2425----
2426
2427The commit message is returned as base64 encoded string.
2428
2429.Response
2430----
2431 HTTP/1.1 200 OK
2432
2433 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
2434M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
2435----
2436
David Ostrovskyd0078672015-02-06 21:51:04 +01002437Alternatively, if the only value of the Accept request header is
2438`application/json` the commit message is returned as JSON string:
2439
2440.Response
2441----
2442 HTTP/1.1 200 OK
2443
2444)]}'
2445"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
2446----
2447
2448
David Ostrovskye9988f92014-08-01 09:56:34 +02002449[[publish-edit]]
2450=== Publish Change Edit
2451--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002452'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02002453--
2454
2455Promotes change edit to a regular patch set.
2456
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02002457Options can be provided in the request body as a
2458link:#publish-change-edit-input[PublishChangeEditInput] entity.
2459
David Ostrovskye9988f92014-08-01 09:56:34 +02002460.Request
2461----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002462 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02002463 Content-Type: application/json; charset=UTF-8
2464
2465 {
2466 "notify": "NONE"
2467 }
David Ostrovskye9988f92014-08-01 09:56:34 +02002468----
2469
2470As response "`204 No Content`" is returned.
2471
2472.Response
2473----
2474 HTTP/1.1 204 No Content
2475----
2476
David Ostrovsky46999d22014-08-16 02:19:13 +02002477[[rebase-edit]]
2478=== Rebase Change Edit
2479--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002480'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02002481--
2482
2483Rebases change edit on top of latest patch set.
2484
2485.Request
2486----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002487 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02002488----
2489
2490When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09002491"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02002492based on top of the latest patch set, the response
2493"`409 Conflict`" is returned.
2494
2495.Response
2496----
2497 HTTP/1.1 204 No Content
2498----
2499
David Ostrovsky8e75f502014-08-10 00:36:31 +02002500[[delete-edit]]
2501=== Delete Change Edit
2502--
2503'DELETE /changes/link:#change-id[\{change-id\}]/edit'
2504--
2505
2506Deletes change edit.
2507
2508.Request
2509----
2510 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2511----
2512
2513As response "`204 No Content`" is returned.
2514
2515.Response
2516----
2517 HTTP/1.1 204 No Content
2518----
2519
Edwin Kempin9a9f1c02017-01-02 15:10:49 +01002520[[get-hashtags]]
2521=== Get Hashtags
2522--
2523'GET /changes/link:#change-id[\{change-id\}]/hashtags'
2524--
2525
2526Gets the hashtags associated with a change.
2527
2528[NOTE] Hashtags are only available when NoteDb is enabled.
2529
2530.Request
2531----
2532 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2533----
2534
2535As response the change's hashtags are returned as a list of strings.
2536
2537.Response
2538----
2539 HTTP/1.1 200 OK
2540 Content-Disposition: attachment
2541 Content-Type: application/json; charset=UTF-8
2542
2543 )]}'
2544 [
2545 "hashtag1",
2546 "hashtag2"
2547 ]
2548----
2549
2550[[set-hashtags]]
2551=== Set Hashtags
2552--
2553'POST /changes/link:#change-id[\{change-id\}]/hashtags'
2554--
2555
2556Adds and/or removes hashtags from a change.
2557
2558[NOTE] Hashtags are only available when NoteDb is enabled.
2559
2560The hashtags to add or remove must be provided in the request body inside a
2561link:#hashtags-input[HashtagsInput] entity.
2562
2563.Request
2564----
2565 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
2566 Content-Type: application/json; charset=UTF-8
2567
2568 {
2569 "add" : [
2570 "hashtag3"
2571 ],
2572 "remove" : [
2573 "hashtag2"
2574 ]
2575 }
2576----
2577
2578As response the change's hashtags are returned as a list of strings.
2579
2580.Response
2581----
2582 HTTP/1.1 200 OK
2583 Content-Disposition: attachment
2584 Content-Type: application/json; charset=UTF-8
2585
2586 )]}'
2587 [
2588 "hashtag1",
2589 "hashtag3"
2590 ]
2591----
2592
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002593[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002594== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002595
2596[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002597=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002598--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002599'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002600--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002601
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002602Lists the reviewers of a change.
2603
2604As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
2605
2606.Request
2607----
2608 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0
2609----
2610
2611.Response
2612----
2613 HTTP/1.1 200 OK
2614 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002615 Content-Type: application/json; charset=UTF-8
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002616
2617 )]}'
2618 [
2619 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002620 "approvals": {
2621 "Verified": "+1",
2622 "Code-Review": "+2"
2623 },
2624 "_account_id": 1000096,
2625 "name": "John Doe",
2626 "email": "john.doe@example.com"
2627 },
2628 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002629 "approvals": {
2630 "Verified": " 0",
2631 "Code-Review": "-1"
2632 },
2633 "_account_id": 1000097,
2634 "name": "Jane Roe",
2635 "email": "jane.roe@example.com"
2636 }
2637 ]
2638----
2639
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002640[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002641=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002642--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002643'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002644--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002645
2646Suggest the reviewers for a given query `q` and result limit `n`. If result
2647limit is not passed, then the default 10 is used.
2648
2649As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
2650
2651.Request
2652----
2653 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0
2654----
2655
2656.Response
2657----
2658 HTTP/1.1 200 OK
2659 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002660 Content-Type: application/json; charset=UTF-8
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002661
2662 )]}'
2663 [
2664 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002665 "account": {
2666 "_account_id": 1000097,
2667 "name": "Jane Roe",
2668 "email": "jane.roe@example.com"
Logan Hanksab3c81e2016-07-20 15:42:52 -07002669 },
2670 "count": 1
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002671 },
2672 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002673 "group": {
2674 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
2675 "name": "Joiner"
Logan Hanksab3c81e2016-07-20 15:42:52 -07002676 },
2677 "count": 5
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002678 }
2679 ]
2680----
2681
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002682[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002683=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002684--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002685'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 -08002686--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002687
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002688Retrieves a reviewer of a change.
2689
2690As response a link:#reviewer-info[ReviewerInfo] entity is returned that
2691describes the reviewer.
2692
2693.Request
2694----
2695 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
2696----
2697
2698.Response
2699----
2700 HTTP/1.1 200 OK
2701 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002702 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002703
2704 )]}'
2705 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002706 "approvals": {
2707 "Verified": "+1",
2708 "Code-Review": "+2"
2709 },
2710 "_account_id": 1000096,
2711 "name": "John Doe",
2712 "email": "john.doe@example.com"
2713 }
2714----
2715
Edwin Kempin392328e2013-02-25 12:50:03 +01002716[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002717=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002718--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002719'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002720--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002721
Edwin Kempin392328e2013-02-25 12:50:03 +01002722Adds one user or all members of one group as reviewer to the change.
2723
2724The reviewer to be added to the change must be provided in the request
2725body as a link:#reviewer-input[ReviewerInput] entity.
2726
2727.Request
2728----
2729 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002730 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002731
2732 {
2733 "reviewer": "john.doe@example.com"
2734 }
2735----
2736
2737As response an link:#add-reviewer-result[AddReviewerResult] entity is
2738returned that describes the newly added reviewers.
2739
2740.Response
2741----
2742 HTTP/1.1 200 OK
2743 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002744 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002745
2746 )]}'
2747 {
2748 "reviewers": [
2749 {
Logan Hanks23e70282016-07-06 14:31:56 -07002750 "input": "john.doe@example.com",
Edwin Kempin392328e2013-02-25 12:50:03 +01002751 "approvals": {
2752 "Verified": " 0",
2753 "Code-Review": " 0"
2754 },
2755 "_account_id": 1000096,
2756 "name": "John Doe",
2757 "email": "john.doe@example.com"
2758 }
2759 ]
2760 }
2761----
2762
2763If a group is specified, adding the group members as reviewers is an
2764atomic operation. This means if an error is returned, none of the
2765members are added as reviewer.
2766
2767If a group with many members is added as reviewer a confirmation may be
2768required.
2769
2770.Request
2771----
2772 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002773 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002774
2775 {
2776 "reviewer": "MyProjectVerifiers"
2777 }
2778----
2779
2780.Response
2781----
2782 HTTP/1.1 200 OK
2783 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002784 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002785
2786 )]}'
2787 {
Logan Hanks23e70282016-07-06 14:31:56 -07002788 "input": "MyProjectVerifiers",
Edwin Kempin392328e2013-02-25 12:50:03 +01002789 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
2790 "confirm": true
2791 }
2792----
2793
2794To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01002795`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01002796
2797.Request
2798----
2799 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002800 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002801
2802 {
Logan Hanks23e70282016-07-06 14:31:56 -07002803 "input": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01002804 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01002805 }
2806----
2807
Patrick Hiesel11873ef2017-03-17 17:36:05 +01002808If link:config-project-config.html#reviewer.enableByEmail[reviewer.enableByEmail] is set
2809for the project, reviewers and CCs are not required to have a Gerrit account. If you POST
2810an email address of a reviewer or CC then, they will be added to the change even if they
2811don't have a Gerrit account.
2812
2813If this option is disabled, the request would fail with `400 Bad Request` if the email
2814address can't be resolved to an active Gerrit account.
2815
2816Note that the name is optional so both "un.registered@reviewer.com" and
2817"John Doe <un.registered@reviewer.com>" are valid inputs.
2818
2819Reviewers without Gerrit accounts can only be added on changes visible to anonymous users.
2820
2821.Request
2822----
2823 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
2824 Content-Type: application/json; charset=UTF-8
2825
2826 {
2827 "reviewer": "John Doe <un.registered@reviewer.com>"
2828 }
2829----
2830
2831.Response
2832----
2833 HTTP/1.1 200 OK
2834 Content-Disposition: attachment
2835 Content-Type: application/json; charset=UTF-8
2836
2837 )]}'
2838 {
2839 "input": "John Doe <un.registered@reviewer.com>"
2840 }
2841----
2842
Edwin Kempin53301072013-02-25 12:57:07 +01002843[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002844=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002845--
Edwin Kempin407fca32016-08-29 12:01:00 +02002846'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' +
2847'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 -08002848--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002849
Edwin Kempin53301072013-02-25 12:57:07 +01002850Deletes a reviewer from a change.
2851
Edwin Kempin407fca32016-08-29 12:01:00 +02002852Options can be provided in the request body as a
2853link:#delete-reviewer-input[DeleteReviewerInput] entity.
2854
Edwin Kempin53301072013-02-25 12:57:07 +01002855.Request
2856----
2857 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
Edwin Kempin407fca32016-08-29 12:01:00 +02002858 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
2859----
2860
2861Please note that some proxies prohibit request bodies for DELETE
2862requests. In this case, if you want to specify options, use a POST
2863request:
2864
2865.Request
2866----
2867 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
2868 Content-Type: application/json; charset=UTF-8
2869
2870 {
2871 "notify": "NONE"
2872 }
Edwin Kempin53301072013-02-25 12:57:07 +01002873----
2874
2875.Response
2876----
2877 HTTP/1.1 204 No Content
2878----
2879
David Ostrovskybeb0b842014-12-13 00:24:29 +01002880[[list-votes]]
2881=== List Votes
2882--
2883'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
2884--
2885
2886Lists the votes for a specific reviewer of the change.
2887
2888.Request
2889----
Edwin Kempin314f10a2016-07-11 11:39:05 +02002890 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0
David Ostrovskybeb0b842014-12-13 00:24:29 +01002891----
2892
2893As result a map is returned that maps the label name to the label value.
2894The entries in the map are sorted by label name.
2895
2896.Response
2897----
2898 HTTP/1.1 200 OK
2899 Content-Disposition: attachment
2900 Content-Type: application/json;charset=UTF-8
2901
2902 )]}'
2903 {
2904 "Code-Review": -1,
2905 "Verified": 1
2906 "Work-In-Progress": 1,
2907 }
2908----
2909
2910[[delete-vote]]
2911=== Delete Vote
2912--
Edwin Kempin5488dc12016-08-29 11:13:31 +02002913'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 +02002914'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 +01002915--
2916
2917Deletes a single vote from a change. Note, that even when the last vote of
2918a reviewer is removed the reviewer itself is still listed on the change.
2919
Edwin Kempin1dfecb62016-06-16 10:45:00 +02002920Options can be provided in the request body as a
2921link:#delete-vote-input[DeleteVoteInput] entity.
2922
David Ostrovskybeb0b842014-12-13 00:24:29 +01002923.Request
2924----
2925 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
Edwin Kempin1dfecb62016-06-16 10:45:00 +02002926 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
2927----
2928
2929Please note that some proxies prohibit request bodies for DELETE
2930requests. In this case, if you want to specify options, use a POST
2931request:
2932
2933.Request
2934----
2935 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
2936 Content-Type: application/json; charset=UTF-8
2937
2938 {
2939 "notify": "NONE"
2940 }
David Ostrovskybeb0b842014-12-13 00:24:29 +01002941----
2942
2943.Response
2944----
2945 HTTP/1.1 204 No Content
2946----
2947
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002948[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002949== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002950
Shawn Pearce728ba882013-07-08 23:13:08 -07002951[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002952=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002953--
Shawn Pearce728ba882013-07-08 23:13:08 -07002954'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002955--
Shawn Pearce728ba882013-07-08 23:13:08 -07002956
2957Retrieves a parsed commit of a revision.
2958
2959.Request
2960----
2961 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
2962----
2963
2964As response a link:#commit-info[CommitInfo] entity is returned that
2965describes the revision.
2966
2967.Response
2968----
2969 HTTP/1.1 200 OK
2970 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002971 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07002972
2973 )]}'
2974 {
Edwin Kempinc8237402015-07-15 18:27:55 +02002975 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07002976 "parents": [
2977 {
2978 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
2979 "subject": "Migrate contributor agreements to All-Projects."
2980 }
2981 ],
2982 "author": {
2983 "name": "Shawn O. Pearce",
2984 "email": "sop@google.com",
2985 "date": "2012-04-24 18:08:08.000000000",
2986 "tz": -420
2987 },
2988 "committer": {
2989 "name": "Shawn O. Pearce",
2990 "email": "sop@google.com",
2991 "date": "2012-04-24 18:08:08.000000000",
2992 "tz": -420
2993 },
2994 "subject": "Use an EventBus to manage star icons",
2995 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2996 }
2997----
2998
Sven Selbergd26bd542014-11-21 16:28:10 +01002999Adding query parameter `links` (for example `/changes/.../commit?links`)
3000returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07003001
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08003002[[get-description]]
3003=== Get Description
3004--
3005'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3006--
3007
3008Retrieves the description of a patch set.
3009
3010.Request
3011----
3012 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3013----
3014
3015.Response
3016----
3017 HTTP/1.1 200 OK
3018 Content-Disposition: attachment
3019 Content-Type: application/json; charset=UTF-8
3020
3021 )]}'
3022 "Added Documentation"
3023----
3024
3025If the patch set does not have a description an empty string is returned.
3026
3027[[set-description]]
3028=== Set Description
3029--
3030'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
3031--
3032
3033Sets the description of a patch set.
3034
3035The new description must be provided in the request body inside a
3036link:#description-input[DescriptionInput] entity.
3037
3038.Request
3039----
3040 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
3041 Content-Type: application/json; charset=UTF-8
3042
3043 {
3044 "description": "Added Documentation"
3045 }
3046----
3047
3048As response the new description is returned.
3049
3050.Response
3051----
3052 HTTP/1.1 200 OK
3053 Content-Disposition: attachment
3054 Content-Type: application/json; charset=UTF-8
3055
3056 )]}'
3057 "Added Documentation"
3058----
3059
Edwin Kempin0f229442016-09-09 13:06:12 +02003060[[get-merge-list]]
3061=== Get Merge List
3062--
3063'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist'
3064--
3065
3066Returns the list of commits that are being integrated into a target
3067branch by a merge commit. By default the first parent is assumed to be
3068uninteresting. By using the `parent` option another parent can be set
3069as uninteresting (parents are 1-based).
3070
3071The list of commits is returned as a list of
3072link:#commit-info[CommitInfo] entities. Web links are only included if
3073the `links` option was set.
3074
3075.Request
3076----
3077 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0
3078----
3079
3080.Response
3081----
3082HTTP/1.1 200 OK
3083 Content-Disposition: attachment
3084 Content-Type: application/json; charset=UTF-8
3085
3086 )]}'
3087 [
3088 {
3089 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
3090 "parents": [
3091 {
3092 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
3093 "subject": "Migrate contributor agreements to All-Projects."
3094 }
3095 ],
3096 "author": {
3097 "name": "Shawn O. Pearce",
3098 "email": "sop@google.com",
3099 "date": "2012-04-24 18:08:08.000000000",
3100 "tz": -420
3101 },
3102 "committer": {
3103 "name": "Shawn O. Pearce",
3104 "email": "sop@google.com",
3105 "date": "2012-04-24 18:08:08.000000000",
3106 "tz": -420
3107 },
3108 "subject": "Use an EventBus to manage star icons",
3109 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
3110 }
3111 ]
3112----
3113
Stefan Bellerc7259662015-02-12 17:23:05 -08003114[[get-revision-actions]]
3115=== Get Revision Actions
3116--
3117'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
3118--
3119
3120Retrieves revision link:#action-info[actions] of the revision of a change.
3121
3122.Request
3123----
3124 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
3125----
3126
3127.Response
3128----
3129 HTTP/1.1 200 OK
3130 Content-Disposition: attachment
3131 Content-Type: application/json; charset=UTF-8
3132
3133 )]}'
3134
3135{
3136 "submit": {
3137 "method": "POST",
3138 "label": "Submit",
3139 "title": "Submit patch set 1 into master",
3140 "enabled": true
3141 },
3142 "cherrypick": {
3143 "method": "POST",
3144 "label": "Cherry Pick",
3145 "title": "Cherry pick change to a different branch",
3146 "enabled": true
3147 }
3148}
3149----
3150
3151The response is a flat map of possible revision actions mapped to their
3152link:#action-info[ActionInfo].
3153
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003154[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003155=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003156--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003157'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003158--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003159
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003160Retrieves a review of a revision.
3161
3162.Request
3163----
3164 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3165----
3166
3167As response a link:#change-info[ChangeInfo] entity with
3168link:#detailed-labels[detailed labels] and link:#detailed-accounts[
3169detailed accounts] is returned that describes the review of the
3170revision. The revision for which the review is retrieved is contained
3171in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05003172set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003173revision of the change. Please note that the returned labels are always
3174for the current patch set.
3175
3176.Response
3177----
3178 HTTP/1.1 200 OK
3179 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003180 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003181
3182 )]}'
3183 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003184 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
3185 "project": "myProject",
3186 "branch": "master",
3187 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
3188 "subject": "Implementing Feature X",
3189 "status": "NEW",
3190 "created": "2013-02-01 09:59:32.126000000",
3191 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003192 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003193 "insertions": 34,
3194 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003195 "_number": 3965,
3196 "owner": {
3197 "_account_id": 1000096,
3198 "name": "John Doe",
3199 "email": "john.doe@example.com"
3200 },
3201 "labels": {
3202 "Verified": {
3203 "all": [
3204 {
3205 "value": 0,
3206 "_account_id": 1000096,
3207 "name": "John Doe",
3208 "email": "john.doe@example.com"
3209 },
3210 {
3211 "value": 0,
3212 "_account_id": 1000097,
3213 "name": "Jane Roe",
3214 "email": "jane.roe@example.com"
3215 }
3216 ],
3217 "values": {
3218 "-1": "Fails",
3219 " 0": "No score",
3220 "+1": "Verified"
3221 }
3222 },
3223 "Code-Review": {
3224 "all": [
3225 {
3226 "value": -1,
3227 "_account_id": 1000096,
3228 "name": "John Doe",
3229 "email": "john.doe@example.com"
3230 },
3231 {
3232 "value": 1,
3233 "_account_id": 1000097,
3234 "name": "Jane Roe",
3235 "email": "jane.roe@example.com"
3236 }
3237 ]
3238 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +04003239 "-2": "This shall not be merged",
3240 "-1": "I would prefer this is not merged as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003241 " 0": "No score",
3242 "+1": "Looks good to me, but someone else must approve",
3243 "+2": "Looks good to me, approved"
3244 }
3245 }
3246 },
3247 "permitted_labels": {
3248 "Verified": [
3249 "-1",
3250 " 0",
3251 "+1"
3252 ],
3253 "Code-Review": [
3254 "-2",
3255 "-1",
3256 " 0",
3257 "+1",
3258 "+2"
3259 ]
3260 },
3261 "removable_reviewers": [
3262 {
3263 "_account_id": 1000096,
3264 "name": "John Doe",
3265 "email": "john.doe@example.com"
3266 },
3267 {
3268 "_account_id": 1000097,
3269 "name": "Jane Roe",
3270 "email": "jane.roe@example.com"
3271 }
3272 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08003273 "reviewers": {
3274 "REVIEWER": [
3275 {
3276 "_account_id": 1000096,
3277 "name": "John Doe",
3278 "email": "john.doe@example.com"
3279 },
3280 {
3281 "_account_id": 1000097,
3282 "name": "Jane Roe",
3283 "email": "jane.roe@example.com"
3284 }
3285 ]
3286 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003287 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
3288 "revisions": {
3289 "674ac754f91e64a0efb8087e59a176484bd534d1": {
David Pursehouse4de41112016-06-28 09:24:08 +09003290 "kind": "REWORK",
3291 "_number": 2,
3292 "ref": "refs/changes/65/3965/2",
3293 "fetch": {
3294 "http": {
3295 "url": "http://gerrit/myProject",
3296 "ref": "refs/changes/65/3965/2"
3297 }
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003298 }
3299 }
3300 }
3301 }
3302----
3303
David Pursehouse669f2512014-07-18 11:41:42 +09003304[[get-related-changes]]
3305=== Get Related Changes
3306--
3307'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
3308--
3309
3310Retrieves related changes of a revision. Related changes are changes that either
3311depend on, or are dependencies of the revision.
3312
3313.Request
3314----
3315 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
3316----
3317
3318As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
3319describing the related changes.
3320
3321.Response
3322----
3323 HTTP/1.1 200 OK
3324 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003325 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09003326
3327 )]}'
3328 {
3329 "changes": [
3330 {
3331 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
3332 "commit": {
3333 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
3334 "parents": [
3335 {
3336 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
3337 }
3338 ],
3339 "author": {
3340 "name": "David Ostrovsky",
3341 "email": "david@ostrovsky.org",
3342 "date": "2014-07-12 15:04:24.000000000",
3343 "tz": 120
3344 },
3345 "subject": "Remove Solr"
3346 },
3347 "_change_number": 58478,
3348 "_revision_number": 2,
3349 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003350 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003351 },
3352 {
3353 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
3354 "commit": {
3355 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
3356 "parents": [
3357 {
3358 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
3359 }
3360 ],
3361 "author": {
3362 "name": "David Pursehouse",
3363 "email": "david.pursehouse@sonymobile.com",
3364 "date": "2014-06-24 02:01:28.000000000",
3365 "tz": 540
3366 },
3367 "subject": "Add support for secondary index with Elasticsearch"
3368 },
3369 "_change_number": 58081,
3370 "_revision_number": 10,
3371 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003372 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003373 }
3374 ]
3375 }
3376----
3377
3378
Edwin Kempin67498de2013-02-25 16:15:34 +01003379[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003380=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003381--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003382'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003383--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003384
Edwin Kempin67498de2013-02-25 16:15:34 +01003385Sets a review on a revision.
3386
3387The review must be provided in the request body as a
3388link:#review-input[ReviewInput] entity.
3389
3390.Request
3391----
3392 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003393 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003394
3395 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01003396 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01003397 "message": "Some nits need to be fixed.",
3398 "labels": {
3399 "Code-Review": -1
3400 },
3401 "comments": {
3402 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3403 {
3404 "line": 23,
3405 "message": "[nit] trailing whitespace"
3406 },
3407 {
3408 "line": 49,
3409 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09003410 },
3411 {
3412 "range": {
3413 "start_line": 50,
3414 "start_character": 0,
3415 "end_line": 55,
3416 "end_character": 20
3417 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09003418 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01003419 }
3420 ]
3421 }
3422 }
3423----
3424
3425As response a link:#review-info[ReviewInfo] entity is returned that
3426describes the applied labels.
3427
3428.Response
3429----
3430 HTTP/1.1 200 OK
3431 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003432 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003433
3434 )]}'
3435 {
3436 "labels": {
3437 "Code-Review": -1
3438 }
3439 }
3440----
3441
Edwin Kempind0febd32015-01-07 10:27:31 +01003442A review cannot be set on a change edit. Trying to post a review for a
3443change edit fails with `409 Conflict`.
3444
Logan Hanks5f1c7592016-07-06 14:39:33 -07003445It is also possible to add one or more reviewers to a change simultaneously
3446with a review.
3447
3448.Request
3449----
3450 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3451 Content-Type: application/json; charset=UTF-8
3452
3453 {
3454 "message": "Looks good to me, but Jane and John should also take a look.",
3455 "labels": {
3456 "Code-Review": 1
3457 },
3458 "reviewers": [
3459 {
3460 "reviewer": "jane.roe@example.com"
3461 },
3462 {
3463 "reviewer": "john.doe@example.com"
3464 }
3465 ]
3466 }
3467----
3468
3469Each element of the `reviewers` list is an instance of
3470link:#reviewer-input[ReviewerInput]. The corresponding result of
3471adding each reviewer will be returned in a list of
Logan Hankse2aacef2016-07-22 15:54:52 -07003472link:#add-reviewer-result[AddReviewerResult].
Logan Hanks5f1c7592016-07-06 14:39:33 -07003473
3474.Response
3475----
3476 HTTP/1.1 200 OK
3477 Content-Disposition: attachment
3478 Content-Type: application/json; charset=UTF-8
3479
3480 )]}'
3481 {
3482 "labels": {
3483 "Code-Review": 1
3484 },
3485 "reviewers": [
3486 {
3487 "input": "jane.roe@example.com",
3488 "approvals": {
3489 "Verified": " 0",
3490 "Code-Review": " 0"
3491 },
3492 "_account_id": 1000097,
3493 "name": "Jane Roe",
3494 "email": "jane.roe@example.com"
3495 },
3496 {
3497 "input": "john.doe@example.com",
3498 "approvals": {
3499 "Verified": " 0",
3500 "Code-Review": " 0"
3501 },
3502 "_account_id": 1000096,
3503 "name": "John Doe",
3504 "email": "john.doe@example.com"
3505 }
3506 ]
3507 }
3508----
3509
Logan Hankse2aacef2016-07-22 15:54:52 -07003510If there are any errors returned for reviewers, the entire review request will
3511be rejected with `400 Bad Request`.
3512
3513.Error Response
3514----
3515 HTTP/1.1 400 Bad Request
3516 Content-Disposition: attachment
3517 Content-Type: application/json; charset=UTF-8
3518
3519 )]}'
3520 {
3521 "reviewers": {
3522 "MyProjectVerifiers": {
3523 "input": "MyProjectVerifiers",
3524 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
3525 "confirm": true
3526 }
3527 }
3528 }
3529----
3530
Edwin Kempincdae63b2013-03-15 15:06:59 +01003531[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003532=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003533--
Edwin Kempincdae63b2013-03-15 15:06:59 +01003534'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003535--
Edwin Kempincdae63b2013-03-15 15:06:59 +01003536
3537Rebases a revision.
3538
Zalan Blenessy874aed72015-01-12 13:26:18 +01003539Optionally, the parent revision can be changed to another patch set through the
3540link:#rebase-input[RebaseInput] entity.
3541
Edwin Kempincdae63b2013-03-15 15:06:59 +01003542.Request
3543----
3544 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01003545 Content-Type: application/json;charset=UTF-8
3546
3547 {
3548 "base" : "1234",
3549 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01003550----
3551
3552As response a link:#change-info[ChangeInfo] entity is returned that
3553describes the rebased change. Information about the current patch set
3554is included.
3555
3556.Response
3557----
3558 HTTP/1.1 200 OK
3559 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003560 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01003561
3562 )]}'
3563 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01003564 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
3565 "project": "myProject",
3566 "branch": "master",
3567 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
3568 "subject": "Implement Feature X",
3569 "status": "NEW",
3570 "created": "2013-02-01 09:59:32.126000000",
3571 "updated": "2013-02-21 11:16:36.775000000",
3572 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003573 "insertions": 21,
3574 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01003575 "_number": 4799,
3576 "owner": {
3577 "name": "John Doe"
3578 },
3579 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
3580 "revisions": {
3581 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09003582 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01003583 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01003584 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01003585 "fetch": {
3586 "http": {
3587 "url": "http://gerrit:8080/myProject",
3588 "ref": "refs/changes/99/4799/2"
3589 }
3590 },
3591 "commit": {
3592 "parents": [
3593 {
3594 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
3595 "subject": "Implement Feature A"
3596 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00003597 ],
3598 "author": {
3599 "name": "John Doe",
3600 "email": "john.doe@example.com",
3601 "date": "2013-05-07 15:21:27.000000000",
3602 "tz": 120
3603 },
3604 "committer": {
3605 "name": "Gerrit Code Review",
3606 "email": "gerrit-server@example.com",
3607 "date": "2013-05-07 15:35:43.000000000",
3608 "tz": 120
3609 },
3610 "subject": "Implement Feature X",
3611 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01003612 }
3613 }
3614 }
3615----
3616
3617If the revision cannot be rebased, e.g. due to conflicts, the response is
3618"`409 Conflict`" and the error message is contained in the response
3619body.
3620
3621.Response
3622----
3623 HTTP/1.1 409 Conflict
3624 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003625 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01003626
3627 The change could not be rebased due to a path conflict during merge.
3628----
3629
Edwin Kempin14b58112013-02-26 16:30:19 +01003630[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003631=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003632--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003633'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003634--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003635
Edwin Kempin14b58112013-02-26 16:30:19 +01003636Submits a revision.
3637
Edwin Kempin14b58112013-02-26 16:30:19 +01003638.Request
3639----
3640 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003641 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003642----
3643
3644As response a link:#submit-info[SubmitInfo] entity is returned that
3645describes the status of the submitted change.
3646
3647.Response
3648----
3649 HTTP/1.1 200 OK
3650 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003651 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003652
3653 )]}'
3654 {
3655 "status": "MERGED"
3656 }
3657----
3658
3659If the revision cannot be submitted, e.g. because the submit rule
3660doesn't allow submitting the revision or the revision is not the
3661current revision, the response is "`409 Conflict`" and the error
3662message is contained in the response body.
3663
3664.Response
3665----
3666 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003667 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003668
3669 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
3670----
3671
David Ostrovsky0d69c232013-09-10 23:10:23 +02003672[[publish-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003673=== Publish Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003674--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003675'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003676--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003677
3678Publishes a draft revision.
3679
3680.Request
3681----
3682 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/publish HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003683 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02003684----
3685
3686.Response
3687----
3688 HTTP/1.1 204 No Content
3689----
3690
3691[[delete-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003692=== Delete Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003693--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003694'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003695--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003696
3697Deletes a draft revision.
3698
3699.Request
3700----
3701 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003702 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02003703----
3704
3705.Response
3706----
3707 HTTP/1.1 204 No Content
3708----
3709
Edwin Kempin257d70f2013-03-28 14:31:14 +01003710[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003711=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003712--
Edwin Kempin257d70f2013-03-28 14:31:14 +01003713'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003714--
Edwin Kempin257d70f2013-03-28 14:31:14 +01003715
3716Gets the formatted patch for one revision.
3717
3718.Request
3719----
3720 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
3721----
3722
Shawn Pearce98361f72013-05-10 16:27:36 -07003723The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01003724
3725.Response
3726----
3727 HTTP/1.1 200 OK
3728 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003729 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07003730 X-FYI-Content-Encoding: base64
3731 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01003732
Shawn Pearce98361f72013-05-10 16:27:36 -07003733 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01003734----
3735
David Ostrovsky973f38b2013-08-22 00:24:51 -07003736Adding query parameter `zip` (for example `/changes/.../patch?zip`)
3737returns the patch as a single file inside of a ZIP archive. Clients
3738can expand the ZIP to obtain the plain text patch, avoiding the
3739need for a base64 decoding step. This option implies `download`.
3740
3741Query parameter `download` (e.g. `/changes/.../patch?download`)
3742will suggest the browser save the patch as `commitsha1.diff.base64`,
3743for later processing by command line tools.
3744
Kasper Nilsson81448072016-10-17 15:04:33 -07003745If the `path` parameter is set, the returned content is a diff of the single
3746file that the path refers to.
3747
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07003748[[submit-preview]]
Edwin Kempin807eb4b2016-10-18 15:49:41 +02003749=== Submit Preview
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07003750--
3751'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/preview_submit'
3752--
3753Gets a file containing thin bundles of all modified projects if this
3754change was submitted. The bundles are named `${ProjectName}.git`.
3755Each thin bundle contains enough to construct the state in which a project would
3756be in if this change were submitted. The base of the thin bundles are the
3757current target branches, so to make use of this call in a non-racy way, first
3758get the bundles and then fetch all projects contained in the bundle.
3759(This assumes no non-fastforward pushes).
3760
3761You need to give a parameter '?format=zip' or '?format=tar' to specify the
Stefan Beller3e586742016-10-05 15:23:22 -07003762format for the outer container. It is always possible to use tgz, even if
3763tgz is not in the list of allowed archive formats.
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07003764
3765To make good use of this call, you would roughly need code as found at:
3766----
3767 $ curl -Lo preview_submit_test.sh http://review.example.com:8080/tools/scripts/preview_submit_test.sh
3768----
3769.Request
3770----
3771 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/preview_submit?zip HTTP/1.0
3772----
3773
3774.Response
3775----
3776 HTTP/1.1 200 OK
3777 Date: Tue, 13 Sep 2016 19:13:46 GMT
3778 Content-Disposition: attachment; filename="submit-preview-147.zip"
3779 X-Content-Type-Options: nosniff
3780 Cache-Control: no-cache, no-store, max-age=0, must-revalidate
3781 Pragma: no-cache
3782 Expires: Mon, 01 Jan 1990 00:00:00 GMT
3783 Content-Type: application/x-zip
3784 Transfer-Encoding: chunked
3785
3786 [binary stuff]
3787----
3788
3789In case of an error, the response is not a zip file but a regular json response,
3790containing only the error message:
3791
3792.Response
3793----
3794 HTTP/1.1 200 OK
3795 Content-Disposition: attachment
3796 Content-Type: application/json; charset=UTF-8
3797
3798 )]}'
3799 "Anonymous users cannot submit"
3800----
3801
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003802[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003803=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003804--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003805'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003806--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003807
3808Gets the method the server will use to submit (merge) the change and
3809an indicator if the change is currently mergeable.
3810
3811.Request
3812----
3813 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
3814----
3815
Saša Živkov499873f2014-05-05 13:34:18 +02003816As response a link:#mergeable-info[MergeableInfo] entity is returned.
3817
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003818.Response
3819----
3820 HTTP/1.1 200 OK
3821 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003822 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003823
3824 )]}'
3825 {
3826 submit_type: "MERGE_IF_NECESSARY",
Zhen Chenf7d85ea2016-05-02 15:14:43 -07003827 strategy: "recursive",
3828 mergeable: true
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003829 }
3830----
3831
Saša Živkov697cab22014-04-29 16:46:50 +02003832If the `other-branches` parameter is specified, the mergeability will also be
Zhen Chen6729b632016-11-11 17:32:32 -08003833checked for all other branches which are listed in the
3834link:config-project-config.html#branchOrder-section[branchOrder] section in the
3835project.config file.
Saša Živkov697cab22014-04-29 16:46:50 +02003836
3837.Request
3838----
3839 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
3840----
3841
3842The response will then contain a list of all other branches where this changes
3843could merge cleanly.
3844
3845.Response
3846----
3847 HTTP/1.1 200 OK
3848 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003849 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02003850
3851 )]}'
3852 {
3853 submit_type: "MERGE_IF_NECESSARY",
3854 mergeable: true,
3855 mergeable_into: [
3856 "refs/heads/stable-2.7",
3857 "refs/heads/stable-2.8",
3858 ]
3859 }
3860----
3861
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003862[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003863=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003864--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003865'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003866--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003867
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003868Gets the method the server will use to submit (merge) the change.
3869
3870.Request
3871----
3872 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
3873----
3874
3875.Response
3876----
3877 HTTP/1.1 200 OK
3878 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003879 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003880
3881 )]}'
3882 "MERGE_IF_NECESSARY"
3883----
3884
3885[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003886=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003887--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003888'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003889--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003890
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003891Tests the submit_type Prolog rule in the project, or the one given.
3892
3893Request body may be either the Prolog code as `text/plain` or a
3894link:#rule-input[RuleInput] object. The query parameter `filters`
3895may be set to `SKIP` to bypass parent project filters while testing
3896a project-specific rule.
3897
3898.Request
3899----
3900 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003901 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003902
3903 submit_type(cherry_pick).
3904----
3905
3906.Response
3907----
3908 HTTP/1.1 200 OK
3909 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003910 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003911
3912 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07003913 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003914----
3915
3916[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003917=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003918--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003919'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003920--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003921
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003922Tests the submit_rule Prolog rule in the project, or the one given.
3923
3924Request body may be either the Prolog code as `text/plain` or a
3925link:#rule-input[RuleInput] object. The query parameter `filters`
3926may be set to `SKIP` to bypass parent project filters while testing
3927a project-specific rule.
3928
3929.Request
3930----
Shawn Pearcea3cce712014-03-21 08:16:11 -07003931 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003932 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003933
3934 submit_rule(submit(R)) :-
3935 R = label('Any-Label-Name', reject(_)).
3936----
3937
3938The response is a list of link:#submit-record[SubmitRecord] entries
3939describing the permutations that satisfy the tested submit rule.
3940
3941.Response
3942----
3943 HTTP/1.1 200 OK
3944 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003945 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003946
3947 )]}'
3948 [
3949 {
3950 "status": "NOT_READY",
3951 "reject": {
3952 "Any-Label-Name": {}
3953 }
3954 }
3955 ]
3956----
3957
Shawn Pearceb42e3032015-04-02 10:28:10 -07003958When testing with the `curl` command line client the
3959`--data-binary @rules.pl` flag should be used to ensure
3960all LFs are included in the Prolog code:
3961
3962----
3963 curl -X POST \
3964 -H 'Content-Type: text/plain; charset=UTF-8' \
3965 --data-binary @rules.pl \
3966 http://.../test.submit_rule
3967----
3968
Edwin Kempincb6724a2013-02-26 16:58:51 +01003969[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07003970=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003971--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003972'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003973--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003974
Edwin Kempin3ca57192013-02-27 07:44:01 +01003975Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01003976user.
3977
Dave Borowitz23fec2b2015-04-28 17:40:07 -07003978Returns a map of file paths to lists of link:#comment-info[CommentInfo]
3979entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01003980
3981.Request
3982----
3983 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
3984----
3985
3986.Response
3987----
3988 HTTP/1.1 200 OK
3989 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003990 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01003991
3992 )]}'
3993 {
3994 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3995 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01003996 "id": "TvcXrmjM",
3997 "line": 23,
3998 "message": "[nit] trailing whitespace",
3999 "updated": "2013-02-26 15:40:43.986000000"
4000 },
4001 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01004002 "id": "TveXwFiA",
4003 "line": 49,
4004 "in_reply_to": "TfYX-Iuo",
4005 "message": "Done",
4006 "updated": "2013-02-26 15:40:45.328000000"
4007 }
4008 ]
4009 }
4010----
4011
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004012[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004013=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004014--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004015'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004016--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004017
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004018Creates a draft comment on a revision.
4019
4020The new draft comment must be provided in the request body inside a
4021link:#comment-input[CommentInput] entity.
4022
4023.Request
4024----
4025 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004026 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004027
4028 {
4029 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4030 "line": 23,
4031 "message": "[nit] trailing whitespace"
4032 }
4033----
4034
4035As response a link:#comment-info[CommentInfo] entity is returned that
4036describes the draft comment.
4037
4038.Response
4039----
4040 HTTP/1.1 200 OK
4041 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004042 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004043
4044 )]}'
4045 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004046 "id": "TvcXrmjM",
4047 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4048 "line": 23,
4049 "message": "[nit] trailing whitespace",
4050 "updated": "2013-02-26 15:40:43.986000000"
4051 }
4052----
4053
Edwin Kempin3ca57192013-02-27 07:44:01 +01004054[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004055=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004056--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004057'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 -08004058--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004059
Edwin Kempin3ca57192013-02-27 07:44:01 +01004060Retrieves a draft comment of a revision that belongs to the calling
4061user.
4062
4063.Request
4064----
4065 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4066----
4067
4068As response a link:#comment-info[CommentInfo] entity is returned that
4069describes the draft comment.
4070
4071.Response
4072----
4073 HTTP/1.1 200 OK
4074 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004075 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01004076
4077 )]}'
4078 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01004079 "id": "TvcXrmjM",
4080 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4081 "line": 23,
4082 "message": "[nit] trailing whitespace",
4083 "updated": "2013-02-26 15:40:43.986000000"
4084 }
4085----
4086
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004087[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004088=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004089--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004090'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 -08004091--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004092
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004093Updates a draft comment on a revision.
4094
4095The new draft comment must be provided in the request body inside a
4096link:#comment-input[CommentInput] entity.
4097
4098.Request
4099----
4100 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004101 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004102
4103 {
4104 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4105 "line": 23,
4106 "message": "[nit] trailing whitespace"
4107 }
4108----
4109
4110As response a link:#comment-info[CommentInfo] entity is returned that
4111describes the draft comment.
4112
4113.Response
4114----
4115 HTTP/1.1 200 OK
4116 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004117 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004118
4119 )]}'
4120 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004121 "id": "TvcXrmjM",
4122 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4123 "line": 23,
4124 "message": "[nit] trailing whitespace",
4125 "updated": "2013-02-26 15:40:43.986000000"
4126 }
4127----
4128
4129[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004130=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004131--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004132'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 -08004133--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004134
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004135Deletes a draft comment from a revision.
4136
4137.Request
4138----
4139 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
4140----
4141
4142.Response
4143----
4144 HTTP/1.1 204 No Content
4145----
4146
John Spurlock5e402f02013-03-24 11:35:04 -04004147[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004148=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004149--
John Spurlock5e402f02013-03-24 11:35:04 -04004150'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004151--
John Spurlock5e402f02013-03-24 11:35:04 -04004152
4153Lists the published comments of a revision.
4154
4155As result a map is returned that maps the file path to a list of
4156link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07004157sorted by file path and only include file (or inline) comments. Use
4158the link:#get-change-detail[Get Change Detail] endpoint to retrieve
4159the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04004160
4161.Request
4162----
4163 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
4164----
4165
4166.Response
4167----
4168 HTTP/1.1 200 OK
4169 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004170 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004171
4172 )]}'
4173 {
4174 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4175 {
John Spurlock5e402f02013-03-24 11:35:04 -04004176 "id": "TvcXrmjM",
4177 "line": 23,
4178 "message": "[nit] trailing whitespace",
4179 "updated": "2013-02-26 15:40:43.986000000",
4180 "author": {
4181 "_account_id": 1000096,
4182 "name": "John Doe",
4183 "email": "john.doe@example.com"
4184 }
4185 },
4186 {
John Spurlock5e402f02013-03-24 11:35:04 -04004187 "id": "TveXwFiA",
4188 "line": 49,
4189 "in_reply_to": "TfYX-Iuo",
4190 "message": "Done",
4191 "updated": "2013-02-26 15:40:45.328000000",
4192 "author": {
4193 "_account_id": 1000097,
4194 "name": "Jane Roe",
4195 "email": "jane.roe@example.com"
4196 }
4197 }
4198 ]
4199 }
4200----
4201
4202[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004203=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004204--
John Spurlock5e402f02013-03-24 11:35:04 -04004205'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 -08004206--
John Spurlock5e402f02013-03-24 11:35:04 -04004207
4208Retrieves a published comment of a revision.
4209
4210.Request
4211----
4212 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
4213----
4214
4215As response a link:#comment-info[CommentInfo] entity is returned that
4216describes the published comment.
4217
4218.Response
4219----
4220 HTTP/1.1 200 OK
4221 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004222 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004223
4224 )]}'
4225 {
John Spurlock5e402f02013-03-24 11:35:04 -04004226 "id": "TvcXrmjM",
4227 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4228 "line": 23,
4229 "message": "[nit] trailing whitespace",
4230 "updated": "2013-02-26 15:40:43.986000000",
4231 "author": {
4232 "_account_id": 1000096,
4233 "name": "John Doe",
4234 "email": "john.doe@example.com"
4235 }
4236 }
4237----
4238
Edwin Kempinb050a482016-12-01 09:11:19 +01004239[[list-robot-comments]]
Edwin Kempin3fde7e42016-09-19 15:35:10 +02004240=== List Robot Comments
4241--
4242'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/'
4243--
4244
4245Lists the link:config-robot-comments.html[robot comments] of a
4246revision.
4247
4248As result a map is returned that maps the file path to a list of
4249link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
4250map are sorted by file path.
4251
4252.Request
4253----
4254 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0
4255----
4256
4257.Response
4258----
4259 HTTP/1.1 200 OK
4260 Content-Disposition: attachment
4261 Content-Type: application/json; charset=UTF-8
4262
4263 )]}'
4264 {
4265 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4266 {
4267 "id": "TvcXrmjM",
4268 "line": 23,
4269 "message": "unused import",
4270 "updated": "2016-02-26 15:40:43.986000000",
4271 "author": {
4272 "_account_id": 1000110,
4273 "name": "Code Analyzer",
4274 "email": "code.analyzer@example.com"
4275 },
4276 "robotId": "importChecker",
4277 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
4278 },
4279 {
4280 "id": "TveXwFiA",
4281 "line": 49,
4282 "message": "wrong indention",
4283 "updated": "2016-02-26 15:40:45.328000000",
4284 "author": {
4285 "_account_id": 1000110,
4286 "name": "Code Analyzer",
4287 "email": "code.analyzer@example.com"
4288 },
4289 "robotId": "styleChecker",
4290 "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b"
4291 }
4292 ]
4293 }
4294----
4295
4296[[get-robot-comment]]
4297=== Get Robot Comment
4298--
4299'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]'
4300--
4301
4302Retrieves a link:config-robot-comments.html[robot comment] of a
4303revision.
4304
4305.Request
4306----
4307 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0
4308----
4309
4310As response a link:#robot-comment-info[RobotCommentInfo] entity is
4311returned that describes the robot comment.
4312
4313.Response
4314----
4315 HTTP/1.1 200 OK
4316 Content-Disposition: attachment
4317 Content-Type: application/json; charset=UTF-8
4318
4319 )]}'
4320 {
4321 "id": "TvcXrmjM",
4322 "line": 23,
4323 "message": "unused import",
4324 "updated": "2016-02-26 15:40:43.986000000",
4325 "author": {
4326 "_account_id": 1000110,
4327 "name": "Code Analyzer",
4328 "email": "code.analyzer@example.com"
4329 },
4330 "robotId": "importChecker",
4331 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
4332 }
4333----
4334
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01004335[[apply-fix]]
4336=== Apply Fix
4337--
4338'POST /changes/<<change-id,\{change-id\}>>/revisions/<<revision-id,\{revision-id\}>>/fixes/<<fix-id,\{fix-id\}>>/apply'
4339--
4340
4341Applies a suggested fix by creating a change edit which includes the
4342modifications indicated by the fix suggestion. If a change edit already exists,
4343it will be updated accordingly. A fix can only be applied if no change edit
4344exists and the fix refers to the current patch set, or the fix refers to the
4345patch set on which the change edit is based.
4346
4347.Request
4348----
4349 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/fixes/8f605a55_f6aa4ecc/apply HTTP/1.0
4350----
4351
4352If the fix was successfully applied, an <<edit-info,EditInfo>> describing the
4353resulting change edit is returned.
4354
4355.Response
4356----
4357 HTTP/1.1 200 OK
4358 Content-Disposition: attachment
4359 Content-Type: application/json; charset=UTF-8
4360
4361 )]}'
4362 {
4363 "commit":{
4364 "parents":[
4365 {
4366 "commit":"1eee2c9d8f352483781e772f35dc586a69ff5646",
4367 }
4368 ],
4369 "author":{
4370 "name":"John Doe",
4371 "email":"john.doe@example.com",
4372 "date":"2013-05-07 15:21:27.000000000",
4373 "tz":120
4374 },
4375 "committer":{
4376 "name":"Jane Doe",
4377 "email":"jane.doe@example.com",
4378 "date":"2013-05-07 15:35:43.000000000",
4379 "tz":120
4380 },
4381 "subject":"Implement feature X",
4382 "message":"Implement feature X\n\nWith this feature ..."
4383 },
4384 "base_revision":"674ac754f91e64a0efb8087e59a176484bd534d1"
4385 }
4386----
4387
4388If the application failed e.g. due to conflicts with an existing change edit,
4389the response "`409 Conflict`" including an error message in the response body
4390is returned.
4391
4392.Response
4393----
4394 HTTP/1.1 409 Conflict
4395 Content-Disposition: attachment
4396 Content-Type: text/plain; charset=UTF-8
4397
4398 The existing change edit could not be merged with another tree.
4399----
4400
Edwin Kempin682ac712013-05-14 13:40:46 +02004401[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004402=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004403--
Edwin Kempin682ac712013-05-14 13:40:46 +02004404'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004405--
Edwin Kempin682ac712013-05-14 13:40:46 +02004406
4407Lists the files that were modified, added or deleted in a revision.
4408
4409.Request
4410----
4411 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
4412----
4413
David Pursehouse11badbb2017-03-27 10:58:05 +09004414As result a map is returned that maps the link:#file-id[file path] to a list of
Edwin Kempin682ac712013-05-14 13:40:46 +02004415link:#file-info[FileInfo] entries. The entries in the map are
4416sorted by file path.
4417
4418.Response
4419----
4420 HTTP/1.1 200 OK
4421 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004422 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02004423
4424 )]}'
4425 {
4426 "/COMMIT_MSG": {
4427 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02004428 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01004429 "size_delta": 551,
4430 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02004431 },
4432 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
4433 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02004434 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01004435 "size_delta": 98,
4436 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02004437 }
4438 }
4439----
4440
Shawn Pearce984747d2013-07-18 00:42:16 -07004441The request parameter `reviewed` changes the response to return a list
4442of the paths the caller has marked as reviewed. Clients that also
4443need the FileInfo should make two requests.
4444
Shawn Pearce8ca03a62015-01-02 22:03:20 -08004445The request parameter `q` changes the response to return a list
4446of all files (modified or unmodified) that contain that substring
4447in the path name. This is useful to implement suggestion services
4448finding a file by partial name.
4449
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01004450The integer-valued request parameter `parent` changes the response to return a
4451list of the files which are different in this commit compared to the given
4452parent commit. This is useful for supporting review of merge commits. The value
4453is the 1-based index of the parent's position in the commit object.
4454
Shawn Pearce984747d2013-07-18 00:42:16 -07004455.Request
4456----
4457 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
4458----
4459
4460.Response
4461----
4462 HTTP/1.1 200 OK
4463 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004464 Content-Type: application/json; charset=UTF-8
Shawn Pearce984747d2013-07-18 00:42:16 -07004465
4466 )]}'
4467 [
4468 "/COMMIT_MSG",
4469 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4470 ]
4471----
4472
Edwin Kempinaef44b02013-05-07 16:15:55 +02004473[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004474=== Get Content
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004475--
Edwin Kempinbea55a52013-05-14 13:53:39 +02004476'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 -08004477--
Edwin Kempinaef44b02013-05-07 16:15:55 +02004478
4479Gets the content of a file from a certain revision.
4480
4481.Request
4482----
4483 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
4484----
4485
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05004486The content is returned as base64 encoded string. The HTTP response
4487Content-Type is always `text/plain`, reflecting the base64 wrapping.
4488A Gerrit-specific `X-FYI-Content-Type` header is returned describing
4489the server detected content type of the file.
4490
4491If only the content type is required, callers should use HEAD to
4492avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02004493
4494.Response
4495----
4496 HTTP/1.1 200 OK
4497 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05004498 Content-Type: text/plain; charset=ISO-8859-1
4499 X-FYI-Content-Encoding: base64
4500 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02004501
4502 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
4503----
4504
David Ostrovskyd0078672015-02-06 21:51:04 +01004505Alternatively, if the only value of the Accept request header is
4506`application/json` the content is returned as JSON string and
4507`X-FYI-Content-Encoding` is set to `json`.
4508
David Pletcherd1efb452015-09-01 17:45:55 -07004509[[get-safe-content]]
4510=== Download Content
4511--
4512'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
4513--
4514
4515Downloads the content of a file from a certain revision, in a safe format
4516that poses no risk for inadvertent execution of untrusted code.
4517
4518If the content type is defined as safe, the binary file content is returned
4519verbatim. If the content type is not safe, the file is stored inside a ZIP
4520file, containing a single entry with a random, unpredictable name having the
4521same base and suffix as the true filename. The ZIP file is returned in
4522verbatim binary form.
4523
4524See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
4525for information about safe file type configuration.
4526
4527The HTTP resource Content-Type is dependent on the file type: the
4528applicable type for safe files, or "application/zip" for unsafe files.
4529
David Pletcherec622bf2015-09-18 14:30:05 -07004530The optional, integer-valued `parent` parameter can be specified to request
4531the named file from a parent commit of the specified revision. The value is
4532the 1-based index of the parent's position in the commit object. If the
4533parameter is omitted or the value non-positive, the patch set is referenced.
4534
4535Filenames are decorated with a suffix of `_new` for the current patch,
4536`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07004537
4538.Request
4539----
David Pursehouse6147f6d2016-10-18 05:40:44 +00004540 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/download HTTP/1.0
David Pletcherd1efb452015-09-01 17:45:55 -07004541----
4542
4543.Response
4544----
4545 HTTP/1.1 200 OK
4546 Content-Disposition: attachment; filename="logo.png"
4547 Content-Type: image/png
4548
4549 `[binary data for logo.png]`
4550----
4551
4552.Request
4553----
David Pursehouse6147f6d2016-10-18 05:40:44 +00004554 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 -07004555----
4556
4557.Response
4558----
4559 HTTP/1.1 200 OK
4560 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
4561 Content-Type:application/zip
4562
4563 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
4564----
4565
David Pursehouse882aef22013-06-05 10:56:37 +09004566[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004567=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004568--
David Pursehouse882aef22013-06-05 10:56:37 +09004569'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 -08004570--
David Pursehouse882aef22013-06-05 10:56:37 +09004571
4572Gets the diff of a file from a certain revision.
4573
4574.Request
4575----
4576 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
4577----
4578
4579As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
4580
4581.Response
4582----
4583 HTTP/1.1 200 OK
4584 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004585 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09004586
4587 )]
4588 {
4589 "meta_a": {
4590 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004591 "content_type": "text/x-java-source",
4592 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09004593 },
4594 "meta_b": {
4595 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004596 "content_type": "text/x-java-source",
4597 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09004598 },
4599 "change_type": "MODIFIED",
4600 "diff_header": [
4601 "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",
4602 "index 59b7670..9faf81c 100644",
4603 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4604 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
4605 ],
4606 "content": [
4607 {
4608 "ab": [
4609 "// Copyright (C) 2010 The Android Open Source Project",
4610 "//",
4611 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
4612 "// you may not use this file except in compliance with the License.",
4613 "// You may obtain a copy of the License at",
4614 "//",
4615 "// http://www.apache.org/licenses/LICENSE-2.0",
4616 "//",
4617 "// Unless required by applicable law or agreed to in writing, software",
4618 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
4619 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
4620 "// See the License for the specific language governing permissions and",
4621 "// limitations under the License."
4622 ]
4623 },
4624 {
4625 "b": [
4626 "//",
4627 "// Add some more lines in the header."
4628 ]
4629 },
4630 {
4631 "ab": [
4632 "",
4633 "package com.google.gerrit.server.project;",
4634 "",
4635 "import com.google.common.collect.Maps;",
4636 ...
4637 ]
4638 }
4639 ...
4640 ]
4641 }
4642----
4643
4644If the `intraline` parameter is specified, intraline differences are included in the diff.
4645
4646.Request
4647----
4648 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
4649----
4650
4651.Response
4652----
4653 HTTP/1.1 200 OK
4654 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004655 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09004656
4657 )]
4658 {
4659 "meta_a": {
4660 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004661 "content_type": "text/x-java-source",
4662 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09004663 },
4664 "meta_b": {
4665 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004666 "content_type": "text/x-java-source",
4667 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09004668 },
4669 "change_type": "MODIFIED",
4670 "diff_header": [
4671 "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",
4672 "index 59b7670..9faf81c 100644",
4673 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4674 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
4675 ],
4676 "content": [
4677 ...
4678 {
4679 "a": [
4680 "/** Manages access control for Git references (aka branches, tags). */"
4681 ],
4682 "b": [
4683 "/** Manages access control for the Git references (aka branches, tags). */"
4684 ],
4685 "edit_a": [],
4686 "edit_b": [
4687 [
4688 31,
4689 4
4690 ]
4691 ]
4692 }
4693 ]
4694 }
4695----
4696
4697The `base` parameter can be specified to control the base patch set from which the diff should
4698be generated.
4699
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01004700The integer-valued request parameter `parent` can be specified to control the
4701parent commit number against which the diff should be generated. This is useful
4702for supporting review of merge commits. The value is the 1-based index of the
4703parent's position in the commit object.
4704
Edwin Kempin8cdce502014-12-06 10:55:38 +01004705[[weblinks-only]]
4706If the `weblinks-only` parameter is specified, only the diff web links are returned.
4707
David Pursehouse882aef22013-06-05 10:56:37 +09004708.Request
4709----
4710 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
4711----
4712
4713.Response
4714----
4715 HTTP/1.1 200 OK
4716 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004717 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09004718
4719 )]
4720 {
4721 "meta_a": {
4722 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004723 "content_type": "text/x-java-source",
4724 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09004725 },
4726 "meta_b": {
4727 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004728 "content_type": "text/x-java-source",
4729 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09004730 },
4731 "change_type": "MODIFIED",
4732 "content": [
4733 {
4734 "skip": 578
4735 }
4736 ]
4737 }
4738----
4739
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01004740The `whitespace` parameter can be specified to control how whitespace
4741differences are reported in the result. Valid values are `IGNORE_NONE`,
4742`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09004743
4744The `context` parameter can be specified to control the number of lines of surrounding context
4745in the diff. Valid values are `ALL` or number of lines.
4746
Gabor Somossyb72d4c62015-10-20 23:40:07 +01004747[[get-blame]]
4748=== Get Blame
4749--
4750'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
4751--
4752
4753Gets the blame of a file from a certain revision.
4754
4755.Request
4756----
4757 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
4758----
4759
4760As response a link:#blame-info[BlameInfo] entity is returned that describes the
4761blame.
4762
4763.Response
4764----
4765 HTTP/1.1 200 OK
4766 Content-Disposition: attachment
4767 Content-Type: application/json; charset=UTF-8
4768
4769 )]
4770 {
4771 [
4772 {
4773 "author": "Joe Daw",
4774 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
4775 "time": 1421441349,
4776 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
4777 "ranges": [
4778 {
4779 "start": 1,
4780 "end": 10
4781 },
4782 {
4783 "start": 16,
4784 "end": 296
4785 }
4786 ]
4787 },
4788 {
4789 "author": "Jane Daw",
4790 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
4791 "time": 1421825421,
4792 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
4793 "ranges": [
4794 {
4795 "start": 13,
4796 "end": 13
4797 }
4798 ]
4799 }
4800 ]
4801 }
4802----
4803
4804The `base` parameter can be specified to control the base patch set from which
4805the blame should be generated.
4806
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004807[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004808=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004809--
Edwin Kempinbea55a52013-05-14 13:53:39 +02004810'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 -08004811--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004812
Edwin Kempinbea55a52013-05-14 13:53:39 +02004813Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004814
4815.Request
4816----
4817 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
4818----
4819
4820.Response
4821----
4822 HTTP/1.1 201 Created
4823----
4824
Edwin Kempinbea55a52013-05-14 13:53:39 +02004825If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004826response is "`200 OK`".
4827
4828[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004829=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004830--
Edwin Kempinbea55a52013-05-14 13:53:39 +02004831'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 -08004832--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004833
Edwin Kempinbea55a52013-05-14 13:53:39 +02004834Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004835
4836.Request
4837----
4838 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
4839----
4840
4841.Response
4842----
4843 HTTP/1.1 204 No Content
4844----
4845
Gustaf Lundh019fb262012-11-28 14:20:22 +01004846[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004847=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004848--
Gustaf Lundh019fb262012-11-28 14:20:22 +01004849'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004850--
Gustaf Lundh019fb262012-11-28 14:20:22 +01004851
4852Cherry picks a revision to a destination branch.
4853
4854The commit message and destination branch must be provided in the request body inside a
Han-Wen Nienhuys02272e02017-03-28 14:47:09 +02004855link:#cherrypick-input[CherryPickInput] entity. If the commit message
4856does not specify a Change-Id, a new one is picked for the destination change.
Gustaf Lundh019fb262012-11-28 14:20:22 +01004857
4858.Request
4859----
4860 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004861 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01004862
4863 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01004864 "message" : "Implementing Feature X",
4865 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01004866 }
4867----
4868
4869As response a link:#change-info[ChangeInfo] entity is returned that
4870describes the resulting cherry picked change.
4871
4872.Response
4873----
4874 HTTP/1.1 200 OK
4875 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004876 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01004877
4878 )]}'
4879 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01004880 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
4881 "project": "myProject",
4882 "branch": "release-branch",
4883 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
4884 "subject": "Implementing Feature X",
4885 "status": "NEW",
4886 "created": "2013-02-01 09:59:32.126000000",
4887 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01004888 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004889 "insertions": 12,
4890 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01004891 "_number": 3965,
4892 "owner": {
4893 "name": "John Doe"
4894 }
4895 }
4896----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01004897
Changcheng Xiao2fcae692017-01-02 12:38:30 +01004898[[revision-reviewer-endpoints]]
4899== Revision Reviewer Endpoints
4900
4901[[list-revision-reviewers]]
4902=== List Revision Reviewers
4903--
4904'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/'
4905--
4906
4907Lists the reviewers of a revision.
4908
4909Please note that only the current revision is supported.
4910
4911As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
4912
4913.Request
4914----
4915 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/ HTTP/1.0
4916----
4917
4918.Response
4919----
4920 HTTP/1.1 200 OK
4921 Content-Disposition: attachment
4922 Content-Type: application/json; charset=UTF-8
4923
4924 )]}'
4925 [
4926 {
4927 "approvals": {
4928 "Verified": "+1",
4929 "Code-Review": "+2"
4930 },
4931 "_account_id": 1000096,
4932 "name": "John Doe",
4933 "email": "john.doe@example.com"
4934 },
4935 {
4936 "approvals": {
4937 "Verified": " 0",
4938 "Code-Review": "-1"
4939 },
4940 "_account_id": 1000097,
4941 "name": "Jane Roe",
4942 "email": "jane.roe@example.com"
4943 }
4944 ]
4945----
4946
4947[[list-revision-votes]]
4948=== List Revision Votes
4949--
4950'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
4951--
4952
4953Lists the votes for a specific reviewer of the revision.
4954
4955Please note that only the current revision is supported.
4956
4957.Request
4958----
4959 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/ HTTP/1.0
4960----
4961
4962As result a map is returned that maps the label name to the label value.
4963The entries in the map are sorted by label name.
4964
4965.Response
4966----
4967 HTTP/1.1 200 OK
4968 Content-Disposition: attachment
4969 Content-Type: application/json;charset=UTF-8
4970
4971 )]}'
4972 {
4973 "Code-Review": -1,
4974 "Verified": 1,
4975 "Work-In-Progress": 1
4976 }
4977----
4978
4979[[delete-revision-vote]]
4980=== Delete Revision Vote
4981--
4982'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
4983/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]' +
4984'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]
4985/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/link:#label-id[\{label-id\}]/delete'
4986--
4987
4988Deletes a single vote from a revision. The deletion will be possible only
4989if the revision is the current revision. By using this endpoint you can prevent
4990deleting the vote (with same label) from a newer patch set by mistake.
4991
4992Note, that even when the last vote of a reviewer is removed the reviewer itself
4993is still listed on the change.
4994
4995Options can be provided in the request body as a
4996link:#delete-vote-input[DeleteVoteInput] entity.
4997
4998.Request
4999----
5000 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
5001 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5002----
5003
5004Please note that some proxies prohibit request bodies for DELETE
5005requests. In this case, if you want to specify options, use a POST
5006request:
5007
5008.Request
5009----
5010 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
5011 Content-Type: application/json; charset=UTF-8
5012
5013 {
5014 "notify": "NONE"
5015 }
5016----
5017
5018.Response
5019----
5020 HTTP/1.1 204 No Content
5021----
5022
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005023[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005024== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005025
Edwin Kempina3d02ef2013-02-22 16:31:53 +01005026[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005027=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01005028--
5029--
5030
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005031[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005032=== \{change-id\}
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005033Identifier that uniquely identifies one change.
5034
5035This can be:
5036
5037* an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'",
5038 where for the branch the `refs/heads/` prefix can be omitted
5039 ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$")
5040* a Change-Id if it uniquely identifies one change
5041 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
5042* a legacy numeric change ID ("4247")
5043
John Spurlock5e402f02013-03-24 11:35:04 -04005044[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005045=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04005046UUID of a published comment.
5047
Edwin Kempin3ca57192013-02-27 07:44:01 +01005048[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005049=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01005050UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01005051
David Ostrovskybeb0b842014-12-13 00:24:29 +01005052[[label-id]]
5053=== \{label-id\}
5054The name of the label.
5055
Edwin Kempinbea55a52013-05-14 13:53:39 +02005056[[file-id]]
David Pursehouseb10c2662016-12-06 08:41:33 +09005057=== \{file-id\}
Edwin Kempinbea55a52013-05-14 13:53:39 +02005058The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01005059
David Pursehouse11badbb2017-03-27 10:58:05 +09005060The following magic paths are supported:
5061
5062* `/COMMIT_MSG`:
5063+
5064The commit message and headers with the parent commit(s), the author
5065information and the committer information.
5066
5067* `/MERGE_LIST` (for merge commits only):
5068+
5069The list of commits that are being integrated into the destination
5070branch by submitting the merge commit.
5071
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01005072[[fix-id]]
5073=== \{fix-id\}
5074UUID of a suggested fix.
5075
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005076[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005077=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005078Identifier that uniquely identifies one revision of a change.
5079
5080This can be:
5081
Shawn Pearce9c0722a2013-03-02 15:30:31 -08005082* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005083* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
5084* an abbreviated commit ID that uniquely identifies one revision of the
5085 change ("674ac754"), at least 4 digits are required
5086* a legacy numeric patch number ("1" for first patch set of the change)
Edwin Kempin8cc0bab2016-09-15 15:53:37 +02005087* "0" or the literal `edit` for a change edit
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01005088
Edwin Kempine3446292013-02-19 16:40:14 +01005089[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005090== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01005091
Edwin Kempined5364b2013-02-22 10:39:33 +01005092[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005093=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01005094The `AbandonInput` entity contains information for abandoning a change.
5095
David Pursehouseae367192014-11-25 17:24:47 +09005096[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01005097|=============================
5098|Field Name ||Description
5099|`message` |optional|
Edwin Kempined5364b2013-02-22 10:39:33 +01005100Message to be added as review comment to the change when abandoning the
5101change.
Edwin Kempincd07df42016-12-01 09:10:09 +01005102|`notify` |optional|
Stephen Lie5fcdf72016-08-02 11:05:11 -07005103Notify handling that defines to whom email notifications should be sent after
5104the change is abandoned. +
5105Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5106If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01005107|`notify_details`|optional|
5108Additional information about whom to notify about the update as a map
5109of recipient type to link:#notify-info[NotifyInfo] entity.
5110|=============================
Edwin Kempined5364b2013-02-22 10:39:33 +01005111
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005112[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005113=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005114The `ActionInfo` entity describes a REST API call the client can
5115make to manipulate a resource. These are frequently implemented by
5116plugins and may be discovered at runtime.
5117
David Pursehouseae367192014-11-25 17:24:47 +09005118[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005119|====================================
5120|Field Name ||Description
5121|`method` |optional|
5122HTTP method to use with the action. Most actions use `POST`, `PUT`
5123or `DELETE` to cause state changes.
5124|`label` |optional|
5125Short title to display to a user describing the action. In the
5126Gerrit web interface the label is used as the text on the button
5127presented in the UI.
5128|`title` |optional|
5129Longer text to display describing the action. In a web UI this
5130should be the title attribute of the element, displaying when
5131the user hovers the mouse.
5132|`enabled` |optional|
5133If true the action is permitted at this time and the caller is
5134likely allowed to execute it. This may change if state is updated
5135at the server or permissions are modified. Not present if false.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005136|====================================
5137
Edwin Kempin392328e2013-02-25 12:50:03 +01005138[[add-reviewer-result]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005139=== AddReviewerResult
Edwin Kempin392328e2013-02-25 12:50:03 +01005140The `AddReviewerResult` entity describes the result of adding a
5141reviewer to a change.
5142
David Pursehouseae367192014-11-25 17:24:47 +09005143[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01005144|===========================
5145|Field Name ||Description
Logan Hanks23e70282016-07-06 14:31:56 -07005146|`input` ||
5147Value of the `reviewer` field from link:#reviewer-input[ReviewerInput]
5148set while adding the reviewer.
Edwin Kempin392328e2013-02-25 12:50:03 +01005149|`reviewers` |optional|
5150The newly added reviewers as a list of link:#reviewer-info[
5151ReviewerInfo] entities.
Logan Hanksee0a4182016-07-06 14:39:26 -07005152|`ccs` |optional|
5153The newly CCed accounts as a list of link:#reviewer-info[
5154ReviewerInfo] entities. This field will only appear if the requested
5155`state` for the reviewer was `CC` *and* NoteDb is enabled on the
5156server.
Edwin Kempin392328e2013-02-25 12:50:03 +01005157|`error` |optional|
5158Error message explaining why the reviewer could not be added. +
5159If a group was specified in the input and an error is returned, it
5160means that none of the members were added as reviewer.
5161|`confirm` |`false` if not set|
5162Whether adding the reviewer requires confirmation.
5163|===========================
5164
Edwin Kempine3446292013-02-19 16:40:14 +01005165[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005166=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005167The `ApprovalInfo` entity contains information about an approval from a
5168user for a label on a change.
5169
Edwin Kempin963dfd02013-02-27 12:39:32 +01005170`ApprovalInfo` has the same fields as
5171link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01005172In addition `ApprovalInfo` has the following fields:
5173
David Pursehouseae367192014-11-25 17:24:47 +09005174[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005175|===========================
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005176|Field Name ||Description
5177|`value` |optional|
Dave Borowitza30db912013-03-22 14:20:33 -07005178The vote that the user has given for the label. If present and zero, the
5179user is permitted to vote on the label. If absent, the user is not
5180permitted to vote on that label.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005181|`permitted_voting_range` |optional|
5182The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote
5183on that label. If present, the user is permitted to vote on the label
5184regarding the range values. If absent, the user is not permitted to vote
5185on that label.
5186|`date` |optional|
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01005187The time and date describing when the approval was made.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07005188|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005189Value of the `tag` field from link:#review-input[ReviewInput] set
5190while posting the review.
5191NOTE: To apply different tags on on different votes/comments multiple
5192invocations of the REST call are required.
Dave Borowitze47fe472016-09-09 13:57:14 -04005193|`post_submit` |not set if `false`|
5194If true, this vote was made after the change was submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01005195|===========================
5196
Sven Selberg273a4aa2016-09-21 16:28:10 +02005197[[assignee-input]]
5198=== AssigneeInput
5199The `AssigneeInput` entity contains the identity of the user to be set as assignee.
5200
5201[options="header",cols="1,^1,5"]
5202|===========================
5203|Field Name ||Description
5204|`assignee` ||
5205The link:rest-api-accounts.html#account-id[ID] of one account that
5206should be added as assignee.
5207|===========================
5208
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005209[[blame-info]]
5210=== BlameInfo
5211The `BlameInfo` entity stores the commit metadata with the row coordinates where
5212it applies.
5213
5214[options="header",cols="1,6"]
5215|===========================
5216|Field Name | Description
5217|`author` | The author of the commit.
5218|`id` | The id of the commit.
5219|`time` | Commit time.
5220|`commit_msg` | The commit message.
5221|`ranges` |
5222The blame row coordinates as link:#range-info[RangeInfo] entities.
5223|===========================
5224
Edwin Kempin521c1242015-01-23 12:44:44 +01005225[[change-edit-input]]
5226=== ChangeEditInput
5227The `ChangeEditInput` entity contains information for restoring a
5228path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02005229
Edwin Kempin521c1242015-01-23 12:44:44 +01005230[options="header",cols="1,^1,5"]
5231|===========================
5232|Field Name ||Description
5233|`restore_path`|optional|Path to file to restore.
5234|`old_path` |optional|Old path to file to rename.
5235|`new_path` |optional|New path to file to rename.
5236|===========================
5237
5238[[change-edit-message-input]]
5239=== ChangeEditMessageInput
5240The `ChangeEditMessageInput` entity contains information for changing
5241the commit message within a change edit.
5242
5243[options="header",cols="1,^1,5"]
5244|===========================
5245|Field Name ||Description
5246|`message` ||New commit message.
5247|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02005248
Edwin Kempine3446292013-02-19 16:40:14 +01005249[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005250=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005251The `ChangeInfo` entity contains information about a change.
5252
David Pursehouseae367192014-11-25 17:24:47 +09005253[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005254|==================================
5255|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01005256|`id` ||
5257The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
John Spurlockd25fad12013-03-09 11:48:49 -05005258where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the
Edwin Kempine3446292013-02-19 16:40:14 +01005259`refs/heads/` prefix is omitted.
5260|`project` ||The name of the project.
5261|`branch` ||
5262The name of the target branch. +
5263The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01005264|`topic` |optional|The topic to which this change belongs.
Edwin Kempine3446292013-02-19 16:40:14 +01005265|`change_id` ||The Change-Id of the change.
5266|`subject` ||
5267The subject of the change (header line of the commit message).
5268|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07005269The status of the change (`NEW`, `MERGED`, `ABANDONED`, `DRAFT`).
Edwin Kempine3446292013-02-19 16:40:14 +01005270|`created` ||
5271The link:rest-api.html#timestamp[timestamp] of when the change was
5272created.
5273|`updated` ||
5274The link:rest-api.html#timestamp[timestamp] of when the change was last
5275updated.
Khai Do96a7caf2016-01-07 14:07:54 -08005276|`submitted` |only set for merged changes|
5277The link:rest-api.html#timestamp[timestamp] of when the change was
5278submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01005279|`starred` |not set if `false`|
Edwin Kempin9e972cc2016-04-15 10:39:13 +02005280Whether the calling user has starred this change with the default label.
5281|`stars` |optional|
5282A list of star labels that are applied by the calling user to this
5283change. The labels are lexicographically sorted.
Edwin Kempine3446292013-02-19 16:40:14 +01005284|`reviewed` |not set if `false`|
5285Whether the change was reviewed by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07005286Only set if link:#reviewed[reviewed] is requested.
Dave Borowitzace32102015-12-17 13:08:25 -05005287|`submit_type` |optional|
5288The link:project-configuration.html#submit_type[submit type] of the change. +
5289Not set for merged changes.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01005290|`mergeable` |optional|
5291Whether the change is mergeable. +
Dave Borowitze5fbeeb2014-06-27 09:47:49 -07005292Not set for merged changes, or if the change has not yet been tested.
Shawn Pearce4cd05b22016-09-17 22:45:33 -07005293|`submittable` |optional|
5294Whether the change has been approved by the project submit rules. +
Jonathan Niedercb51d742016-09-23 11:37:57 -07005295Only set if link:#submittable[requested].
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01005296|`insertions` ||
5297Number of inserted lines.
5298|`deletions` ||
5299Number of deleted lines.
Changcheng Xiao81c48092017-02-08 13:04:07 +01005300|`unresolved_comment_count` |optional|
5301Number of unresolved comments. Not set if the current change index doesn't have the data.
Edwin Kempine3446292013-02-19 16:40:14 +01005302|`_number` ||The legacy numeric ID of the change.
5303|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01005304The owner of the change as an link:rest-api-accounts.html#account-info[
5305AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07005306|`actions` |optional|
5307Actions the caller might be able to perform on this revision. The
5308information is a map of view name to link:#action-info[ActionInfo]
5309entities.
Edwin Kempine3446292013-02-19 16:40:14 +01005310|`labels` |optional|
5311The labels of the change as a map that maps the label names to
5312link:#label-info[LabelInfo] entries. +
5313Only set if link:#labels[labels] or link:#detailed-labels[detailed
5314labels] are requested.
5315|`permitted_labels` |optional|
5316A map of the permitted labels that maps a label name to the list of
5317values that are allowed for that label. +
5318Only set if link:#detailed-labels[detailed labels] are requested.
5319|`removable_reviewers`|optional|
5320The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01005321link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Edwin Kempine3446292013-02-19 16:40:14 +01005322Only set if link:#detailed-labels[detailed labels] are requested.
Edwin Kempin66af3d82015-11-10 17:38:40 -08005323|`reviewers` ||
5324The reviewers as a map that maps a reviewer state to a list of
5325link:rest-api-accounts.html#account-info[AccountInfo] entities.
5326Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
5327`REVIEWER`: Users with at least one non-zero vote on the change. +
5328`CC`: Users that were added to the change, but have not voted. +
5329`REMOVED`: Users that were previously reviewers on the change, but have
5330been removed. +
5331Only set if link:#detailed-labels[detailed labels] are requested.
Viktar Donich316bf7a2016-07-06 11:29:01 -07005332|`reviewer_updates`|optional|
5333Updates to reviewers set for the change as
5334link:#review-update-info[ReviewerUpdateInfo] entities.
5335Only set if link:#reviewer-updates[reviewer updates] are requested and
5336if NoteDb is enabled.
John Spurlock74a70cc2013-03-23 16:41:50 -04005337|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07005338Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04005339link:#change-message-info[ChangeMessageInfo] entities. +
5340Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005341|`current_revision` |optional|
5342The commit ID of the current patch set of this change. +
5343Only set if link:#current-revision[the current revision] is requested
5344or if link:#all-revisions[all revisions] are requested.
5345|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05005346All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01005347patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08005348Only set if link:#current-revision[the current revision] is requested
5349(in which case it will only contain a key for the current revision) or
5350if link:#all-revisions[all revisions] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005351|`_more_changes` |optional, not set if `false`|
5352Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08005353Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05005354|`problems` |optional|
5355A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08005356problems with this change. Only set if link:#check[CHECK] is set.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08005357|==================================
5358
5359[[change-input]]
5360=== ChangeInput
5361The `ChangeInput` entity contains information about creating a new change.
5362
5363[options="header",cols="1,^1,5"]
5364|==================================
5365|Field Name ||Description
5366|`project` ||The name of the project.
5367|`branch` ||
5368The name of the target branch. +
5369The `refs/heads/` prefix is omitted.
5370|`subject` ||
5371The subject of the change (header line of the commit message).
5372|`topic` |optional|The topic to which this change belongs.
5373|`status` |optional, default to `NEW`|
5374The status of the change (only `NEW` and `DRAFT` accepted here).
David Ostrovsky9d8ec422014-12-24 00:52:09 +01005375|`base_change` |optional|
5376A link:#change-id[\{change-id\}] that identifies the base change for a create
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08005377change operation.
5378|`new_branch` |optional, default to `false`|
5379Allow creating a new branch when set to `true`.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07005380|`merge` |optional|
5381The detail of a merge commit as a link:#merge-input[MergeInput] entity.
Edwin Kempin5f8c3832017-01-13 11:45:06 +01005382|`notify` |optional|
5383Notify handling that defines to whom email notifications should be sent
5384after the change is created. +
5385Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5386If not set, the default is `ALL`.
5387|`notify_details` |optional|
5388Additional information about whom to notify about the change creation
5389as a map of recipient type to link:#notify-info[NotifyInfo] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01005390|==================================
5391
John Spurlock74a70cc2013-03-23 16:41:50 -04005392[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005393=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04005394The `ChangeMessageInfo` entity contains information about a message
5395attached to a change.
5396
David Pursehouseae367192014-11-25 17:24:47 +09005397[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04005398|==================================
5399|Field Name ||Description
5400|`id` ||The ID of the message.
5401|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07005402Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04005403link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5404Unset if written by the Gerrit system.
Patrick Hiesel9221ef12017-03-23 16:44:36 +01005405|`real_author` |optional|
5406Real author of the message as an
5407link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5408Set if the message was posted on behalf of another user.
John Spurlock74a70cc2013-03-23 16:41:50 -04005409|`date` ||
5410The link:rest-api.html#timestamp[timestamp] this message was posted.
5411|`message` ||The text left by the user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005412|`tag` |optional|
5413Value of the `tag` field from link:#review-input[ReviewInput] set
5414while posting the review.
5415NOTE: To apply different tags on on different votes/comments multiple
5416invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04005417|`_revision_number` |optional|
5418Which patchset (if any) generated this message.
5419|==================================
5420
Gustaf Lundh019fb262012-11-28 14:20:22 +01005421[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005422=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01005423The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
5424
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005425[options="header",cols="1,^1,5"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01005426|===========================
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005427|Field Name ||Description
5428|`message` ||Commit message for the cherry-picked change
5429|`destination` ||Destination branch
5430|`parent` |optional, defaults to 1|
5431Number of the parent relative to which the cherry-pick should be considered.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005432|===========================
5433
Edwin Kempincb6724a2013-02-26 16:58:51 +01005434[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005435=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05005436The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005437
David Pursehouseae367192014-11-25 17:24:47 +09005438[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01005439|===========================
5440|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07005441|`patch_set` |optional|
5442The patch set number for the comment; only set in contexts where +
5443comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04005444|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005445|`path` |optional|
5446The path of the file for which the inline comment was done. +
5447Not set if returned in a map where the key is the file path.
5448|`side` |optional|
5449The side on which the comment was added. +
5450Allowed values are `REVISION` and `PARENT`. +
5451If not set, the default is `REVISION`.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005452|`parent` |optional|
5453The 1-based parent number. Used only for merge commits when `side == PARENT`.
5454When not set the comment is for the auto-merge tree.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005455|`line` |optional|
5456The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04005457If range is set, this equals the end line of the range. +
5458If neither line nor range is set, it's a file comment.
5459|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09005460The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04005461entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005462|`in_reply_to` |optional|
5463The URL encoded UUID of the comment to which this comment is a reply.
5464|`message` |optional|The comment message.
5465|`updated` ||
5466The link:rest-api.html#timestamp[timestamp] of when this comment was
5467written.
John Spurlock5e402f02013-03-24 11:35:04 -04005468|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09005469The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04005470link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5471Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005472|`tag` |optional|
5473Value of the `tag` field from link:#review-input[ReviewInput] set
5474while posting the review.
5475NOTE: To apply different tags on on different votes/comments multiple
5476invocations of the REST call are required.
Kasper Nilsson7ec30362016-12-20 14:13:21 -08005477|`unresolved` |optional|
5478Whether or not the comment must be addressed by the user. The state of
5479resolution of a comment thread is stored in the last comment in that thread
5480chronologically.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005481|===========================
5482
Edwin Kempin67498de2013-02-25 16:15:34 +01005483[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005484=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03005485The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01005486comment.
5487
David Pursehouseae367192014-11-25 17:24:47 +09005488[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01005489|===========================
5490|Field Name ||Description
5491|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01005492The URL encoded UUID of the comment if an existing draft comment should
5493be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005494|`path` |optional|
5495The path of the file for which the inline comment should be added. +
5496Doesn't need to be set if contained in a map where the key is the file
5497path.
Edwin Kempin67498de2013-02-25 16:15:34 +01005498|`side` |optional|
5499The side on which the comment should be added. +
5500Allowed values are `REVISION` and `PARENT`. +
5501If not set, the default is `REVISION`.
5502|`line` |optional|
5503The number of the line for which the comment should be added. +
5504`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04005505If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09005506If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04005507|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09005508The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04005509entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01005510|`in_reply_to` |optional|
5511The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005512|`updated` |optional|
5513The link:rest-api.html#timestamp[timestamp] of this comment. +
5514Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01005515|`message` |optional|
5516The comment message. +
5517If not set and an existing draft comment is updated, the existing draft
5518comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04005519|`tag` |optional, drafts only|
5520Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
5521inputs; for published comments, use the `tag` field in +
5522link#review-input[ReviewInput]
Kasper Nilsson7ec30362016-12-20 14:13:21 -08005523|`unresolved` |optional|
5524Whether or not the comment must be addressed by the user. This value will
5525default to false if the comment is an orphan, or the value of the `in_reply_to`
5526comment if it is supplied.
Edwin Kempin67498de2013-02-25 16:15:34 +01005527|===========================
5528
Michael Zhou596c7682013-08-25 05:43:34 -04005529[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005530=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04005531The `CommentRange` entity describes the range of an inline comment.
5532
David Pursehouseae367192014-11-25 17:24:47 +09005533[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04005534|===========================
5535|Field Name ||Description
Alice Kober-Sotzekcd06fb62017-03-21 15:19:45 +01005536|`start_line` ||The start line number of the range. (1-based, inclusive)
5537|`start_character` ||The character position in the start line. (0-based, inclusive)
5538|`end_line` ||The end line number of the range. (1-based, exclusive)
5539|`end_character` ||The character position in the end line. (0-based, exclusive)
Michael Zhou596c7682013-08-25 05:43:34 -04005540|===========================
5541
Edwin Kempine3446292013-02-19 16:40:14 +01005542[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005543=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005544The `CommitInfo` entity contains information about a commit.
5545
Edwin Kempinf0c57152015-07-15 18:18:24 +02005546[options="header",cols="1,^1,5"]
5547|===========================
5548|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02005549|`commit` |Optional|
5550The commit ID. Not set if included in a link:#revision-info[
5551RevisionInfo] entity that is contained in a map which has the commit ID
5552as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005553|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01005554The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02005555link:#commit-info[CommitInfo] entities. In each parent
5556only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005557|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01005558link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005559|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01005560link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005561|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01005562The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02005563|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01005564|`web_links` |optional|
5565Links to the commit in external sites as a list of
5566link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005567|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01005568
Edwin Kempin407fca32016-08-29 12:01:00 +02005569[[delete-reviewer-input]]
5570=== DeleteReviewerInput
5571The `DeleteReviewerInput` entity contains options for the deletion of a
5572reviewer.
5573
5574[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01005575|=============================
5576|Field Name ||Description
5577|`notify` |optional|
Edwin Kempin407fca32016-08-29 12:01:00 +02005578Notify handling that defines to whom email notifications should be sent
5579after the reviewer is deleted. +
5580Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5581If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01005582|`notify_details`|optional|
5583Additional information about whom to notify about the update as a map
5584of recipient type to link:#notify-info[NotifyInfo] entity.
5585|=============================
Edwin Kempin407fca32016-08-29 12:01:00 +02005586
Edwin Kempin1dfecb62016-06-16 10:45:00 +02005587[[delete-vote-input]]
5588=== DeleteVoteInput
5589The `DeleteVoteInput` entity contains options for the deletion of a
5590vote.
5591
5592[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01005593|=============================
5594|Field Name ||Description
5595|`label` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02005596The label for which the vote should be deleted. +
5597If set, must match the label in the URL.
Edwin Kempincd07df42016-12-01 09:10:09 +01005598|`notify` |optional|
Edwin Kempin1dfecb62016-06-16 10:45:00 +02005599Notify handling that defines to whom email notifications should be sent
5600after the vote is deleted. +
5601Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5602If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01005603|`notify_details`|optional|
5604Additional information about whom to notify about the update as a map
5605of recipient type to link:#notify-info[NotifyInfo] entity.
5606|=============================
Edwin Kempin1dfecb62016-06-16 10:45:00 +02005607
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08005608[[description-input]]
5609=== DescriptionInput
5610The `DescriptionInput` entity contains information for setting a description.
5611
5612[options="header",cols="1,6"]
5613|===========================
5614|Field Name |Description
5615|`description` |The description text.
5616|===========================
5617
David Pursehouse882aef22013-06-05 10:56:37 +09005618[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005619=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09005620The `DiffContent` entity contains information about the content differences
5621in a file.
5622
David Pursehouseae367192014-11-25 17:24:47 +09005623[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09005624|==========================
5625|Field Name ||Description
5626|`a` |optional|Content only in the file on side A (deleted in B).
5627|`b` |optional|Content only in the file on side B (added in B).
5628|`ab` |optional|Content in the file on both sides (unchanged).
5629|`edit_a` |only present during a replace, i.e. both `a` and `b` are present|
5630Text sections deleted from side A as a
5631link:#diff-intraline-info[DiffIntralineInfo] entity.
5632|`edit_b` |only present during a replace, i.e. both `a` and `b` are present|
5633Text sections inserted in side B as a
5634link:#diff-intraline-info[DiffIntralineInfo] entity.
5635|`skip` |optional|count of lines skipped on both sides when the file is
5636too large to include all common lines.
Shawn Pearce425a2be2014-01-02 16:00:58 -08005637|`common` |optional|Set to `true` if the region is common according
5638to the requested ignore-whitespace parameter, but a and b contain
5639differing amounts of whitespace. When present and true a and b are
5640used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09005641|==========================
5642
5643[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005644=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09005645The `DiffFileMetaInfo` entity contains meta information about a file diff.
5646
David Pursehouseae367192014-11-25 17:24:47 +09005647[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09005648|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02005649|Field Name ||Description
5650|`name` ||The name of the file.
5651|`content_type`||The content type of the file.
5652|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01005653|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02005654Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07005655link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09005656|==========================
5657
5658[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005659=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09005660The `DiffInfo` entity contains information about the diff of a file
5661in a revision.
5662
Edwin Kempin8cdce502014-12-06 10:55:38 +01005663If the link:#weblinks-only[weblinks-only] parameter is specified, only
5664the `web_links` field is set.
5665
David Pursehouseae367192014-11-25 17:24:47 +09005666[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09005667|==========================
5668|Field Name ||Description
5669|`meta_a` |not present when the file is added|
5670Meta information about the file on side A as a
5671link:#diff-file-meta-info[DiffFileMetaInfo] entity.
5672|`meta_b` |not present when the file is deleted|
5673Meta information about the file on side B as a
5674link:#diff-file-meta-info[DiffFileMetaInfo] entity.
5675|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
5676`COPIED`, `REWRITE`).
5677|`intraline_status`|only set when the `intraline` parameter was specified in the request|
5678Intraline status (`OK`, `ERROR`, `TIMEOUT`).
5679|`diff_header` ||A list of strings representing the patch set diff header.
5680|`content` ||The content differences in the file as a list of
5681link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01005682|`web_links` |optional|
5683Links to the file diff in external sites as a list of
5684link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01005685|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09005686|==========================
5687
5688[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005689=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09005690The `DiffIntralineInfo` entity contains information about intraline edits in a
5691file.
5692
David Pursehouse31203f52013-06-08 17:05:45 +09005693The information consists of a list of `<skip length, mark length>` pairs, where
5694the skip length is the number of characters between the end of the previous edit
5695and the start of this edit, and the mark length is the number of edited characters
5696following the skip. The start of the edits is from the beginning of the related
5697diff content lines.
David Pursehouse882aef22013-06-05 10:56:37 +09005698
David Pursehouse31203f52013-06-08 17:05:45 +09005699Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07005700the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09005701
Edwin Kempin8cdce502014-12-06 10:55:38 +01005702[[diff-web-link-info]]
5703=== DiffWebLinkInfo
5704The `DiffWebLinkInfo` entity describes a link on a diff screen to an
5705external site.
5706
5707[options="header",cols="1,6"]
5708|=======================
5709|Field Name|Description
5710|`name` |The link name.
5711|`url` |The link URL.
5712|`image_url`|URL to the icon of the link.
5713|show_on_side_by_side_diff_view|
5714Whether the web link should be shown on the side-by-side diff screen.
5715|show_on_unified_diff_view|
5716Whether the web link should be shown on the unified diff screen.
5717|=======================
5718
David Ostrovsky9ea9c112015-01-25 00:12:38 +01005719[[edit-file-info]]
5720=== EditFileInfo
5721The `EditFileInfo` entity contains additional information
5722of a file within a change edit.
5723
5724[options="header",cols="1,^1,5"]
5725|===========================
5726|Field Name ||Description
5727|`web_links` |optional|
5728Links to the diff info in external sites as a list of
5729link:#web-link-info[WebLinkInfo] entities.
5730|===========================
5731
Edwin Kempin521c1242015-01-23 12:44:44 +01005732[[edit-info]]
5733=== EditInfo
5734The `EditInfo` entity contains information about a change edit.
5735
5736[options="header",cols="1,^1,5"]
5737|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04005738|Field Name ||Description
5739|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01005740link:#commit-info[CommitInfo] entity.
Michael Zhoud03fe282016-04-25 17:13:17 -04005741|`base_revision`||The revision of the patch set the change edit is based on.
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005742|`fetch` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01005743Information about how to fetch this patch set. The fetch information is
5744provided as a map that maps the protocol name ("`git`", "`http`",
5745"`ssh`") to link:#fetch-info[FetchInfo] entities.
Michael Zhoud03fe282016-04-25 17:13:17 -04005746|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01005747The files of the change edit as a map that maps the file names to
5748link:#file-info[FileInfo] entities.
5749|===========================
5750
Edwin Kempine3446292013-02-19 16:40:14 +01005751[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005752=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005753The `FetchInfo` entity contains information about how to fetch a patch
5754set via a certain protocol.
5755
David Pursehouseae367192014-11-25 17:24:47 +09005756[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005757|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02005758|Field Name ||Description
5759|`url` ||The URL of the project.
5760|`ref` ||The ref of the patch set.
5761|`commands` |optional|
5762The download commands for this patch set as a map that maps the command
5763names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09005764Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005765|==========================
5766
5767[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005768=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005769The `FileInfo` entity contains information about a file in a patch set.
5770
David Pursehouseae367192014-11-25 17:24:47 +09005771[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005772|=============================
5773|Field Name ||Description
5774|`status` |optional|
5775The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
5776"`C`"=Copied, "`W`"=Rewritten). +
5777Not set if the file was Modified ("`M`").
5778|`binary` |not set if `false`|Whether the file is binary.
5779|`old_path` |optional|
5780The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05005781Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01005782|`lines_inserted`|optional|
5783Number of inserted lines. +
5784Not set for binary files or if no lines were inserted.
5785|`lines_deleted` |optional|
5786Number of deleted lines. +
5787Not set for binary files or if no lines were deleted.
Edwin Kempin640f9842015-10-08 15:53:20 +02005788|`size_delta` ||
5789Number of bytes by which the file size increased/decreased.
Edwin Kempin971a5f52015-10-28 10:50:39 +01005790|`size` ||
5791File size in bytes.
Edwin Kempine3446292013-02-19 16:40:14 +01005792|=============================
5793
Dave Borowitzbad53ee2015-06-11 10:10:18 -04005794[[fix-input]]
5795=== FixInput
5796The `FixInput` entity contains options for fixing commits using the
5797link:#fix-change[fix change] endpoint.
5798
5799[options="header",cols="1,6"]
5800|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07005801|Field Name |Description
5802|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04005803database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07005804|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07005805merged into the destination branch as this exact SHA-1. If not, insert
5806a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04005807|==========================
5808
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01005809[[fix-suggestion-info]]
5810=== FixSuggestionInfo
5811The `FixSuggestionInfo` entity represents a suggested fix.
5812
5813[options="header",cols="1,^1,5"]
5814|==========================
5815|Field Name ||Description
5816|`fix_id` |generated, don't set|The <<fix-id,UUID>> of the suggested
5817fix. It will be generated automatically and hence will be ignored if it's set
5818for input objects.
5819|`description` ||A description of the suggested fix.
5820|`replacements` ||A list of <<fix-replacement-info,FixReplacementInfo>>
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01005821entities indicating how the content of one or several files should be modified.
5822Within a file, they should refer to non-overlapping regions.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01005823|==========================
5824
5825[[fix-replacement-info]]
5826=== FixReplacementInfo
Alice Kober-Sotzek110f60f2016-12-19 14:53:40 +01005827The `FixReplacementInfo` entity describes how the content of a file should be
5828replaced by another content.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01005829
5830[options="header",cols="1,6"]
5831|==========================
5832|Field Name |Description
Alice Kober-Sotzek791f4af2017-03-16 18:02:15 +01005833|`path` |The path of the file which should be modified. Any file in
5834the repository may be modified.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01005835|`range` |A <<comment-range,CommentRange>> indicating which content
Alice Kober-Sotzek30d6c7d2017-03-09 13:51:02 +01005836of the file should be replaced. Lines in the file are assumed to be separated
5837by the line feed character, the carriage return character, the carriage return
5838followed by the line feed character, or one of the other Unicode linebreak
5839sequences supported by Java.
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01005840|`replacement` |The content which should be used instead of the current one.
5841|==========================
5842
Edwin Kempine3446292013-02-19 16:40:14 +01005843[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005844=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005845The `GitPersonInfo` entity contains information about the
5846author/committer of a commit.
5847
David Pursehouseae367192014-11-25 17:24:47 +09005848[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01005849|==========================
5850|Field Name |Description
5851|`name` |The name of the author/committer.
5852|`email` |The email address of the author/committer.
5853|`date` |The link:rest-api.html#timestamp[timestamp] of when
5854this identity was constructed.
5855|`tz` |The timezone offset from UTC of when this identity was
5856constructed.
5857|==========================
5858
Edwin Kempin521c1242015-01-23 12:44:44 +01005859[[group-base-info]]
5860=== GroupBaseInfo
5861The `GroupBaseInfo` entity contains base information about the group.
5862
5863[options="header",cols="1,6"]
5864|==========================
5865|Field Name |Description
Edwin Kempin703613c2016-11-25 16:06:04 +01005866|`id` |The UUID of the group.
Edwin Kempin521c1242015-01-23 12:44:44 +01005867|`name` |The name of the group.
5868|==========================
5869
David Pursehoused9dac372016-11-24 19:41:10 +09005870[[hashtags-input]]
5871=== HashtagsInput
5872
5873The `HashtagsInput` entity contains information about hashtags to add to,
5874and/or remove from, a change.
5875
5876[options="header",cols="1,^1,5"]
5877|=======================
5878|Field Name||Description
5879|`add` |optional|The list of hashtags to be added to the change.
5880|`remove |optional|The list of hashtags to be removed from the change.
5881|=======================
5882
Edwin Kempin521c1242015-01-23 12:44:44 +01005883[[included-in-info]]
5884=== IncludedInInfo
5885The `IncludedInInfo` entity contains information about the branches a
5886change was merged into and tags it was tagged with.
5887
Edwin Kempin78279ba2015-05-22 15:22:41 +02005888[options="header",cols="1,^1,5"]
5889|=======================
5890|Field Name||Description
5891|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01005892Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02005893|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01005894Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02005895|`external`|optional|A map that maps a name to a list of external
5896systems that include this change, e.g. a list of servers on which this
5897change is deployed.
5898|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01005899
Edwin Kempine3446292013-02-19 16:40:14 +01005900[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005901=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07005902The `LabelInfo` entity contains information about a label on a change, always
5903corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01005904
Dave Borowitz88159512013-06-14 14:21:50 -07005905There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07005906link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07005907
5908* For a quick summary of the state of labels, use `LABELS`.
5909* For detailed information about labels, including exact numeric votes for all
5910 users and the allowed range of votes for the current user, use `DETAILED_LABELS`.
5911
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005912==== Common fields
David Pursehouseae367192014-11-25 17:24:47 +09005913[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005914|===========================
5915|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01005916|`optional` |not set if `false`|
5917Whether the label is optional. Optional means the label may be set, but
5918it's neither necessary for submission nor does it block submission if
5919set.
Dave Borowitz88159512013-06-14 14:21:50 -07005920|===========================
5921
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005922==== Fields set by `LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09005923[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07005924|===========================
5925|Field Name ||Description
5926|`approved` |optional|One user who approved this label on the change
5927(voted the maximum value) as an
5928link:rest-api-accounts.html#account-info[AccountInfo] entity.
5929|`rejected` |optional|One user who rejected this label on the change
5930(voted the minimum value) as an
5931link:rest-api-accounts.html#account-info[AccountInfo] entity.
5932|`recommended` |optional|One user who recommended this label on the
5933change (voted positively, but not the maximum value) as an
5934link:rest-api-accounts.html#account-info[AccountInfo] entity.
5935|`disliked` |optional|One user who disliked this label on the change
5936(voted negatively, but not the minimum value) as an
5937link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01005938|`blocking` |optional|If `true`, the label blocks submit operation.
5939If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07005940|`value` |optional|The voting value of the user who
5941recommended/disliked this label on the change if it is not
5942"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07005943|`default_value`|optional|The default voting value for the label.
5944This value may be outside the range specified in permitted_labels.
Dave Borowitz88159512013-06-14 14:21:50 -07005945|===========================
5946
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005947==== Fields set by `DETAILED_LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09005948[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07005949|===========================
5950|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01005951|`all` |optional|List of all approvals for this label as a list
Dave Borowitz88159512013-06-14 14:21:50 -07005952of link:#approval-info[ApprovalInfo] entities.
Edwin Kempine3446292013-02-19 16:40:14 +01005953|`values` |optional|A map of all values that are allowed for this
5954label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07005955to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01005956|===========================
5957
Saša Živkov499873f2014-05-05 13:34:18 +02005958[[mergeable-info]]
5959=== MergeableInfo
5960The `MergeableInfo` entity contains information about the mergeability of a
5961change.
5962
David Pursehouseae367192014-11-25 17:24:47 +09005963[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02005964|============================
Saša Živkov697cab22014-04-29 16:46:50 +02005965|Field Name ||Description
5966|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02005967Submit type used for this change, can be `MERGE_IF_NECESSARY`,
5968`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
5969`CHERRY_PICK`.
Zhen Chenec13e452016-08-03 23:29:43 -07005970|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07005971The strategy of the merge, can be `recursive`, `resolve`,
5972`simple-two-way-in-core`, `ours` or `theirs`.
Saša Živkov697cab22014-04-29 16:46:50 +02005973|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02005974`true` if this change is cleanly mergeable, `false` otherwise
Zhen Chen8f00d552016-07-26 16:54:59 -07005975|`commit_merged` |optional|
5976`true` if this change is already merged, `false` otherwise
5977|`content_merged` |optional|
5978`true` if the content of this change is already merged, `false` otherwise
Zhen Chenf7d85ea2016-05-02 15:14:43 -07005979|`conflicts`|optional|
5980A list of paths with conflicts
Saša Živkov697cab22014-04-29 16:46:50 +02005981|`mergeable_into`|optional|
5982A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02005983|============================
Dave Borowitz88159512013-06-14 14:21:50 -07005984
Zhen Chenf7d85ea2016-05-02 15:14:43 -07005985[[merge-input]]
5986=== MergeInput
5987The `MergeInput` entity contains information about the merge
5988
5989[options="header",cols="1,^1,5"]
5990|============================
5991|Field Name ||Description
5992|`source` ||
5993The source to merge from, e.g. a complete or abbreviated commit SHA-1,
5994a complete reference name, a short reference name under refs/heads, refs/tags,
5995or refs/remotes namespace, etc.
5996|`strategy` |optional|
5997The strategy of the merge, can be `recursive`, `resolve`,
5998`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
5999|============================
6000
Zhen Chenb1e07e52016-09-23 12:59:48 -07006001[[merge-patch-set-input]]
6002=== MergePatchSetInput
6003The `MergePatchSetInput` entity contains information about updating a new
6004change by creating a new merge commit.
6005
6006[options="header",cols="1,^1,5"]
6007|==================================
6008|Field Name ||Description
6009|`subject` |optional|
6010The new subject for the change, if not specified, will reuse the current patch
6011set's subject
6012|`inheritParent` |optional, default to `false`|
6013Use the current patch set's first parent as the merge tip when set to `true`.
6014Otherwise, use the current branch tip of the destination branch.
6015|`merge` ||
6016The detail of the source commit for merge as a link:#merge-input[MergeInput]
6017entity.
6018|==================================
6019
Raviteja Sunkara791f3392015-11-03 13:24:50 +05306020[[move-input]]
6021=== MoveInput
6022The `MoveInput` entity contains information for moving a change to a new branch.
6023
6024[options="header",cols="1,^1,5"]
6025|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04006026|Field Name ||Description
6027|`destination_branch`||Destination branch
6028|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05306029A message to be posted in this change's comments
6030|===========================
6031
Edwin Kempincd07df42016-12-01 09:10:09 +01006032[[notify-info]]
6033=== NotifyInfo
6034The `NotifyInfo` entity contains detailed information about who should
6035be notified about an update. These notifications are sent out even if a
6036`notify` option in the request input disables normal notifications.
6037`NotifyInfo` entities are normally contained in a `notify_details` map
6038in the request input where the key is the recipient type. The recipient
6039type can be `TO`, `CC` and `BCC`.
6040
6041[options="header",cols="1,^1,5"]
6042|=======================
6043|Field Name||Description
6044|`accounts`|optional|
6045A list of link:rest-api-accounts.html#account-id[account IDs] that
6046identify the accounts that should be should be notified.
6047|=======================
6048
Edwin Kempin521c1242015-01-23 12:44:44 +01006049[[problem-info]]
6050=== ProblemInfo
6051The `ProblemInfo` entity contains a description of a potential consistency problem
6052with a change. These are not related to the code review process, but rather
6053indicate some inconsistency in Gerrit's database or repository metadata related
6054to the enclosing change.
6055
6056[options="header",cols="1,^1,5"]
6057|===========================
6058|Field Name||Description
6059|`message` ||Plaintext message describing the problem with the change.
6060|`status` |optional|
6061The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
6062fix was attempted.
6063|`outcome` |optional|
6064If `status` is set, an additional plaintext message describing the
6065outcome of the fix.
6066|===========================
6067
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006068[[publish-change-edit-input]]
6069=== PublishChangeEditInput
6070The `PublishChangeEditInput` entity contains options for the publishing of
6071change edit.
6072
6073[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006074|=============================
6075|Field Name ||Description
6076|`notify` |optional|
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006077Notify handling that defines to whom email notifications should be sent
6078after the change edit is published. +
6079Allowed values are `NONE` and `ALL`. +
6080If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006081|`notify_details`|optional|
6082Additional information about whom to notify about the update as a map
6083of recipient type to link:#notify-info[NotifyInfo] entity.
6084|=============================
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02006085
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04006086[[push-certificate-info]]
6087=== PushCertificateInfo
6088The `PushCertificateInfo` entity contains information about a push
6089certificate provided when the user pushed for review with `git push
6090--signed HEAD:refs/for/<branch>`. Only used when signed push is
6091link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
6092
6093[options="header",cols="1,6"]
6094|===========================
6095|Field Name|Description
6096|`certificate`|Signed certificate payload and GPG signature block.
6097|`key` |
6098Information about the key that signed the push, along with any problems
6099found while checking the signature or the key itself, as a
6100link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
6101|===========================
6102
Gabor Somossyb72d4c62015-10-20 23:40:07 +01006103[[range-info]]
6104=== RangeInfo
6105The `RangeInfo` entity stores the coordinates of a range.
6106
6107[options="header",cols="1,6"]
6108|===========================
6109|Field Name | Description
6110|`start` | First index.
6111|`end` | Last index.
6112|===========================
6113
Zalan Blenessy874aed72015-01-12 13:26:18 +01006114[[rebase-input]]
6115=== RebaseInput
6116The `RebaseInput` entity contains information for changing parent when rebasing.
6117
6118[options="header",width="50%",cols="1,^1,5"]
6119|===========================
6120|Field Name ||Description
6121|`base` |optional|
6122The new parent revision. This can be a ref or a SHA1 to a concrete patchset. +
6123Alternatively, a change number can be specified, in which case the current
6124patch set is inferred. +
6125Empty string is used for rebasing directly on top of the target branch,
6126which effectively breaks dependency towards a parent change.
6127|===========================
6128
Edwin Kempin521c1242015-01-23 12:44:44 +01006129[[related-change-and-commit-info]]
6130=== RelatedChangeAndCommitInfo
6131
6132The `RelatedChangeAndCommitInfo` entity contains information about
6133a related change and commit.
6134
6135[options="header",cols="1,^1,5"]
6136|===========================
6137|Field Name ||Description
6138|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01006139|`commit` ||The commit as a
6140link:#commit-info[CommitInfo] entity.
6141|`_change_number` |optional|The change number.
6142|`_revision_number` |optional|The revision number.
6143|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07006144|`status` |optional|The status of the change. The status of
Stefan Beller0d3cab02015-07-10 13:32:57 -07006145the change is one of (`NEW`, `MERGED`, `ABANDONED`, `DRAFT`).
Edwin Kempin521c1242015-01-23 12:44:44 +01006146|===========================
6147
6148[[related-changes-info]]
6149=== RelatedChangesInfo
6150The `RelatedChangesInfo` entity contains information about related
6151changes.
6152
6153[options="header",cols="1,6"]
6154|===========================
6155|Field Name |Description
6156|`changes` |A list of
6157link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
6158describing the related changes. Sorted by git commit order, newest to
6159oldest. Empty if there are no related changes.
6160|===========================
6161
Edwin Kempined5364b2013-02-22 10:39:33 +01006162[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006163=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01006164The `RestoreInput` entity contains information for restoring a change.
6165
David Pursehouseae367192014-11-25 17:24:47 +09006166[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01006167|===========================
6168|Field Name ||Description
6169|`message` |optional|
6170Message to be added as review comment to the change when restoring the
6171change.
6172|===========================
6173
Edwin Kempind2ec4152013-02-22 12:17:19 +01006174[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006175=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01006176The `RevertInput` entity contains information for reverting a change.
6177
David Pursehouseae367192014-11-25 17:24:47 +09006178[options="header",cols="1,^1,5"]
Edwin Kempind2ec4152013-02-22 12:17:19 +01006179|===========================
6180|Field Name ||Description
6181|`message` |optional|
6182Message to be added as review comment to the change when reverting the
6183change.
6184|===========================
6185
Edwin Kempin67498de2013-02-25 16:15:34 +01006186[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006187=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01006188The `ReviewInfo` entity contains information about a review.
6189
David Pursehouseae367192014-11-25 17:24:47 +09006190[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01006191|===========================
6192|Field Name |Description
6193|`labels` |
6194The labels of the review as a map that maps the label names to the
6195voting values.
6196|===========================
6197
Viktar Donich316bf7a2016-07-06 11:29:01 -07006198[[review-update-info]]
6199=== ReviewerUpdateInfo
6200The `ReviewerUpdateInfo` entity contains information about updates to
6201change's reviewers set.
6202
6203[options="header",cols="1,6"]
6204|===========================
6205|Field Name |Description
6206|`updated`|
6207Timestamp of the update.
6208|`updated_by`|
6209The account which modified state of the reviewer in question as
6210link:rest-api-accounts.html#account-info[AccountInfo] entity.
6211|`reviewer`|
6212The reviewer account added or removed from the change as an
6213link:rest-api-accounts.html#account-info[AccountInfo] entity.
6214|`state`|
6215The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`.
6216|===========================
6217
Edwin Kempin67498de2013-02-25 16:15:34 +01006218[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006219=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01006220The `ReviewInput` entity contains information for adding a review to a
6221revision.
6222
David Pursehouseae367192014-11-25 17:24:47 +09006223[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01006224|============================
Bill Wendling692b4ec2015-10-19 15:40:57 -07006225|Field Name ||Description
6226|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006227The message to be added as review comment.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01006228|`tag` |optional|
6229Apply this tag to the review comment message, votes, and inline
6230comments. Tags may be used by CI or other automated systems to
6231distinguish them from human reviews. Comments with specific tag
6232values can be filtered out in the web UI.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006233|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006234The votes that should be added to the revision as a map that maps the
6235label names to the voting values.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006236|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006237The comments that should be added as a map that maps a file path to a
6238list of link:#comment-input[CommentInput] entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006239|`robot_comments` |optional|
6240The robot comments that should be added as a map that maps a file path
6241to a list of link:#robot-comment-input[RobotCommentInput] entities.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006242|`strict_labels` |`true` if not set|
John Spurlockd25fad12013-03-09 11:48:49 -05006243Whether all labels are required to be within the user's permitted ranges
Edwin Kempin67498de2013-02-25 16:15:34 +01006244based on access controls. +
6245If `true`, attempting to use a label not granted to the user will fail
6246the entire modify operation early. +
6247If `false`, the operation will execute anyway, but the proposed labels
6248will be modified to be the "best" value allowed by the access controls.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006249|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006250Draft handling that defines how draft comments are handled that are
6251already in the database but that were not also described in this
6252input. +
David Ostrovsky8a1da032014-07-25 10:57:35 +02006253Allowed values are `DELETE`, `PUBLISH`, `PUBLISH_ALL_REVISIONS` and
6254`KEEP`. All values except `PUBLISH_ALL_REVISIONS` operate only on drafts
6255for a single revision. +
Dave Borowitzc0640542016-10-05 16:19:21 -04006256Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. +
6257If not set, the default is `DELETE`, unless `on_behalf_of` is set, in
6258which case the default is `KEEP` and any other value is disallowed.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006259|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01006260Notify handling that defines to whom email notifications should be sent
6261after the review is stored. +
6262Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6263If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006264|`notify_details` |optional|
6265Additional information about whom to notify about the update as a map
6266of recipient type to link:#notify-info[NotifyInfo] entity.
Bill Wendling692b4ec2015-10-19 15:40:57 -07006267|`omit_duplicate_comments`|optional|
6268If `true`, comments with the same content at the same place will be omitted.
6269|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07006270link:rest-api-accounts.html#account-id[\{account-id\}] the review
6271should be posted on behalf of. To use this option the caller must
6272have been granted `labelAs-NAME` permission for all keys of labels.
Patrick Hieselcf6d9352017-04-13 10:15:42 +02006273|`reviewers` |optional|
6274A list of link:rest-api-changes.html#reviewer-input[ReviewerInput]
6275representing reviewers that should be added to the change.
Edwin Kempin67498de2013-02-25 16:15:34 +01006276|============================
6277
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006278[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006279=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006280The `ReviewerInfo` entity contains information about a reviewer and its
6281votes on a change.
6282
Edwin Kempin963dfd02013-02-27 12:39:32 +01006283`ReviewerInfo` has the same fields as
6284link:rest-api-accounts.html#account-info[AccountInfo] and includes
6285link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006286In addition `ReviewerInfo` has the following fields:
6287
David Pursehouseae367192014-11-25 17:24:47 +09006288[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006289|==========================
6290|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006291|`approvals` |
6292The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09006293approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Patrick Hiesel11873ef2017-03-17 17:36:05 +01006294|`_account_id` |
6295This field is inherited from `AccountInfo` but is optional here if an
6296unregistered reviewer was added by email. See
6297link:rest-api-changes.html#add-reviewer[add-reviewer] for details.
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01006298|==========================
6299
Edwin Kempin392328e2013-02-25 12:50:03 +01006300[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006301=== ReviewerInput
Edwin Kempin392328e2013-02-25 12:50:03 +01006302The `ReviewerInput` entity contains information for adding a reviewer
6303to a change.
6304
David Pursehouseae367192014-11-25 17:24:47 +09006305[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006306|=============================
6307|Field Name ||Description
6308|`reviewer` ||
Edwin Kempin392328e2013-02-25 12:50:03 +01006309The link:rest-api-accounts.html#account-id[ID] of one account that
6310should be added as reviewer or the link:rest-api-groups.html#group-id[
6311ID] of one group for which all members should be added as reviewers. +
6312If an ID identifies both an account and a group, only the account is
6313added as reviewer to the change.
Edwin Kempincd07df42016-12-01 09:10:09 +01006314|`state` |optional|
Logan Hanksee0a4182016-07-06 14:39:26 -07006315Add reviewer in this state. Possible reviewer states are `REVIEWER`
6316and `CC`. If not given, defaults to `REVIEWER`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006317|`confirmed` |optional|
Edwin Kempin392328e2013-02-25 12:50:03 +01006318Whether adding the reviewer is confirmed. +
6319The Gerrit server may be configured to
6320link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
6321confirmation] when adding a group as reviewer that has many members.
Edwin Kempincd07df42016-12-01 09:10:09 +01006322|`notify` |optional|
Sven Selberg4d64f972016-09-26 16:15:02 +02006323Notify handling that defines to whom email notifications should be sent
6324after the reviewer is added. +
6325Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6326If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006327|`notify_details`|optional|
6328Additional information about whom to notify about the update as a map
6329of recipient type to link:#notify-info[NotifyInfo] entity.
6330|=============================
Edwin Kempin392328e2013-02-25 12:50:03 +01006331
Edwin Kempine3446292013-02-19 16:40:14 +01006332[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006333=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01006334The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07006335Not all fields are returned by default. Additional fields can
6336be obtained by adding `o` parameters as described in
6337link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01006338
David Pursehouseae367192014-11-25 17:24:47 +09006339[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01006340|===========================
6341|Field Name ||Description
6342|`draft` |not set if `false`|Whether the patch set is a draft.
David Pursehouse4de41112016-06-28 09:24:08 +09006343|`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`,
6344`MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`.
Edwin Kempine3446292013-02-19 16:40:14 +01006345|`_number` ||The patch set number.
Edwin Kempin04cbd342015-02-19 16:31:22 +01006346|`created` ||
6347The link:rest-api.html#timestamp[timestamp] of when the patch set was
6348created.
6349|`uploader` ||
6350The uploader of the patch set as an
6351link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempin4569ced2014-11-25 16:45:05 +01006352|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01006353|`fetch` ||
6354Information about how to fetch this patch set. The fetch information is
6355provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07006356"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
6357only included if a plugin implementing the
6358link:intro-project-owner.html#download-commands[download commands]
6359interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07006360|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01006361link:#commit-info[CommitInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07006362|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01006363The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07006364link:#file-info[FileInfo] entities. Only set if
6365link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
6366option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07006367|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07006368Actions the caller might be able to perform on this revision. The
6369information is a map of view name to link:#action-info[ActionInfo]
6370entities.
Khai Dob3139b7532014-09-19 15:13:04 -07006371|`reviewed` |optional|
6372Indicates whether the caller is authenticated and has commented on the
6373current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07006374|`messageWithFooter` |optional|
6375If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
6376this is the current patch set, contains the full commit message with
6377Gerrit-specific commit footers, as if this revision were submitted
6378using the link:project-configuration.html#cherry_pick[Cherry Pick]
6379submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04006380|`push_certificate` |optional|
6381If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
6382contains the push certificate provided by the user when uploading this
6383patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
6384This field is always set if the option is requested; if no push
6385certificate was provided, it is set to an empty object.
Aaron Gable621c9b62017-04-21 09:24:20 -07006386|`description` |optional|
6387The description of this patchset, as displayed in the patchset
6388selector menu. May be null if no description is set.
Edwin Kempine3446292013-02-19 16:40:14 +01006389|===========================
6390
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006391[[robot-comment-info]]
6392=== RobotCommentInfo
6393The `RobotCommentInfo` entity contains information about a robot inline
6394comment.
6395
Alice Kober-Sotzek265805d2016-12-07 15:24:21 +01006396`RobotCommentInfo` has the same fields as <<comment-info,CommentInfo>>.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006397In addition `RobotCommentInfo` has the following fields:
6398
6399[options="header",cols="1,^1,5"]
6400|===========================
Alice Kober-Sotzekbcd275e2016-12-05 16:22:07 +01006401|Field Name ||Description
6402|`robot_id` ||The ID of the robot that generated this comment.
6403|`robot_run_id` ||An ID of the run of the robot.
6404|`url` |optional|URL to more information.
6405|`properties` |optional|Robot specific properties as map that maps arbitrary
6406keys to values.
6407|`fix_suggestions`|optional|Suggested fixes for this robot comment as a list of
6408<<fix-suggestion-info,FixSuggestionInfo>> entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006409|===========================
6410
6411[[robot-comment-input]]
6412=== RobotCommentInput
6413The `RobotCommentInput` entity contains information for creating an inline
6414robot comment.
6415
Alice Kober-Sotzek265805d2016-12-07 15:24:21 +01006416`RobotCommentInput` has the same fields as
6417<<robot-comment-info,RobotCommentInfo>>.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02006418
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006419[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006420=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006421The `RuleInput` entity contains information to test a Prolog rule.
6422
David Pursehouseae367192014-11-25 17:24:47 +09006423[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006424|===========================
6425|Field Name ||Description
6426|`rule`||
6427Prolog code to execute instead of the code in `refs/meta/config`.
6428|`filters`|`RUN` if not set|
6429When `RUN` filter rules in the parent projects are called to
6430post-process the results of the project specific rule. This
6431behavior matches how the rule will execute if installed. +
6432If `SKIP` the parent filters are not called, allowing the test
6433to return results from the input rule.
6434|===========================
6435
Edwin Kempin14b58112013-02-26 16:30:19 +01006436[[submit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006437=== SubmitInfo
Edwin Kempin14b58112013-02-26 16:30:19 +01006438The `SubmitInfo` entity contains information about the change status
6439after submitting.
6440
Stefan Bellere4785b42015-06-18 12:31:03 -07006441[options="header",cols="1,^1,5"]
Edwin Kempin14b58112013-02-26 16:30:19 +01006442|==========================
Stefan Bellere4785b42015-06-18 12:31:03 -07006443|Field Name ||Description
6444|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07006445The status of the change after submitting is `MERGED`.
David Ostrovsky868e3412014-01-30 19:50:57 +01006446|`on_behalf_of`|optional|
6447The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on
6448whose behalf the action should be done. To use this option the caller must
David Pursehouse22bd6f92014-02-20 21:11:01 +09006449have been granted both `Submit` and `Submit (On Behalf Of)` permissions.
6450The user named by `on_behalf_of` does not need to be granted the `Submit`
6451permission. This feature is aimed for CI solutions: the CI account can be
David Pursehousea61ee502016-09-06 16:27:09 +09006452granted both permissions, so individual users don't need `Submit` permission
6453themselves. Still the changes can be submitted on behalf of real users and
David Pursehouse22bd6f92014-02-20 21:11:01 +09006454not with the identity of the CI account.
Edwin Kempin14b58112013-02-26 16:30:19 +01006455|==========================
6456
Edwin Kempin0eddba02013-02-22 15:30:12 +01006457[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006458=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01006459The `SubmitInput` entity contains information for submitting a change.
6460
David Pursehouseae367192014-11-25 17:24:47 +09006461[options="header",cols="1,^1,5"]
Edwin Kempincd07df42016-12-01 09:10:09 +01006462|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01006463|Field Name ||Description
Edwin Kempincd07df42016-12-01 09:10:09 +01006464|`on_behalf_of` |optional|
Dave Borowitzc6d143d2016-02-24 12:32:23 -05006465If set, submit the change on behalf of the given user. The value may take any
6466format link:rest-api-accounts.html#account-id[accepted by the accounts REST
6467API]. Using this option requires
6468link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
6469permission on the branch.
Edwin Kempincd07df42016-12-01 09:10:09 +01006470|`notify` |optional|
Stephen Lia5a5ef02016-03-31 16:55:53 -07006471Notify handling that defines to whom email notifications should be sent after
6472the change is submitted. +
6473Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6474If not set, the default is `ALL`.
Edwin Kempincd07df42016-12-01 09:10:09 +01006475|`notify_details`|optional|
6476Additional information about whom to notify about the update as a map
6477of recipient type to link:#notify-info[NotifyInfo] entity.
6478|=============================
Edwin Kempin0eddba02013-02-22 15:30:12 +01006479
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006480[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006481=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006482The `SubmitRecord` entity describes results from a submit_rule.
Dave Borowitz6453fce2016-09-22 16:11:56 +02006483Fields in this entity roughly correspond to the fields set by `LABELS`
6484in link:#label-info[LabelInfo].
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006485
David Pursehouseae367192014-11-25 17:24:47 +09006486[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006487|===========================
6488|Field Name ||Description
6489|`status`||
6490`OK`, the change can be submitted. +
6491`NOT_READY`, additional labels are required before submit. +
6492`CLOSED`, closed changes cannot be submitted. +
6493`RULE_ERROR`, rule code failed with an error.
6494|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01006495Map of labels that are approved; an
6496link:rest-api-accounts.html#account-info[AccountInfo] identifies the
6497voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006498|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01006499Map of labels that are preventing submit;
6500link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006501|`need`|optional|
6502Map of labels that need to be given to submit. The value is
6503currently an empty object.
6504|`may`|optional|
6505Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01006506link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
6507if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006508|`impossible`|optional|
6509Map of labels that should have been in `need` but cannot be
6510used by any user because of access restrictions. The value
6511is currently an empty object.
6512|`error_message`|optional|
6513When status is RULE_ERROR this message provides some text describing
6514the failure of the rule predicate.
6515|===========================
6516
Jonathan Nieder2a629b02016-06-16 15:15:25 -07006517[[submitted-together-info]]
6518=== SubmittedTogetherInfo
6519The `SubmittedTogetherInfo` entity contains information about a
6520collection of changes that would be submitted together.
6521
6522[options="header",cols="1,6"]
6523|===========================
6524|Field Name |Description
6525|`changes` |
6526A list of ChangeInfo entities representing the changes to be submitted together.
6527|`non_visible_changes`|
6528The number of changes to be submitted together that the current user
6529cannot see. (This count includes changes that are visible to the
6530current user when their reason for being submitted together involves
6531changes the user cannot see.)
6532|===========================
6533
Edwin Kempin521c1242015-01-23 12:44:44 +01006534[[suggested-reviewer-info]]
6535=== SuggestedReviewerInfo
6536The `SuggestedReviewerInfo` entity contains information about a reviewer
6537that can be added to a change (an account or a group).
6538
6539`SuggestedReviewerInfo` has either the `account` field that contains
6540the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
6541the `group` field that contains the
6542link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
6543
Logan Hanksab3c81e2016-07-20 15:42:52 -07006544[options="header",cols="1,^1,5"]
6545|===========================
6546|Field Name ||Description
6547|`account` |optional|
6548An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the
6549suggestion is an account.
6550|`group` |optional|
6551A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the
6552suggestion is a group.
6553|`count` ||
6554The total number of accounts in the suggestion. This is `1` if `account` is
6555present. If `group` is present, the total number of accounts that are
6556members of the group is returned (this count includes members of nested
6557groups).
6558|`confirm` |optional|
6559True if `group` is present and `count` is above the threshold where the
6560`confirmed` flag must be passed to add the group as a reviewer.
6561|===========================
6562
Edwin Kempin64006bb2013-02-22 08:17:04 +01006563[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006564=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01006565The `TopicInput` entity contains information for setting a topic.
6566
David Pursehouseae367192014-11-25 17:24:47 +09006567[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01006568|===========================
6569|Field Name ||Description
6570|`topic` |optional|The topic. +
6571The topic will be deleted if not set.
Edwin Kempin64006bb2013-02-22 08:17:04 +01006572|===========================
6573
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006574[[voting-range-info]]
6575=== VotingRangeInfo
6576The `VotingRangeInfo` entity describes the continuous voting range from min
6577to max values.
6578
6579[options="header",cols="1,6"]
6580|======================
6581|Field Name|Description
6582|`min` |The minimum voting value.
6583|`max` |The maximum voting value.
6584|======================
6585
Edwin Kempinbd885ff2014-04-11 16:11:56 +02006586[[web-link-info]]
6587=== WebLinkInfo
6588The `WebLinkInfo` entity describes a link to an external site.
6589
David Pursehouseae367192014-11-25 17:24:47 +09006590[options="header",cols="1,6"]
Edwin Kempinbd885ff2014-04-11 16:11:56 +02006591|======================
6592|Field Name|Description
6593|`name` |The link name.
6594|`url` |The link URL.
Sven Selberg55484202014-06-26 08:48:51 +02006595|`image_url`|URL to the icon of the link.
Edwin Kempinbd885ff2014-04-11 16:11:56 +02006596|======================
6597
Edwin Kempind0a63922013-01-23 16:32:59 +01006598GERRIT
6599------
6600Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07006601
6602SEARCHBOX
6603---------