blob: 62b0a76d57f29a86d339e1edb45cb1f24ef83510 [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:
297 * the change is open
298 * the caller is authenticated
299 * the caller has commented on the change more recently than the last update
300 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
1778New or abandoned changes can only be deleted by administrators. The deletion of
1779merged changes isn't supported at the moment. Draft changes can only be deleted
1780by their owner or other users who have the permissions to view and delete
1781drafts. If the draft workflow is disabled, only administrators with those
1782permissions may delete draft changes.
David Ostrovsky0d69c232013-09-10 23:10:23 +02001783
1784.Request
1785----
1786 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001787 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001788----
1789
1790.Response
1791----
1792 HTTP/1.1 204 No Content
1793----
1794
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001795[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001796=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001797--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001798'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001799--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001800
1801Retrieves the branches and tags in which a change is included. As result
1802an link:#included-in-info[IncludedInInfo] entity is returned.
1803
1804.Request
1805----
1806 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
1807----
1808
1809.Response
1810----
1811 HTTP/1.1 200 OK
1812 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001813 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001814
1815 )]}'
1816 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001817 "branches": [
1818 "master"
1819 ],
1820 "tags": []
1821 }
1822----
1823
David Pursehouse4e38b972014-05-30 10:36:40 +09001824[[index-change]]
1825=== Index Change
1826--
1827'POST /changes/link:#change-id[\{change-id\}]/index'
1828--
1829
1830Adds or updates the change in the secondary index.
1831
1832.Request
1833----
1834 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
1835----
1836
1837.Response
1838----
1839 HTTP/1.1 204 No Content
1840----
1841
Dave Borowitz23fec2b2015-04-28 17:40:07 -07001842[[list-change-comments]]
1843=== List Change Comments
1844--
1845'GET /changes/link:#change-id[\{change-id\}]/comments'
1846--
1847
1848Lists the published comments of all revisions of the change.
1849
1850Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1851entries. The entries in the map are sorted by file path, and the
1852comments for each path are sorted by patch set number. Each comment has
1853the `patch_set` and `author` fields set.
1854
1855.Request
1856----
1857 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
1858----
1859
1860.Response
1861----
1862 HTTP/1.1 200 OK
1863 Content-Disposition: attachment
1864 Content-Type: application/json; charset=UTF-8
1865
1866 )]}'
1867 {
1868 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1869 {
1870 "patch_set": 1,
1871 "id": "TvcXrmjM",
1872 "line": 23,
1873 "message": "[nit] trailing whitespace",
1874 "updated": "2013-02-26 15:40:43.986000000"
1875 "author": {
1876 "_account_id": 1000096,
1877 "name": "John Doe",
1878 "email": "john.doe@example.com"
1879 }
1880 },
1881 {
1882 "patch_set": 2,
1883 "id": "TveXwFiA",
1884 "line": 49,
1885 "in_reply_to": "TfYX-Iuo",
1886 "message": "Done",
1887 "updated": "2013-02-26 15:40:45.328000000"
1888 "author": {
1889 "_account_id": 1000097,
1890 "name": "Jane Roe",
1891 "email": "jane.roe@example.com"
1892 }
1893 }
1894 ]
1895 }
1896----
1897
1898[[list-change-drafts]]
1899=== List Change Drafts
1900--
1901'GET /changes/link:#change-id[\{change-id\}]/drafts'
1902--
1903
1904Lists the draft comments of all revisions of the change that belong to
1905the calling user.
1906
1907Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1908entries. The entries in the map are sorted by file path, and the
1909comments for each path are sorted by patch set number. Each comment has
1910the `patch_set` field set, and no `author`.
1911
1912.Request
1913----
1914 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts 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 "patch_set": 1,
1928 "id": "TvcXrmjM",
1929 "line": 23,
1930 "message": "[nit] trailing whitespace",
1931 "updated": "2013-02-26 15:40:43.986000000"
1932 },
1933 {
1934 "patch_set": 2,
1935 "id": "TveXwFiA",
1936 "line": 49,
1937 "in_reply_to": "TfYX-Iuo",
1938 "message": "Done",
1939 "updated": "2013-02-26 15:40:45.328000000"
1940 }
1941 ]
1942 }
1943----
1944
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001945[[check-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001946=== Check Change
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001947--
1948'GET /changes/link:#change-id[\{change-id\}]/check'
1949--
1950
1951Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05001952link:#change-info[ChangeInfo] entity with the `problems` field set to a
1953list of link:#problem-info[ProblemInfo] entities.
1954
1955Depending on the type of problem, some fields not marked optional may be
1956missing from the result. At least `id`, `project`, `branch`, and
1957`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001958
1959.Request
1960----
1961 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
1962----
1963
1964.Response
1965----
1966 HTTP/1.1 200 OK
1967 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001968 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001969
1970 )]}'
1971 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05001972 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1973 "project": "myProject",
1974 "branch": "master",
1975 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1976 "subject": "Implementing Feature X",
1977 "status": "NEW",
1978 "created": "2013-02-01 09:59:32.126000000",
1979 "updated": "2013-02-21 11:16:36.775000000",
1980 "mergeable": true,
1981 "insertions": 34,
1982 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05001983 "_number": 3965,
1984 "owner": {
1985 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001986 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05001987 "problems": [
1988 {
1989 "message": "Current patch set 1 not found"
1990 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001991 ]
1992 }
1993----
1994
Dave Borowitz3be39d02014-12-03 17:57:38 -08001995[[fix-change]]
David Pursehouseaa1f77a2016-09-09 14:00:53 +09001996=== Fix Change
Dave Borowitz3be39d02014-12-03 17:57:38 -08001997--
1998'POST /changes/link:#change-id[\{change-id\}]/check'
1999--
2000
2001Performs consistency checks on the change as with link:#check-change[GET
2002/check], and additionally fixes any problems that can be fixed
2003automatically. The returned field values reflect any fixes.
2004
Dave Borowitzbad53ee2015-06-11 10:10:18 -04002005Some fixes have options controlling their behavior, which can be set in the
2006link:#fix-input[FixInput] entity body.
2007
Dave Borowitz3be39d02014-12-03 17:57:38 -08002008Only the change owner, a project owner, or an administrator may fix changes.
2009
2010.Request
2011----
2012 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
2013----
2014
2015.Response
2016----
2017 HTTP/1.1 200 OK
2018 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002019 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08002020
2021 )]}'
2022 {
2023 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2024 "project": "myProject",
2025 "branch": "master",
2026 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2027 "subject": "Implementing Feature X",
2028 "status": "MERGED",
2029 "created": "2013-02-01 09:59:32.126000000",
2030 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08002031 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08002032 "mergeable": true,
2033 "insertions": 34,
2034 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08002035 "_number": 3965,
2036 "owner": {
2037 "name": "John Doe"
2038 },
2039 "problems": [
2040 {
2041 "message": "Current patch set 2 not found"
2042 },
2043 {
2044 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
2045 "status": FIXED,
2046 "outcome": "Marked change as merged"
2047 }
2048 ]
2049 }
2050----
2051
David Ostrovsky1a49f622014-07-29 00:40:02 +02002052[[edit-endpoints]]
2053== Change Edit Endpoints
2054
David Ostrovsky1a49f622014-07-29 00:40:02 +02002055[[get-edit-detail]]
2056=== Get Change Edit Details
2057--
2058'GET /changes/link:#change-id[\{change-id\}]/edit
2059--
2060
2061Retrieves a change edit details.
2062
2063.Request
2064----
2065 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2066----
2067
2068As response an link:#edit-info[EditInfo] entity is returned that
2069describes the change edit, or "`204 No Content`" when change edit doesn't
2070exist for this change. Change edits are stored on special branches and there
2071can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02002072When request parameter `list` is provided the response also includes the file
2073list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02002074against this base revision. When request parameter `download-commands` is
2075provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02002076
2077.Response
2078----
2079 HTTP/1.1 200 OK
2080 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002081 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02002082
2083 )]}'
2084 {
2085 "commit":{
2086 "parents":[
2087 {
2088 "commit":"1eee2c9d8f352483781e772f35dc586a69ff5646",
2089 }
2090 ],
2091 "author":{
2092 "name":"Shawn O. Pearce",
2093 "email":"sop@google.com",
2094 "date":"2012-04-24 18:08:08.000000000",
2095 "tz":-420
2096 },
2097 "committer":{
2098 "name":"Shawn O. Pearce",
2099 "email":"sop@google.com",
2100 "date":"2012-04-24 18:08:08.000000000",
2101 "tz":-420
2102 },
2103 "subject":"Use an EventBus to manage star icons",
2104 "message":"Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2105 },
Michael Zhoud03fe282016-04-25 17:13:17 -04002106 "base_revision":"c35558e0925e6985c91f3a16921537d5e572b7a3"
David Ostrovsky1a49f622014-07-29 00:40:02 +02002107 }
2108----
David Pursehouse4e38b972014-05-30 10:36:40 +09002109
David Ostrovskya5ab8292014-08-01 02:11:39 +02002110[[put-edit-file]]
2111=== Change file content in Change Edit
2112--
2113'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2114--
2115
2116Put content of a file to a change edit.
2117
2118.Request
2119----
2120 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2121----
2122
2123When change edit doesn't exist for this change yet it is created. When file
2124content isn't provided, it is wiped out for that file. As response
2125"`204 No Content`" is returned.
2126
2127.Response
2128----
2129 HTTP/1.1 204 No Content
2130----
2131
David Ostrovsky138edb42014-08-15 21:31:43 +02002132[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01002133=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02002134--
2135'POST /changes/link:#change-id[\{change-id\}]/edit
2136--
2137
David Ostrovskya00c9532015-01-21 00:17:49 +01002138Creates empty change edit, restores file content or renames files in change
2139edit. The request body needs to include a
2140link:#change-edit-input[ChangeEditInput] entity when a file within change
2141edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02002142
2143.Request
2144----
2145 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002146 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02002147
2148 {
David Ostrovskybd12e172014-08-21 23:08:15 +02002149 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02002150 }
2151----
2152
David Ostrovskya00c9532015-01-21 00:17:49 +01002153or for rename:
2154
2155.Request
2156----
2157 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2158 Content-Type: application/json; charset=UTF-8
2159
2160 {
2161 "old_path": "foo",
2162 "new_path": "bar"
2163 }
2164----
2165
David Ostrovsky138edb42014-08-15 21:31:43 +02002166When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01002167and restore flag are provided in request body, this file is restored. When
2168old and new file names are provided, the file is renamed. As response
2169"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02002170
2171.Response
2172----
2173 HTTP/1.1 204 No Content
2174----
2175
David Ostrovskyc967e152014-10-24 17:36:16 +02002176[[put-change-edit-message]]
2177=== Change commit message in Change Edit
2178--
2179'PUT /changes/link:#change-id[\{change-id\}]/edit:message
2180--
2181
2182Modify commit message. The request body needs to include a
2183link:#change-edit-message-input[ChangeEditMessageInput]
2184entity.
2185
2186.Request
2187----
2188 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002189 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02002190
2191 {
2192 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
2193 }
2194----
2195
2196If a change edit doesn't exist for this change yet, it is created. As
2197response "`204 No Content`" is returned.
2198
2199.Response
2200----
2201 HTTP/1.1 204 No Content
2202----
2203
David Ostrovsky2830c292014-08-01 02:24:31 +02002204[[delete-edit-file]]
2205=== Delete file in Change Edit
2206--
2207'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
2208--
2209
2210Deletes a file from a change edit. This deletes the file from the repository
2211completely. This is not the same as reverting or restoring a file to its
2212previous contents.
2213
2214.Request
2215----
2216 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2217----
2218
2219When change edit doesn't exist for this change yet it is created.
2220
2221.Response
2222----
2223 HTTP/1.1 204 No Content
2224----
2225
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002226[[get-edit-file]]
2227=== Retrieve file content from Change Edit
2228--
2229'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2230--
2231
2232Retrieves content of a file from a change edit.
2233
2234.Request
2235----
2236 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2237----
2238
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002239The content of the file is returned as text encoded inside base64.
2240The Content-Type header will always be `text/plain` reflecting the
2241outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
2242can be examined to find the server detected content type of the file.
2243
2244When the specified file was deleted in the change edit
2245"`204 No Content`" is returned.
2246
2247If only the content type is required, callers should use HEAD to
2248avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002249
Michael Zhou551ad0c2016-04-26 01:21:42 -04002250If the `base` parameter is set to true, the returned content is from the
2251revision that the edit is based on.
2252
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002253.Response
2254----
2255 HTTP/1.1 200 OK
2256 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002257 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002258 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002259 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002260
2261 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
2262----
2263
David Ostrovskyd0078672015-02-06 21:51:04 +01002264Alternatively, if the only value of the Accept request header is
2265`application/json` the content is returned as JSON string and
2266`X-FYI-Content-Encoding` is set to `json`.
2267
David Ostrovsky9ea9c112015-01-25 00:12:38 +01002268[[get-edit-meta-data]]
2269=== Retrieve meta data of a file from Change Edit
2270--
2271'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
2272--
2273
2274Retrieves meta data of a file from a change edit. Currently only
2275web links are returned.
2276
2277.Request
2278----
2279 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
2280----
2281
2282This REST endpoint retrieves additional information for a file in a
2283change edit. As result an link:#edit-file-info[EditFileInfo] entity is
2284returned.
2285
2286.Response
2287----
2288 HTTP/1.1 200 OK
2289 Content-Disposition: attachment
2290 Content-Type: application/json; charset=UTF-8
2291
2292 )]}'
2293 {
2294 "web_links":[
2295 {
2296 "show_on_side_by_side_diff_view": true,
2297 "name": "side-by-side preview diff",
2298 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
2299 "url": "#/x/xdocs/c/42/1..0/README.md",
2300 "target": "_self"
2301 },
2302 {
2303 "show_on_unified_diff_view": true,
2304 "name": "unified preview diff",
2305 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
2306 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
2307 "target": "_self"
2308 }
2309 ]}
2310----
2311
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002312[[get-edit-message]]
2313=== Retrieve commit message from Change Edit or current patch set of the change
2314--
2315'GET /changes/link:#change-id[\{change-id\}]/edit:message
2316--
2317
David Ostrovsky25ad15e2014-12-15 21:18:59 +01002318Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002319
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02002320If the `base` parameter is set to true, the returned message is from the
2321revision that the edit is based on.
2322
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002323.Request
2324----
2325 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
2326----
2327
2328The commit message is returned as base64 encoded string.
2329
2330.Response
2331----
2332 HTTP/1.1 200 OK
2333
2334 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
2335M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
2336----
2337
David Ostrovskyd0078672015-02-06 21:51:04 +01002338Alternatively, if the only value of the Accept request header is
2339`application/json` the commit message is returned as JSON string:
2340
2341.Response
2342----
2343 HTTP/1.1 200 OK
2344
2345)]}'
2346"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
2347----
2348
2349
David Ostrovskye9988f92014-08-01 09:56:34 +02002350[[publish-edit]]
2351=== Publish Change Edit
2352--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002353'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02002354--
2355
2356Promotes change edit to a regular patch set.
2357
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02002358Options can be provided in the request body as a
2359link:#publish-change-edit-input[PublishChangeEditInput] entity.
2360
David Ostrovskye9988f92014-08-01 09:56:34 +02002361.Request
2362----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002363 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02002364 Content-Type: application/json; charset=UTF-8
2365
2366 {
2367 "notify": "NONE"
2368 }
David Ostrovskye9988f92014-08-01 09:56:34 +02002369----
2370
2371As response "`204 No Content`" is returned.
2372
2373.Response
2374----
2375 HTTP/1.1 204 No Content
2376----
2377
David Ostrovsky46999d22014-08-16 02:19:13 +02002378[[rebase-edit]]
2379=== Rebase Change Edit
2380--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002381'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02002382--
2383
2384Rebases change edit on top of latest patch set.
2385
2386.Request
2387----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002388 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02002389----
2390
2391When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09002392"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02002393based on top of the latest patch set, the response
2394"`409 Conflict`" is returned.
2395
2396.Response
2397----
2398 HTTP/1.1 204 No Content
2399----
2400
David Ostrovsky8e75f502014-08-10 00:36:31 +02002401[[delete-edit]]
2402=== Delete Change Edit
2403--
2404'DELETE /changes/link:#change-id[\{change-id\}]/edit'
2405--
2406
2407Deletes change edit.
2408
2409.Request
2410----
2411 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2412----
2413
2414As response "`204 No Content`" is returned.
2415
2416.Response
2417----
2418 HTTP/1.1 204 No Content
2419----
2420
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002421[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002422== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002423
2424[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002425=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002426--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002427'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002428--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002429
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002430Lists the reviewers of a change.
2431
2432As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
2433
2434.Request
2435----
2436 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0
2437----
2438
2439.Response
2440----
2441 HTTP/1.1 200 OK
2442 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002443 Content-Type: application/json; charset=UTF-8
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002444
2445 )]}'
2446 [
2447 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002448 "approvals": {
2449 "Verified": "+1",
2450 "Code-Review": "+2"
2451 },
2452 "_account_id": 1000096,
2453 "name": "John Doe",
2454 "email": "john.doe@example.com"
2455 },
2456 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002457 "approvals": {
2458 "Verified": " 0",
2459 "Code-Review": "-1"
2460 },
2461 "_account_id": 1000097,
2462 "name": "Jane Roe",
2463 "email": "jane.roe@example.com"
2464 }
2465 ]
2466----
2467
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002468[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002469=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002470--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002471'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002472--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002473
2474Suggest the reviewers for a given query `q` and result limit `n`. If result
2475limit is not passed, then the default 10 is used.
2476
2477As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
2478
2479.Request
2480----
2481 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0
2482----
2483
2484.Response
2485----
2486 HTTP/1.1 200 OK
2487 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002488 Content-Type: application/json; charset=UTF-8
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002489
2490 )]}'
2491 [
2492 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002493 "account": {
2494 "_account_id": 1000097,
2495 "name": "Jane Roe",
2496 "email": "jane.roe@example.com"
Logan Hanksab3c81e2016-07-20 15:42:52 -07002497 },
2498 "count": 1
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002499 },
2500 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002501 "group": {
2502 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
2503 "name": "Joiner"
Logan Hanksab3c81e2016-07-20 15:42:52 -07002504 },
2505 "count": 5
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002506 }
2507 ]
2508----
2509
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002510[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002511=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002512--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002513'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 -08002514--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002515
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002516Retrieves a reviewer of a change.
2517
2518As response a link:#reviewer-info[ReviewerInfo] entity is returned that
2519describes the reviewer.
2520
2521.Request
2522----
2523 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
2524----
2525
2526.Response
2527----
2528 HTTP/1.1 200 OK
2529 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002530 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002531
2532 )]}'
2533 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002534 "approvals": {
2535 "Verified": "+1",
2536 "Code-Review": "+2"
2537 },
2538 "_account_id": 1000096,
2539 "name": "John Doe",
2540 "email": "john.doe@example.com"
2541 }
2542----
2543
Edwin Kempin392328e2013-02-25 12:50:03 +01002544[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002545=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002546--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002547'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002548--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002549
Edwin Kempin392328e2013-02-25 12:50:03 +01002550Adds one user or all members of one group as reviewer to the change.
2551
2552The reviewer to be added to the change must be provided in the request
2553body as a link:#reviewer-input[ReviewerInput] entity.
2554
2555.Request
2556----
2557 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002558 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002559
2560 {
2561 "reviewer": "john.doe@example.com"
2562 }
2563----
2564
2565As response an link:#add-reviewer-result[AddReviewerResult] entity is
2566returned that describes the newly added reviewers.
2567
2568.Response
2569----
2570 HTTP/1.1 200 OK
2571 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002572 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002573
2574 )]}'
2575 {
2576 "reviewers": [
2577 {
Logan Hanks23e70282016-07-06 14:31:56 -07002578 "input": "john.doe@example.com",
Edwin Kempin392328e2013-02-25 12:50:03 +01002579 "approvals": {
2580 "Verified": " 0",
2581 "Code-Review": " 0"
2582 },
2583 "_account_id": 1000096,
2584 "name": "John Doe",
2585 "email": "john.doe@example.com"
2586 }
2587 ]
2588 }
2589----
2590
2591If a group is specified, adding the group members as reviewers is an
2592atomic operation. This means if an error is returned, none of the
2593members are added as reviewer.
2594
2595If a group with many members is added as reviewer a confirmation may be
2596required.
2597
2598.Request
2599----
2600 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002601 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002602
2603 {
2604 "reviewer": "MyProjectVerifiers"
2605 }
2606----
2607
2608.Response
2609----
2610 HTTP/1.1 200 OK
2611 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002612 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002613
2614 )]}'
2615 {
Logan Hanks23e70282016-07-06 14:31:56 -07002616 "input": "MyProjectVerifiers",
Edwin Kempin392328e2013-02-25 12:50:03 +01002617 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
2618 "confirm": true
2619 }
2620----
2621
2622To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01002623`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01002624
2625.Request
2626----
2627 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002628 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002629
2630 {
Logan Hanks23e70282016-07-06 14:31:56 -07002631 "input": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01002632 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01002633 }
2634----
2635
Edwin Kempin53301072013-02-25 12:57:07 +01002636[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002637=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002638--
Edwin Kempin407fca32016-08-29 12:01:00 +02002639'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' +
2640'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 -08002641--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002642
Edwin Kempin53301072013-02-25 12:57:07 +01002643Deletes a reviewer from a change.
2644
Edwin Kempin407fca32016-08-29 12:01:00 +02002645Options can be provided in the request body as a
2646link:#delete-reviewer-input[DeleteReviewerInput] entity.
2647
Edwin Kempin53301072013-02-25 12:57:07 +01002648.Request
2649----
2650 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
Edwin Kempin407fca32016-08-29 12:01:00 +02002651 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
2652----
2653
2654Please note that some proxies prohibit request bodies for DELETE
2655requests. In this case, if you want to specify options, use a POST
2656request:
2657
2658.Request
2659----
2660 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
2661 Content-Type: application/json; charset=UTF-8
2662
2663 {
2664 "notify": "NONE"
2665 }
Edwin Kempin53301072013-02-25 12:57:07 +01002666----
2667
2668.Response
2669----
2670 HTTP/1.1 204 No Content
2671----
2672
David Ostrovskybeb0b842014-12-13 00:24:29 +01002673[[list-votes]]
2674=== List Votes
2675--
2676'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
2677--
2678
2679Lists the votes for a specific reviewer of the change.
2680
2681.Request
2682----
Edwin Kempin314f10a2016-07-11 11:39:05 +02002683 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0
David Ostrovskybeb0b842014-12-13 00:24:29 +01002684----
2685
2686As result a map is returned that maps the label name to the label value.
2687The entries in the map are sorted by label name.
2688
2689.Response
2690----
2691 HTTP/1.1 200 OK
2692 Content-Disposition: attachment
2693 Content-Type: application/json;charset=UTF-8
2694
2695 )]}'
2696 {
2697 "Code-Review": -1,
2698 "Verified": 1
2699 "Work-In-Progress": 1,
2700 }
2701----
2702
2703[[delete-vote]]
2704=== Delete Vote
2705--
Edwin Kempin5488dc12016-08-29 11:13:31 +02002706'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 +02002707'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 +01002708--
2709
2710Deletes a single vote from a change. Note, that even when the last vote of
2711a reviewer is removed the reviewer itself is still listed on the change.
2712
Edwin Kempin1dfecb62016-06-16 10:45:00 +02002713Options can be provided in the request body as a
2714link:#delete-vote-input[DeleteVoteInput] entity.
2715
David Ostrovskybeb0b842014-12-13 00:24:29 +01002716.Request
2717----
2718 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
Edwin Kempin1dfecb62016-06-16 10:45:00 +02002719 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
2720----
2721
2722Please note that some proxies prohibit request bodies for DELETE
2723requests. In this case, if you want to specify options, use a POST
2724request:
2725
2726.Request
2727----
2728 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
2729 Content-Type: application/json; charset=UTF-8
2730
2731 {
2732 "notify": "NONE"
2733 }
David Ostrovskybeb0b842014-12-13 00:24:29 +01002734----
2735
2736.Response
2737----
2738 HTTP/1.1 204 No Content
2739----
2740
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002741[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002742== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002743
Shawn Pearce728ba882013-07-08 23:13:08 -07002744[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002745=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002746--
Shawn Pearce728ba882013-07-08 23:13:08 -07002747'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002748--
Shawn Pearce728ba882013-07-08 23:13:08 -07002749
2750Retrieves a parsed commit of a revision.
2751
2752.Request
2753----
2754 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
2755----
2756
2757As response a link:#commit-info[CommitInfo] entity is returned that
2758describes the revision.
2759
2760.Response
2761----
2762 HTTP/1.1 200 OK
2763 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002764 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07002765
2766 )]}'
2767 {
Edwin Kempinc8237402015-07-15 18:27:55 +02002768 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07002769 "parents": [
2770 {
2771 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
2772 "subject": "Migrate contributor agreements to All-Projects."
2773 }
2774 ],
2775 "author": {
2776 "name": "Shawn O. Pearce",
2777 "email": "sop@google.com",
2778 "date": "2012-04-24 18:08:08.000000000",
2779 "tz": -420
2780 },
2781 "committer": {
2782 "name": "Shawn O. Pearce",
2783 "email": "sop@google.com",
2784 "date": "2012-04-24 18:08:08.000000000",
2785 "tz": -420
2786 },
2787 "subject": "Use an EventBus to manage star icons",
2788 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2789 }
2790----
2791
Sven Selbergd26bd542014-11-21 16:28:10 +01002792Adding query parameter `links` (for example `/changes/.../commit?links`)
2793returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07002794
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08002795[[get-description]]
2796=== Get Description
2797--
2798'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
2799--
2800
2801Retrieves the description of a patch set.
2802
2803.Request
2804----
2805 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
2806----
2807
2808.Response
2809----
2810 HTTP/1.1 200 OK
2811 Content-Disposition: attachment
2812 Content-Type: application/json; charset=UTF-8
2813
2814 )]}'
2815 "Added Documentation"
2816----
2817
2818If the patch set does not have a description an empty string is returned.
2819
2820[[set-description]]
2821=== Set Description
2822--
2823'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/description'
2824--
2825
2826Sets the description of a patch set.
2827
2828The new description must be provided in the request body inside a
2829link:#description-input[DescriptionInput] entity.
2830
2831.Request
2832----
2833 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/description HTTP/1.0
2834 Content-Type: application/json; charset=UTF-8
2835
2836 {
2837 "description": "Added Documentation"
2838 }
2839----
2840
2841As response the new description is returned.
2842
2843.Response
2844----
2845 HTTP/1.1 200 OK
2846 Content-Disposition: attachment
2847 Content-Type: application/json; charset=UTF-8
2848
2849 )]}'
2850 "Added Documentation"
2851----
2852
Edwin Kempin0f229442016-09-09 13:06:12 +02002853[[get-merge-list]]
2854=== Get Merge List
2855--
2856'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergelist'
2857--
2858
2859Returns the list of commits that are being integrated into a target
2860branch by a merge commit. By default the first parent is assumed to be
2861uninteresting. By using the `parent` option another parent can be set
2862as uninteresting (parents are 1-based).
2863
2864The list of commits is returned as a list of
2865link:#commit-info[CommitInfo] entities. Web links are only included if
2866the `links` option was set.
2867
2868.Request
2869----
2870 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/7e30d802b890ec8d0be45b1cc2a8ef092bcfc858/mergelist HTTP/1.0
2871----
2872
2873.Response
2874----
2875HTTP/1.1 200 OK
2876 Content-Disposition: attachment
2877 Content-Type: application/json; charset=UTF-8
2878
2879 )]}'
2880 [
2881 {
2882 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
2883 "parents": [
2884 {
2885 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
2886 "subject": "Migrate contributor agreements to All-Projects."
2887 }
2888 ],
2889 "author": {
2890 "name": "Shawn O. Pearce",
2891 "email": "sop@google.com",
2892 "date": "2012-04-24 18:08:08.000000000",
2893 "tz": -420
2894 },
2895 "committer": {
2896 "name": "Shawn O. Pearce",
2897 "email": "sop@google.com",
2898 "date": "2012-04-24 18:08:08.000000000",
2899 "tz": -420
2900 },
2901 "subject": "Use an EventBus to manage star icons",
2902 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2903 }
2904 ]
2905----
2906
Stefan Bellerc7259662015-02-12 17:23:05 -08002907[[get-revision-actions]]
2908=== Get Revision Actions
2909--
2910'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
2911--
2912
2913Retrieves revision link:#action-info[actions] of the revision of a change.
2914
2915.Request
2916----
2917 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
2918----
2919
2920.Response
2921----
2922 HTTP/1.1 200 OK
2923 Content-Disposition: attachment
2924 Content-Type: application/json; charset=UTF-8
2925
2926 )]}'
2927
2928{
2929 "submit": {
2930 "method": "POST",
2931 "label": "Submit",
2932 "title": "Submit patch set 1 into master",
2933 "enabled": true
2934 },
2935 "cherrypick": {
2936 "method": "POST",
2937 "label": "Cherry Pick",
2938 "title": "Cherry pick change to a different branch",
2939 "enabled": true
2940 }
2941}
2942----
2943
2944The response is a flat map of possible revision actions mapped to their
2945link:#action-info[ActionInfo].
2946
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002947[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002948=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002949--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002950'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002951--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002952
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002953Retrieves a review of a revision.
2954
2955.Request
2956----
2957 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
2958----
2959
2960As response a link:#change-info[ChangeInfo] entity with
2961link:#detailed-labels[detailed labels] and link:#detailed-accounts[
2962detailed accounts] is returned that describes the review of the
2963revision. The revision for which the review is retrieved is contained
2964in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05002965set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002966revision of the change. Please note that the returned labels are always
2967for the current patch set.
2968
2969.Response
2970----
2971 HTTP/1.1 200 OK
2972 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002973 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002974
2975 )]}'
2976 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002977 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2978 "project": "myProject",
2979 "branch": "master",
2980 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2981 "subject": "Implementing Feature X",
2982 "status": "NEW",
2983 "created": "2013-02-01 09:59:32.126000000",
2984 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002985 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01002986 "insertions": 34,
2987 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002988 "_number": 3965,
2989 "owner": {
2990 "_account_id": 1000096,
2991 "name": "John Doe",
2992 "email": "john.doe@example.com"
2993 },
2994 "labels": {
2995 "Verified": {
2996 "all": [
2997 {
2998 "value": 0,
2999 "_account_id": 1000096,
3000 "name": "John Doe",
3001 "email": "john.doe@example.com"
3002 },
3003 {
3004 "value": 0,
3005 "_account_id": 1000097,
3006 "name": "Jane Roe",
3007 "email": "jane.roe@example.com"
3008 }
3009 ],
3010 "values": {
3011 "-1": "Fails",
3012 " 0": "No score",
3013 "+1": "Verified"
3014 }
3015 },
3016 "Code-Review": {
3017 "all": [
3018 {
3019 "value": -1,
3020 "_account_id": 1000096,
3021 "name": "John Doe",
3022 "email": "john.doe@example.com"
3023 },
3024 {
3025 "value": 1,
3026 "_account_id": 1000097,
3027 "name": "Jane Roe",
3028 "email": "jane.roe@example.com"
3029 }
3030 ]
3031 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +04003032 "-2": "This shall not be merged",
3033 "-1": "I would prefer this is not merged as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003034 " 0": "No score",
3035 "+1": "Looks good to me, but someone else must approve",
3036 "+2": "Looks good to me, approved"
3037 }
3038 }
3039 },
3040 "permitted_labels": {
3041 "Verified": [
3042 "-1",
3043 " 0",
3044 "+1"
3045 ],
3046 "Code-Review": [
3047 "-2",
3048 "-1",
3049 " 0",
3050 "+1",
3051 "+2"
3052 ]
3053 },
3054 "removable_reviewers": [
3055 {
3056 "_account_id": 1000096,
3057 "name": "John Doe",
3058 "email": "john.doe@example.com"
3059 },
3060 {
3061 "_account_id": 1000097,
3062 "name": "Jane Roe",
3063 "email": "jane.roe@example.com"
3064 }
3065 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08003066 "reviewers": {
3067 "REVIEWER": [
3068 {
3069 "_account_id": 1000096,
3070 "name": "John Doe",
3071 "email": "john.doe@example.com"
3072 },
3073 {
3074 "_account_id": 1000097,
3075 "name": "Jane Roe",
3076 "email": "jane.roe@example.com"
3077 }
3078 ]
3079 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003080 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
3081 "revisions": {
3082 "674ac754f91e64a0efb8087e59a176484bd534d1": {
David Pursehouse4de41112016-06-28 09:24:08 +09003083 "kind": "REWORK",
3084 "_number": 2,
3085 "ref": "refs/changes/65/3965/2",
3086 "fetch": {
3087 "http": {
3088 "url": "http://gerrit/myProject",
3089 "ref": "refs/changes/65/3965/2"
3090 }
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01003091 }
3092 }
3093 }
3094 }
3095----
3096
David Pursehouse669f2512014-07-18 11:41:42 +09003097[[get-related-changes]]
3098=== Get Related Changes
3099--
3100'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
3101--
3102
3103Retrieves related changes of a revision. Related changes are changes that either
3104depend on, or are dependencies of the revision.
3105
3106.Request
3107----
3108 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
3109----
3110
3111As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
3112describing the related changes.
3113
3114.Response
3115----
3116 HTTP/1.1 200 OK
3117 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003118 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09003119
3120 )]}'
3121 {
3122 "changes": [
3123 {
3124 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
3125 "commit": {
3126 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
3127 "parents": [
3128 {
3129 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
3130 }
3131 ],
3132 "author": {
3133 "name": "David Ostrovsky",
3134 "email": "david@ostrovsky.org",
3135 "date": "2014-07-12 15:04:24.000000000",
3136 "tz": 120
3137 },
3138 "subject": "Remove Solr"
3139 },
3140 "_change_number": 58478,
3141 "_revision_number": 2,
3142 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003143 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003144 },
3145 {
3146 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
3147 "commit": {
3148 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
3149 "parents": [
3150 {
3151 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
3152 }
3153 ],
3154 "author": {
3155 "name": "David Pursehouse",
3156 "email": "david.pursehouse@sonymobile.com",
3157 "date": "2014-06-24 02:01:28.000000000",
3158 "tz": 540
3159 },
3160 "subject": "Add support for secondary index with Elasticsearch"
3161 },
3162 "_change_number": 58081,
3163 "_revision_number": 10,
3164 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07003165 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09003166 }
3167 ]
3168 }
3169----
3170
3171
Edwin Kempin67498de2013-02-25 16:15:34 +01003172[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003173=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003174--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003175'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003176--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003177
Edwin Kempin67498de2013-02-25 16:15:34 +01003178Sets a review on a revision.
3179
3180The review must be provided in the request body as a
3181link:#review-input[ReviewInput] entity.
3182
3183.Request
3184----
3185 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003186 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003187
3188 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01003189 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01003190 "message": "Some nits need to be fixed.",
3191 "labels": {
3192 "Code-Review": -1
3193 },
3194 "comments": {
3195 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3196 {
3197 "line": 23,
3198 "message": "[nit] trailing whitespace"
3199 },
3200 {
3201 "line": 49,
3202 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09003203 },
3204 {
3205 "range": {
3206 "start_line": 50,
3207 "start_character": 0,
3208 "end_line": 55,
3209 "end_character": 20
3210 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09003211 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01003212 }
3213 ]
3214 }
3215 }
3216----
3217
3218As response a link:#review-info[ReviewInfo] entity is returned that
3219describes the applied labels.
3220
3221.Response
3222----
3223 HTTP/1.1 200 OK
3224 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003225 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01003226
3227 )]}'
3228 {
3229 "labels": {
3230 "Code-Review": -1
3231 }
3232 }
3233----
3234
Edwin Kempind0febd32015-01-07 10:27:31 +01003235A review cannot be set on a change edit. Trying to post a review for a
3236change edit fails with `409 Conflict`.
3237
Logan Hanks5f1c7592016-07-06 14:39:33 -07003238It is also possible to add one or more reviewers to a change simultaneously
3239with a review.
3240
3241.Request
3242----
3243 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
3244 Content-Type: application/json; charset=UTF-8
3245
3246 {
3247 "message": "Looks good to me, but Jane and John should also take a look.",
3248 "labels": {
3249 "Code-Review": 1
3250 },
3251 "reviewers": [
3252 {
3253 "reviewer": "jane.roe@example.com"
3254 },
3255 {
3256 "reviewer": "john.doe@example.com"
3257 }
3258 ]
3259 }
3260----
3261
3262Each element of the `reviewers` list is an instance of
3263link:#reviewer-input[ReviewerInput]. The corresponding result of
3264adding each reviewer will be returned in a list of
Logan Hankse2aacef2016-07-22 15:54:52 -07003265link:#add-reviewer-result[AddReviewerResult].
Logan Hanks5f1c7592016-07-06 14:39:33 -07003266
3267.Response
3268----
3269 HTTP/1.1 200 OK
3270 Content-Disposition: attachment
3271 Content-Type: application/json; charset=UTF-8
3272
3273 )]}'
3274 {
3275 "labels": {
3276 "Code-Review": 1
3277 },
3278 "reviewers": [
3279 {
3280 "input": "jane.roe@example.com",
3281 "approvals": {
3282 "Verified": " 0",
3283 "Code-Review": " 0"
3284 },
3285 "_account_id": 1000097,
3286 "name": "Jane Roe",
3287 "email": "jane.roe@example.com"
3288 },
3289 {
3290 "input": "john.doe@example.com",
3291 "approvals": {
3292 "Verified": " 0",
3293 "Code-Review": " 0"
3294 },
3295 "_account_id": 1000096,
3296 "name": "John Doe",
3297 "email": "john.doe@example.com"
3298 }
3299 ]
3300 }
3301----
3302
Logan Hankse2aacef2016-07-22 15:54:52 -07003303If there are any errors returned for reviewers, the entire review request will
3304be rejected with `400 Bad Request`.
3305
3306.Error Response
3307----
3308 HTTP/1.1 400 Bad Request
3309 Content-Disposition: attachment
3310 Content-Type: application/json; charset=UTF-8
3311
3312 )]}'
3313 {
3314 "reviewers": {
3315 "MyProjectVerifiers": {
3316 "input": "MyProjectVerifiers",
3317 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
3318 "confirm": true
3319 }
3320 }
3321 }
3322----
3323
Edwin Kempincdae63b2013-03-15 15:06:59 +01003324[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003325=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003326--
Edwin Kempincdae63b2013-03-15 15:06:59 +01003327'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003328--
Edwin Kempincdae63b2013-03-15 15:06:59 +01003329
3330Rebases a revision.
3331
Zalan Blenessy874aed72015-01-12 13:26:18 +01003332Optionally, the parent revision can be changed to another patch set through the
3333link:#rebase-input[RebaseInput] entity.
3334
Edwin Kempincdae63b2013-03-15 15:06:59 +01003335.Request
3336----
3337 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01003338 Content-Type: application/json;charset=UTF-8
3339
3340 {
3341 "base" : "1234",
3342 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01003343----
3344
3345As response a link:#change-info[ChangeInfo] entity is returned that
3346describes the rebased change. Information about the current patch set
3347is included.
3348
3349.Response
3350----
3351 HTTP/1.1 200 OK
3352 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003353 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01003354
3355 )]}'
3356 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01003357 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
3358 "project": "myProject",
3359 "branch": "master",
3360 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
3361 "subject": "Implement Feature X",
3362 "status": "NEW",
3363 "created": "2013-02-01 09:59:32.126000000",
3364 "updated": "2013-02-21 11:16:36.775000000",
3365 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003366 "insertions": 21,
3367 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01003368 "_number": 4799,
3369 "owner": {
3370 "name": "John Doe"
3371 },
3372 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
3373 "revisions": {
3374 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09003375 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01003376 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01003377 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01003378 "fetch": {
3379 "http": {
3380 "url": "http://gerrit:8080/myProject",
3381 "ref": "refs/changes/99/4799/2"
3382 }
3383 },
3384 "commit": {
3385 "parents": [
3386 {
3387 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
3388 "subject": "Implement Feature A"
3389 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00003390 ],
3391 "author": {
3392 "name": "John Doe",
3393 "email": "john.doe@example.com",
3394 "date": "2013-05-07 15:21:27.000000000",
3395 "tz": 120
3396 },
3397 "committer": {
3398 "name": "Gerrit Code Review",
3399 "email": "gerrit-server@example.com",
3400 "date": "2013-05-07 15:35:43.000000000",
3401 "tz": 120
3402 },
3403 "subject": "Implement Feature X",
3404 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01003405 }
3406 }
3407 }
3408----
3409
3410If the revision cannot be rebased, e.g. due to conflicts, the response is
3411"`409 Conflict`" and the error message is contained in the response
3412body.
3413
3414.Response
3415----
3416 HTTP/1.1 409 Conflict
3417 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003418 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01003419
3420 The change could not be rebased due to a path conflict during merge.
3421----
3422
Edwin Kempin14b58112013-02-26 16:30:19 +01003423[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003424=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003425--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003426'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003427--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003428
Edwin Kempin14b58112013-02-26 16:30:19 +01003429Submits a revision.
3430
Edwin Kempin14b58112013-02-26 16:30:19 +01003431.Request
3432----
3433 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003434 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003435----
3436
3437As response a link:#submit-info[SubmitInfo] entity is returned that
3438describes the status of the submitted change.
3439
3440.Response
3441----
3442 HTTP/1.1 200 OK
3443 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003444 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003445
3446 )]}'
3447 {
3448 "status": "MERGED"
3449 }
3450----
3451
3452If the revision cannot be submitted, e.g. because the submit rule
3453doesn't allow submitting the revision or the revision is not the
3454current revision, the response is "`409 Conflict`" and the error
3455message is contained in the response body.
3456
3457.Response
3458----
3459 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003460 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003461
3462 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
3463----
3464
David Ostrovsky0d69c232013-09-10 23:10:23 +02003465[[publish-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003466=== Publish Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003467--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003468'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003469--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003470
3471Publishes a draft revision.
3472
3473.Request
3474----
3475 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/publish HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003476 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02003477----
3478
3479.Response
3480----
3481 HTTP/1.1 204 No Content
3482----
3483
3484[[delete-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003485=== Delete Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003486--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003487'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003488--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003489
3490Deletes a draft revision.
3491
3492.Request
3493----
3494 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003495 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02003496----
3497
3498.Response
3499----
3500 HTTP/1.1 204 No Content
3501----
3502
Edwin Kempin257d70f2013-03-28 14:31:14 +01003503[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003504=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003505--
Edwin Kempin257d70f2013-03-28 14:31:14 +01003506'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003507--
Edwin Kempin257d70f2013-03-28 14:31:14 +01003508
3509Gets the formatted patch for one revision.
3510
3511.Request
3512----
3513 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
3514----
3515
Shawn Pearce98361f72013-05-10 16:27:36 -07003516The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01003517
3518.Response
3519----
3520 HTTP/1.1 200 OK
3521 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003522 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07003523 X-FYI-Content-Encoding: base64
3524 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01003525
Shawn Pearce98361f72013-05-10 16:27:36 -07003526 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01003527----
3528
David Ostrovsky973f38b2013-08-22 00:24:51 -07003529Adding query parameter `zip` (for example `/changes/.../patch?zip`)
3530returns the patch as a single file inside of a ZIP archive. Clients
3531can expand the ZIP to obtain the plain text patch, avoiding the
3532need for a base64 decoding step. This option implies `download`.
3533
3534Query parameter `download` (e.g. `/changes/.../patch?download`)
3535will suggest the browser save the patch as `commitsha1.diff.base64`,
3536for later processing by command line tools.
3537
Kasper Nilsson81448072016-10-17 15:04:33 -07003538If the `path` parameter is set, the returned content is a diff of the single
3539file that the path refers to.
3540
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07003541[[submit-preview]]
Edwin Kempin807eb4b2016-10-18 15:49:41 +02003542=== Submit Preview
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07003543--
3544'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/preview_submit'
3545--
3546Gets a file containing thin bundles of all modified projects if this
3547change was submitted. The bundles are named `${ProjectName}.git`.
3548Each thin bundle contains enough to construct the state in which a project would
3549be in if this change were submitted. The base of the thin bundles are the
3550current target branches, so to make use of this call in a non-racy way, first
3551get the bundles and then fetch all projects contained in the bundle.
3552(This assumes no non-fastforward pushes).
3553
3554You need to give a parameter '?format=zip' or '?format=tar' to specify the
Stefan Beller3e586742016-10-05 15:23:22 -07003555format for the outer container. It is always possible to use tgz, even if
3556tgz is not in the list of allowed archive formats.
Stefan Bellerdfa1ef32016-09-16 12:20:02 -07003557
3558To make good use of this call, you would roughly need code as found at:
3559----
3560 $ curl -Lo preview_submit_test.sh http://review.example.com:8080/tools/scripts/preview_submit_test.sh
3561----
3562.Request
3563----
3564 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/preview_submit?zip HTTP/1.0
3565----
3566
3567.Response
3568----
3569 HTTP/1.1 200 OK
3570 Date: Tue, 13 Sep 2016 19:13:46 GMT
3571 Content-Disposition: attachment; filename="submit-preview-147.zip"
3572 X-Content-Type-Options: nosniff
3573 Cache-Control: no-cache, no-store, max-age=0, must-revalidate
3574 Pragma: no-cache
3575 Expires: Mon, 01 Jan 1990 00:00:00 GMT
3576 Content-Type: application/x-zip
3577 Transfer-Encoding: chunked
3578
3579 [binary stuff]
3580----
3581
3582In case of an error, the response is not a zip file but a regular json response,
3583containing only the error message:
3584
3585.Response
3586----
3587 HTTP/1.1 200 OK
3588 Content-Disposition: attachment
3589 Content-Type: application/json; charset=UTF-8
3590
3591 )]}'
3592 "Anonymous users cannot submit"
3593----
3594
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003595[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003596=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003597--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003598'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003599--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003600
3601Gets the method the server will use to submit (merge) the change and
3602an indicator if the change is currently mergeable.
3603
3604.Request
3605----
3606 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
3607----
3608
Saša Živkov499873f2014-05-05 13:34:18 +02003609As response a link:#mergeable-info[MergeableInfo] entity is returned.
3610
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003611.Response
3612----
3613 HTTP/1.1 200 OK
3614 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003615 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003616
3617 )]}'
3618 {
3619 submit_type: "MERGE_IF_NECESSARY",
Zhen Chenf7d85ea2016-05-02 15:14:43 -07003620 strategy: "recursive",
3621 mergeable: true
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003622 }
3623----
3624
Saša Živkov697cab22014-04-29 16:46:50 +02003625If the `other-branches` parameter is specified, the mergeability will also be
Zhen Chen6729b632016-11-11 17:32:32 -08003626checked for all other branches which are listed in the
3627link:config-project-config.html#branchOrder-section[branchOrder] section in the
3628project.config file.
Saša Živkov697cab22014-04-29 16:46:50 +02003629
3630.Request
3631----
3632 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
3633----
3634
3635The response will then contain a list of all other branches where this changes
3636could merge cleanly.
3637
3638.Response
3639----
3640 HTTP/1.1 200 OK
3641 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003642 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02003643
3644 )]}'
3645 {
3646 submit_type: "MERGE_IF_NECESSARY",
3647 mergeable: true,
3648 mergeable_into: [
3649 "refs/heads/stable-2.7",
3650 "refs/heads/stable-2.8",
3651 ]
3652 }
3653----
3654
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003655[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003656=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003657--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003658'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003659--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003660
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003661Gets the method the server will use to submit (merge) the change.
3662
3663.Request
3664----
3665 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
3666----
3667
3668.Response
3669----
3670 HTTP/1.1 200 OK
3671 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003672 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003673
3674 )]}'
3675 "MERGE_IF_NECESSARY"
3676----
3677
3678[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003679=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003680--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003681'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003682--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003683
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003684Tests the submit_type Prolog rule in the project, or the one given.
3685
3686Request body may be either the Prolog code as `text/plain` or a
3687link:#rule-input[RuleInput] object. The query parameter `filters`
3688may be set to `SKIP` to bypass parent project filters while testing
3689a project-specific rule.
3690
3691.Request
3692----
3693 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003694 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003695
3696 submit_type(cherry_pick).
3697----
3698
3699.Response
3700----
3701 HTTP/1.1 200 OK
3702 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003703 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003704
3705 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07003706 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003707----
3708
3709[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003710=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003711--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003712'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003713--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003714
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003715Tests the submit_rule Prolog rule in the project, or the one given.
3716
3717Request body may be either the Prolog code as `text/plain` or a
3718link:#rule-input[RuleInput] object. The query parameter `filters`
3719may be set to `SKIP` to bypass parent project filters while testing
3720a project-specific rule.
3721
3722.Request
3723----
Shawn Pearcea3cce712014-03-21 08:16:11 -07003724 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003725 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003726
3727 submit_rule(submit(R)) :-
3728 R = label('Any-Label-Name', reject(_)).
3729----
3730
3731The response is a list of link:#submit-record[SubmitRecord] entries
3732describing the permutations that satisfy the tested submit rule.
3733
3734.Response
3735----
3736 HTTP/1.1 200 OK
3737 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003738 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003739
3740 )]}'
3741 [
3742 {
3743 "status": "NOT_READY",
3744 "reject": {
3745 "Any-Label-Name": {}
3746 }
3747 }
3748 ]
3749----
3750
Shawn Pearceb42e3032015-04-02 10:28:10 -07003751When testing with the `curl` command line client the
3752`--data-binary @rules.pl` flag should be used to ensure
3753all LFs are included in the Prolog code:
3754
3755----
3756 curl -X POST \
3757 -H 'Content-Type: text/plain; charset=UTF-8' \
3758 --data-binary @rules.pl \
3759 http://.../test.submit_rule
3760----
3761
Edwin Kempincb6724a2013-02-26 16:58:51 +01003762[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07003763=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003764--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003765'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003766--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003767
Edwin Kempin3ca57192013-02-27 07:44:01 +01003768Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01003769user.
3770
Dave Borowitz23fec2b2015-04-28 17:40:07 -07003771Returns a map of file paths to lists of link:#comment-info[CommentInfo]
3772entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01003773
3774.Request
3775----
3776 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
3777----
3778
3779.Response
3780----
3781 HTTP/1.1 200 OK
3782 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003783 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01003784
3785 )]}'
3786 {
3787 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3788 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01003789 "id": "TvcXrmjM",
3790 "line": 23,
3791 "message": "[nit] trailing whitespace",
3792 "updated": "2013-02-26 15:40:43.986000000"
3793 },
3794 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01003795 "id": "TveXwFiA",
3796 "line": 49,
3797 "in_reply_to": "TfYX-Iuo",
3798 "message": "Done",
3799 "updated": "2013-02-26 15:40:45.328000000"
3800 }
3801 ]
3802 }
3803----
3804
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003805[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003806=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003807--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003808'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003809--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003810
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003811Creates a draft comment on a revision.
3812
3813The new draft comment must be provided in the request body inside a
3814link:#comment-input[CommentInput] entity.
3815
3816.Request
3817----
3818 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003819 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003820
3821 {
3822 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3823 "line": 23,
3824 "message": "[nit] trailing whitespace"
3825 }
3826----
3827
3828As response a link:#comment-info[CommentInfo] entity is returned that
3829describes the draft comment.
3830
3831.Response
3832----
3833 HTTP/1.1 200 OK
3834 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003835 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003836
3837 )]}'
3838 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003839 "id": "TvcXrmjM",
3840 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3841 "line": 23,
3842 "message": "[nit] trailing whitespace",
3843 "updated": "2013-02-26 15:40:43.986000000"
3844 }
3845----
3846
Edwin Kempin3ca57192013-02-27 07:44:01 +01003847[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003848=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003849--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003850'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 -08003851--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003852
Edwin Kempin3ca57192013-02-27 07:44:01 +01003853Retrieves a draft comment of a revision that belongs to the calling
3854user.
3855
3856.Request
3857----
3858 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
3859----
3860
3861As response a link:#comment-info[CommentInfo] entity is returned that
3862describes the draft comment.
3863
3864.Response
3865----
3866 HTTP/1.1 200 OK
3867 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003868 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01003869
3870 )]}'
3871 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01003872 "id": "TvcXrmjM",
3873 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3874 "line": 23,
3875 "message": "[nit] trailing whitespace",
3876 "updated": "2013-02-26 15:40:43.986000000"
3877 }
3878----
3879
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003880[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003881=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003882--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003883'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 -08003884--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003885
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003886Updates a draft comment on a revision.
3887
3888The new draft comment must be provided in the request body inside a
3889link:#comment-input[CommentInput] entity.
3890
3891.Request
3892----
3893 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003894 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003895
3896 {
3897 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3898 "line": 23,
3899 "message": "[nit] trailing whitespace"
3900 }
3901----
3902
3903As response a link:#comment-info[CommentInfo] entity is returned that
3904describes the draft comment.
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
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003911
3912 )]}'
3913 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003914 "id": "TvcXrmjM",
3915 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3916 "line": 23,
3917 "message": "[nit] trailing whitespace",
3918 "updated": "2013-02-26 15:40:43.986000000"
3919 }
3920----
3921
3922[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003923=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003924--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003925'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 -08003926--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003927
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003928Deletes a draft comment from a revision.
3929
3930.Request
3931----
3932 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
3933----
3934
3935.Response
3936----
3937 HTTP/1.1 204 No Content
3938----
3939
John Spurlock5e402f02013-03-24 11:35:04 -04003940[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07003941=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003942--
John Spurlock5e402f02013-03-24 11:35:04 -04003943'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003944--
John Spurlock5e402f02013-03-24 11:35:04 -04003945
3946Lists the published comments of a revision.
3947
3948As result a map is returned that maps the file path to a list of
3949link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07003950sorted by file path and only include file (or inline) comments. Use
3951the link:#get-change-detail[Get Change Detail] endpoint to retrieve
3952the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04003953
3954.Request
3955----
3956 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
3957----
3958
3959.Response
3960----
3961 HTTP/1.1 200 OK
3962 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003963 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04003964
3965 )]}'
3966 {
3967 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3968 {
John Spurlock5e402f02013-03-24 11:35:04 -04003969 "id": "TvcXrmjM",
3970 "line": 23,
3971 "message": "[nit] trailing whitespace",
3972 "updated": "2013-02-26 15:40:43.986000000",
3973 "author": {
3974 "_account_id": 1000096,
3975 "name": "John Doe",
3976 "email": "john.doe@example.com"
3977 }
3978 },
3979 {
John Spurlock5e402f02013-03-24 11:35:04 -04003980 "id": "TveXwFiA",
3981 "line": 49,
3982 "in_reply_to": "TfYX-Iuo",
3983 "message": "Done",
3984 "updated": "2013-02-26 15:40:45.328000000",
3985 "author": {
3986 "_account_id": 1000097,
3987 "name": "Jane Roe",
3988 "email": "jane.roe@example.com"
3989 }
3990 }
3991 ]
3992 }
3993----
3994
3995[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003996=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003997--
John Spurlock5e402f02013-03-24 11:35:04 -04003998'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 -08003999--
John Spurlock5e402f02013-03-24 11:35:04 -04004000
4001Retrieves a published comment of a revision.
4002
4003.Request
4004----
4005 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
4006----
4007
4008As response a link:#comment-info[CommentInfo] entity is returned that
4009describes the published comment.
4010
4011.Response
4012----
4013 HTTP/1.1 200 OK
4014 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004015 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04004016
4017 )]}'
4018 {
John Spurlock5e402f02013-03-24 11:35:04 -04004019 "id": "TvcXrmjM",
4020 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4021 "line": 23,
4022 "message": "[nit] trailing whitespace",
4023 "updated": "2013-02-26 15:40:43.986000000",
4024 "author": {
4025 "_account_id": 1000096,
4026 "name": "John Doe",
4027 "email": "john.doe@example.com"
4028 }
4029 }
4030----
4031
Edwin Kempinb050a482016-12-01 09:11:19 +01004032[[list-robot-comments]]
Edwin Kempin3fde7e42016-09-19 15:35:10 +02004033=== List Robot Comments
4034--
4035'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/'
4036--
4037
4038Lists the link:config-robot-comments.html[robot comments] of a
4039revision.
4040
4041As result a map is returned that maps the file path to a list of
4042link:#robot-comment-info[RobotCommentInfo] entries. The entries in the
4043map are sorted by file path.
4044
4045.Request
4046----
4047 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/ HTTP/1.0
4048----
4049
4050.Response
4051----
4052 HTTP/1.1 200 OK
4053 Content-Disposition: attachment
4054 Content-Type: application/json; charset=UTF-8
4055
4056 )]}'
4057 {
4058 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
4059 {
4060 "id": "TvcXrmjM",
4061 "line": 23,
4062 "message": "unused import",
4063 "updated": "2016-02-26 15:40:43.986000000",
4064 "author": {
4065 "_account_id": 1000110,
4066 "name": "Code Analyzer",
4067 "email": "code.analyzer@example.com"
4068 },
4069 "robotId": "importChecker",
4070 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
4071 },
4072 {
4073 "id": "TveXwFiA",
4074 "line": 49,
4075 "message": "wrong indention",
4076 "updated": "2016-02-26 15:40:45.328000000",
4077 "author": {
4078 "_account_id": 1000110,
4079 "name": "Code Analyzer",
4080 "email": "code.analyzer@example.com"
4081 },
4082 "robotId": "styleChecker",
4083 "robotRunId": "5c606c425dd45184484f9d0a2ffd725a7607839b"
4084 }
4085 ]
4086 }
4087----
4088
4089[[get-robot-comment]]
4090=== Get Robot Comment
4091--
4092'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/robotcomments/link:#comment-id[\{comment-id\}]'
4093--
4094
4095Retrieves a link:config-robot-comments.html[robot comment] of a
4096revision.
4097
4098.Request
4099----
4100 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/robotcomments/TvcXrmjM HTTP/1.0
4101----
4102
4103As response a link:#robot-comment-info[RobotCommentInfo] entity is
4104returned that describes the robot comment.
4105
4106.Response
4107----
4108 HTTP/1.1 200 OK
4109 Content-Disposition: attachment
4110 Content-Type: application/json; charset=UTF-8
4111
4112 )]}'
4113 {
4114 "id": "TvcXrmjM",
4115 "line": 23,
4116 "message": "unused import",
4117 "updated": "2016-02-26 15:40:43.986000000",
4118 "author": {
4119 "_account_id": 1000110,
4120 "name": "Code Analyzer",
4121 "email": "code.analyzer@example.com"
4122 },
4123 "robotId": "importChecker",
4124 "robotRunId": "76b1375aa8626ea7149792831fe2ed85e80d9e04"
4125 }
4126----
4127
Edwin Kempin682ac712013-05-14 13:40:46 +02004128[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004129=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004130--
Edwin Kempin682ac712013-05-14 13:40:46 +02004131'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004132--
Edwin Kempin682ac712013-05-14 13:40:46 +02004133
4134Lists the files that were modified, added or deleted in a revision.
4135
Edwin Kempin8fd96b92016-12-05 16:39:03 +01004136In addition the following magic files are included:
4137
4138* `/COMMIT_MSG`:
4139+
4140The commit message and headers with the parent commit(s), the author
4141information and the committer information.
4142
4143* `/MERGE_LIST` (for merge commits only):
4144+
4145The list of commits that are being integrated into the destination
4146branch by submitting the merge commit.
4147
Edwin Kempin682ac712013-05-14 13:40:46 +02004148.Request
4149----
4150 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
4151----
4152
4153As result a map is returned that maps the file path to a list of
4154link:#file-info[FileInfo] entries. The entries in the map are
4155sorted by file path.
4156
4157.Response
4158----
4159 HTTP/1.1 200 OK
4160 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004161 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02004162
4163 )]}'
4164 {
4165 "/COMMIT_MSG": {
4166 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02004167 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01004168 "size_delta": 551,
4169 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02004170 },
4171 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
4172 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02004173 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01004174 "size_delta": 98,
4175 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02004176 }
4177 }
4178----
4179
Shawn Pearce984747d2013-07-18 00:42:16 -07004180The request parameter `reviewed` changes the response to return a list
4181of the paths the caller has marked as reviewed. Clients that also
4182need the FileInfo should make two requests.
4183
Shawn Pearce8ca03a62015-01-02 22:03:20 -08004184The request parameter `q` changes the response to return a list
4185of all files (modified or unmodified) that contain that substring
4186in the path name. This is useful to implement suggestion services
4187finding a file by partial name.
4188
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01004189The integer-valued request parameter `parent` changes the response to return a
4190list of the files which are different in this commit compared to the given
4191parent commit. This is useful for supporting review of merge commits. The value
4192is the 1-based index of the parent's position in the commit object.
4193
Shawn Pearce984747d2013-07-18 00:42:16 -07004194.Request
4195----
4196 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
4197----
4198
4199.Response
4200----
4201 HTTP/1.1 200 OK
4202 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004203 Content-Type: application/json; charset=UTF-8
Shawn Pearce984747d2013-07-18 00:42:16 -07004204
4205 )]}'
4206 [
4207 "/COMMIT_MSG",
4208 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4209 ]
4210----
4211
Edwin Kempinaef44b02013-05-07 16:15:55 +02004212[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004213=== Get Content
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004214--
Edwin Kempinbea55a52013-05-14 13:53:39 +02004215'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 -08004216--
Edwin Kempinaef44b02013-05-07 16:15:55 +02004217
4218Gets the content of a file from a certain revision.
4219
4220.Request
4221----
4222 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
4223----
4224
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05004225The content is returned as base64 encoded string. The HTTP response
4226Content-Type is always `text/plain`, reflecting the base64 wrapping.
4227A Gerrit-specific `X-FYI-Content-Type` header is returned describing
4228the server detected content type of the file.
4229
4230If only the content type is required, callers should use HEAD to
4231avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02004232
4233.Response
4234----
4235 HTTP/1.1 200 OK
4236 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05004237 Content-Type: text/plain; charset=ISO-8859-1
4238 X-FYI-Content-Encoding: base64
4239 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02004240
4241 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
4242----
4243
David Ostrovskyd0078672015-02-06 21:51:04 +01004244Alternatively, if the only value of the Accept request header is
4245`application/json` the content is returned as JSON string and
4246`X-FYI-Content-Encoding` is set to `json`.
4247
David Pletcherd1efb452015-09-01 17:45:55 -07004248[[get-safe-content]]
4249=== Download Content
4250--
4251'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
4252--
4253
4254Downloads the content of a file from a certain revision, in a safe format
4255that poses no risk for inadvertent execution of untrusted code.
4256
4257If the content type is defined as safe, the binary file content is returned
4258verbatim. If the content type is not safe, the file is stored inside a ZIP
4259file, containing a single entry with a random, unpredictable name having the
4260same base and suffix as the true filename. The ZIP file is returned in
4261verbatim binary form.
4262
4263See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
4264for information about safe file type configuration.
4265
4266The HTTP resource Content-Type is dependent on the file type: the
4267applicable type for safe files, or "application/zip" for unsafe files.
4268
David Pletcherec622bf2015-09-18 14:30:05 -07004269The optional, integer-valued `parent` parameter can be specified to request
4270the named file from a parent commit of the specified revision. The value is
4271the 1-based index of the parent's position in the commit object. If the
4272parameter is omitted or the value non-positive, the patch set is referenced.
4273
4274Filenames are decorated with a suffix of `_new` for the current patch,
4275`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07004276
4277.Request
4278----
David Pursehouse6147f6d2016-10-18 05:40:44 +00004279 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/download HTTP/1.0
David Pletcherd1efb452015-09-01 17:45:55 -07004280----
4281
4282.Response
4283----
4284 HTTP/1.1 200 OK
4285 Content-Disposition: attachment; filename="logo.png"
4286 Content-Type: image/png
4287
4288 `[binary data for logo.png]`
4289----
4290
4291.Request
4292----
David Pursehouse6147f6d2016-10-18 05:40:44 +00004293 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 -07004294----
4295
4296.Response
4297----
4298 HTTP/1.1 200 OK
4299 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
4300 Content-Type:application/zip
4301
4302 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
4303----
4304
David Pursehouse882aef22013-06-05 10:56:37 +09004305[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004306=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004307--
David Pursehouse882aef22013-06-05 10:56:37 +09004308'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 -08004309--
David Pursehouse882aef22013-06-05 10:56:37 +09004310
4311Gets the diff of a file from a certain revision.
4312
4313.Request
4314----
4315 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
4316----
4317
4318As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
4319
4320.Response
4321----
4322 HTTP/1.1 200 OK
4323 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004324 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09004325
4326 )]
4327 {
4328 "meta_a": {
4329 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004330 "content_type": "text/x-java-source",
4331 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09004332 },
4333 "meta_b": {
4334 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004335 "content_type": "text/x-java-source",
4336 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09004337 },
4338 "change_type": "MODIFIED",
4339 "diff_header": [
4340 "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",
4341 "index 59b7670..9faf81c 100644",
4342 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4343 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
4344 ],
4345 "content": [
4346 {
4347 "ab": [
4348 "// Copyright (C) 2010 The Android Open Source Project",
4349 "//",
4350 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
4351 "// you may not use this file except in compliance with the License.",
4352 "// You may obtain a copy of the License at",
4353 "//",
4354 "// http://www.apache.org/licenses/LICENSE-2.0",
4355 "//",
4356 "// Unless required by applicable law or agreed to in writing, software",
4357 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
4358 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
4359 "// See the License for the specific language governing permissions and",
4360 "// limitations under the License."
4361 ]
4362 },
4363 {
4364 "b": [
4365 "//",
4366 "// Add some more lines in the header."
4367 ]
4368 },
4369 {
4370 "ab": [
4371 "",
4372 "package com.google.gerrit.server.project;",
4373 "",
4374 "import com.google.common.collect.Maps;",
4375 ...
4376 ]
4377 }
4378 ...
4379 ]
4380 }
4381----
4382
4383If the `intraline` parameter is specified, intraline differences are included in the diff.
4384
4385.Request
4386----
4387 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
4388----
4389
4390.Response
4391----
4392 HTTP/1.1 200 OK
4393 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004394 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09004395
4396 )]
4397 {
4398 "meta_a": {
4399 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004400 "content_type": "text/x-java-source",
4401 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09004402 },
4403 "meta_b": {
4404 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004405 "content_type": "text/x-java-source",
4406 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09004407 },
4408 "change_type": "MODIFIED",
4409 "diff_header": [
4410 "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",
4411 "index 59b7670..9faf81c 100644",
4412 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
4413 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
4414 ],
4415 "content": [
4416 ...
4417 {
4418 "a": [
4419 "/** Manages access control for Git references (aka branches, tags). */"
4420 ],
4421 "b": [
4422 "/** Manages access control for the Git references (aka branches, tags). */"
4423 ],
4424 "edit_a": [],
4425 "edit_b": [
4426 [
4427 31,
4428 4
4429 ]
4430 ]
4431 }
4432 ]
4433 }
4434----
4435
4436The `base` parameter can be specified to control the base patch set from which the diff should
4437be generated.
4438
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01004439The integer-valued request parameter `parent` can be specified to control the
4440parent commit number against which the diff should be generated. This is useful
4441for supporting review of merge commits. The value is the 1-based index of the
4442parent's position in the commit object.
4443
Edwin Kempin8cdce502014-12-06 10:55:38 +01004444[[weblinks-only]]
4445If the `weblinks-only` parameter is specified, only the diff web links are returned.
4446
David Pursehouse882aef22013-06-05 10:56:37 +09004447.Request
4448----
4449 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
4450----
4451
4452.Response
4453----
4454 HTTP/1.1 200 OK
4455 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004456 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09004457
4458 )]
4459 {
4460 "meta_a": {
4461 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004462 "content_type": "text/x-java-source",
4463 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09004464 },
4465 "meta_b": {
4466 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08004467 "content_type": "text/x-java-source",
4468 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09004469 },
4470 "change_type": "MODIFIED",
4471 "content": [
4472 {
4473 "skip": 578
4474 }
4475 ]
4476 }
4477----
4478
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01004479The `whitespace` parameter can be specified to control how whitespace
4480differences are reported in the result. Valid values are `IGNORE_NONE`,
4481`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09004482
4483The `context` parameter can be specified to control the number of lines of surrounding context
4484in the diff. Valid values are `ALL` or number of lines.
4485
Gabor Somossyb72d4c62015-10-20 23:40:07 +01004486[[get-blame]]
4487=== Get Blame
4488--
4489'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
4490--
4491
4492Gets the blame of a file from a certain revision.
4493
4494.Request
4495----
4496 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
4497----
4498
4499As response a link:#blame-info[BlameInfo] entity is returned that describes the
4500blame.
4501
4502.Response
4503----
4504 HTTP/1.1 200 OK
4505 Content-Disposition: attachment
4506 Content-Type: application/json; charset=UTF-8
4507
4508 )]
4509 {
4510 [
4511 {
4512 "author": "Joe Daw",
4513 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
4514 "time": 1421441349,
4515 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
4516 "ranges": [
4517 {
4518 "start": 1,
4519 "end": 10
4520 },
4521 {
4522 "start": 16,
4523 "end": 296
4524 }
4525 ]
4526 },
4527 {
4528 "author": "Jane Daw",
4529 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
4530 "time": 1421825421,
4531 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
4532 "ranges": [
4533 {
4534 "start": 13,
4535 "end": 13
4536 }
4537 ]
4538 }
4539 ]
4540 }
4541----
4542
4543The `base` parameter can be specified to control the base patch set from which
4544the blame should be generated.
4545
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004546[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004547=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004548--
Edwin Kempinbea55a52013-05-14 13:53:39 +02004549'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 -08004550--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004551
Edwin Kempinbea55a52013-05-14 13:53:39 +02004552Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004553
4554.Request
4555----
4556 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
4557----
4558
4559.Response
4560----
4561 HTTP/1.1 201 Created
4562----
4563
Edwin Kempinbea55a52013-05-14 13:53:39 +02004564If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004565response is "`200 OK`".
4566
4567[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004568=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004569--
Edwin Kempinbea55a52013-05-14 13:53:39 +02004570'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 -08004571--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004572
Edwin Kempinbea55a52013-05-14 13:53:39 +02004573Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004574
4575.Request
4576----
4577 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
4578----
4579
4580.Response
4581----
4582 HTTP/1.1 204 No Content
4583----
4584
Gustaf Lundh019fb262012-11-28 14:20:22 +01004585[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004586=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004587--
Gustaf Lundh019fb262012-11-28 14:20:22 +01004588'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004589--
Gustaf Lundh019fb262012-11-28 14:20:22 +01004590
4591Cherry picks a revision to a destination branch.
4592
4593The commit message and destination branch must be provided in the request body inside a
4594link:#cherrypick-input[CherryPickInput] entity.
4595
4596.Request
4597----
4598 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004599 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01004600
4601 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01004602 "message" : "Implementing Feature X",
4603 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01004604 }
4605----
4606
4607As response a link:#change-info[ChangeInfo] entity is returned that
4608describes the resulting cherry picked change.
4609
4610.Response
4611----
4612 HTTP/1.1 200 OK
4613 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004614 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01004615
4616 )]}'
4617 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01004618 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
4619 "project": "myProject",
4620 "branch": "release-branch",
4621 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
4622 "subject": "Implementing Feature X",
4623 "status": "NEW",
4624 "created": "2013-02-01 09:59:32.126000000",
4625 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01004626 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004627 "insertions": 12,
4628 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01004629 "_number": 3965,
4630 "owner": {
4631 "name": "John Doe"
4632 }
4633 }
4634----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01004635
David Pursehoused9dac372016-11-24 19:41:10 +09004636[[get-hashtags]]
4637=== Get Hashtags
4638--
4639'GET /changes/link:#change-id[\{change-id\}]/hashtags'
4640--
4641
4642Gets the hashtags associated with a change.
4643
4644[NOTE] Hashtags are only available when NoteDb is enabled.
4645
4646.Request
4647----
4648 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
4649----
4650
4651As response the change's hashtags are returned as a list of strings.
4652
4653.Response
4654----
4655 HTTP/1.1 200 OK
4656 Content-Disposition: attachment
4657 Content-Type: application/json; charset=UTF-8
4658
4659 )]}'
4660 [
4661 "hashtag1",
4662 "hashtag2"
4663 ]
4664----
4665
4666[[set-hashtags]]
4667=== Set Hashtags
4668--
4669'POST /changes/link:#change-id[\{change-id\}]/hashtags'
4670--
4671
4672Adds and/or removes hashtags from a change.
4673
4674[NOTE] Hashtags are only available when NoteDb is enabled.
4675
4676The hashtags to add or remove must be provided in the request body inside a
4677link:#hashtags-input[HashtagsInput] entity.
4678
4679.Request
4680----
4681 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/hashtags HTTP/1.0
4682 Content-Type: application/json; charset=UTF-8
4683
4684 {
4685 "add" : [
4686 "hashtag3"
4687 ],
4688 "remove" : [
4689 "hashtag2"
4690 ]
4691 }
4692----
4693
4694As response the change's hashtags are returned as a list of strings.
4695
4696.Response
4697----
4698 HTTP/1.1 200 OK
4699 Content-Disposition: attachment
4700 Content-Type: application/json; charset=UTF-8
4701
4702 )]}'
4703 [
4704 "hashtag1",
4705 "hashtag3"
4706 ]
4707----
4708
Edwin Kempinff9e6e32013-02-21 13:07:11 +01004709[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004710== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01004711
Edwin Kempina3d02ef2013-02-22 16:31:53 +01004712[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004713=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01004714--
4715--
4716
Edwin Kempinff9e6e32013-02-21 13:07:11 +01004717[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004718=== \{change-id\}
Edwin Kempinff9e6e32013-02-21 13:07:11 +01004719Identifier that uniquely identifies one change.
4720
4721This can be:
4722
4723* an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'",
4724 where for the branch the `refs/heads/` prefix can be omitted
4725 ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$")
4726* a Change-Id if it uniquely identifies one change
4727 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
4728* a legacy numeric change ID ("4247")
4729
John Spurlock5e402f02013-03-24 11:35:04 -04004730[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004731=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04004732UUID of a published comment.
4733
Edwin Kempin3ca57192013-02-27 07:44:01 +01004734[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004735=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01004736UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01004737
David Ostrovskybeb0b842014-12-13 00:24:29 +01004738[[label-id]]
4739=== \{label-id\}
4740The name of the label.
4741
Edwin Kempinbea55a52013-05-14 13:53:39 +02004742[[file-id]]
4743\{file-id\}
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004744~~~~~~~~~~~~
Edwin Kempinbea55a52013-05-14 13:53:39 +02004745The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004746
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004747[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004748=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004749Identifier that uniquely identifies one revision of a change.
4750
4751This can be:
4752
Shawn Pearce9c0722a2013-03-02 15:30:31 -08004753* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004754* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
4755* an abbreviated commit ID that uniquely identifies one revision of the
4756 change ("674ac754"), at least 4 digits are required
4757* a legacy numeric patch number ("1" for first patch set of the change)
Edwin Kempin8cc0bab2016-09-15 15:53:37 +02004758* "0" or the literal `edit` for a change edit
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004759
Edwin Kempine3446292013-02-19 16:40:14 +01004760[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004761== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01004762
Edwin Kempined5364b2013-02-22 10:39:33 +01004763[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004764=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01004765The `AbandonInput` entity contains information for abandoning a change.
4766
David Pursehouseae367192014-11-25 17:24:47 +09004767[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01004768|===========================
4769|Field Name ||Description
4770|`message` |optional|
4771Message to be added as review comment to the change when abandoning the
4772change.
Stephen Lie5fcdf72016-08-02 11:05:11 -07004773|`notify` |optional|
4774Notify handling that defines to whom email notifications should be sent after
4775the change is abandoned. +
4776Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
4777If not set, the default is `ALL`.
Edwin Kempined5364b2013-02-22 10:39:33 +01004778|===========================
4779
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07004780[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004781=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07004782The `ActionInfo` entity describes a REST API call the client can
4783make to manipulate a resource. These are frequently implemented by
4784plugins and may be discovered at runtime.
4785
David Pursehouseae367192014-11-25 17:24:47 +09004786[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07004787|====================================
4788|Field Name ||Description
4789|`method` |optional|
4790HTTP method to use with the action. Most actions use `POST`, `PUT`
4791or `DELETE` to cause state changes.
4792|`label` |optional|
4793Short title to display to a user describing the action. In the
4794Gerrit web interface the label is used as the text on the button
4795presented in the UI.
4796|`title` |optional|
4797Longer text to display describing the action. In a web UI this
4798should be the title attribute of the element, displaying when
4799the user hovers the mouse.
4800|`enabled` |optional|
4801If true the action is permitted at this time and the caller is
4802likely allowed to execute it. This may change if state is updated
4803at the server or permissions are modified. Not present if false.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07004804|====================================
4805
Edwin Kempin392328e2013-02-25 12:50:03 +01004806[[add-reviewer-result]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004807=== AddReviewerResult
Edwin Kempin392328e2013-02-25 12:50:03 +01004808The `AddReviewerResult` entity describes the result of adding a
4809reviewer to a change.
4810
David Pursehouseae367192014-11-25 17:24:47 +09004811[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01004812|===========================
4813|Field Name ||Description
Logan Hanks23e70282016-07-06 14:31:56 -07004814|`input` ||
4815Value of the `reviewer` field from link:#reviewer-input[ReviewerInput]
4816set while adding the reviewer.
Edwin Kempin392328e2013-02-25 12:50:03 +01004817|`reviewers` |optional|
4818The newly added reviewers as a list of link:#reviewer-info[
4819ReviewerInfo] entities.
Logan Hanksee0a4182016-07-06 14:39:26 -07004820|`ccs` |optional|
4821The newly CCed accounts as a list of link:#reviewer-info[
4822ReviewerInfo] entities. This field will only appear if the requested
4823`state` for the reviewer was `CC` *and* NoteDb is enabled on the
4824server.
Edwin Kempin392328e2013-02-25 12:50:03 +01004825|`error` |optional|
4826Error message explaining why the reviewer could not be added. +
4827If a group was specified in the input and an error is returned, it
4828means that none of the members were added as reviewer.
4829|`confirm` |`false` if not set|
4830Whether adding the reviewer requires confirmation.
4831|===========================
4832
Edwin Kempine3446292013-02-19 16:40:14 +01004833[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004834=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004835The `ApprovalInfo` entity contains information about an approval from a
4836user for a label on a change.
4837
Edwin Kempin963dfd02013-02-27 12:39:32 +01004838`ApprovalInfo` has the same fields as
4839link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01004840In addition `ApprovalInfo` has the following fields:
4841
David Pursehouseae367192014-11-25 17:24:47 +09004842[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004843|===========================
Oleg Aravinbf313bb2016-10-24 12:28:56 -07004844|Field Name ||Description
4845|`value` |optional|
Dave Borowitza30db912013-03-22 14:20:33 -07004846The vote that the user has given for the label. If present and zero, the
4847user is permitted to vote on the label. If absent, the user is not
4848permitted to vote on that label.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07004849|`permitted_voting_range` |optional|
4850The link:#voting-range-info[VotingRangeInfo] the user is authorized to vote
4851on that label. If present, the user is permitted to vote on the label
4852regarding the range values. If absent, the user is not permitted to vote
4853on that label.
4854|`date` |optional|
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01004855The time and date describing when the approval was made.
Oleg Aravinbf313bb2016-10-24 12:28:56 -07004856|`tag` |optional|
Dariusz Lukszac70e8622016-03-15 14:05:51 +01004857Value of the `tag` field from link:#review-input[ReviewInput] set
4858while posting the review.
4859NOTE: To apply different tags on on different votes/comments multiple
4860invocations of the REST call are required.
Dave Borowitze47fe472016-09-09 13:57:14 -04004861|`post_submit` |not set if `false`|
4862If true, this vote was made after the change was submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01004863|===========================
4864
Sven Selberg273a4aa2016-09-21 16:28:10 +02004865[[assignee-input]]
4866=== AssigneeInput
4867The `AssigneeInput` entity contains the identity of the user to be set as assignee.
4868
4869[options="header",cols="1,^1,5"]
4870|===========================
4871|Field Name ||Description
4872|`assignee` ||
4873The link:rest-api-accounts.html#account-id[ID] of one account that
4874should be added as assignee.
4875|===========================
4876
Gabor Somossyb72d4c62015-10-20 23:40:07 +01004877[[blame-info]]
4878=== BlameInfo
4879The `BlameInfo` entity stores the commit metadata with the row coordinates where
4880it applies.
4881
4882[options="header",cols="1,6"]
4883|===========================
4884|Field Name | Description
4885|`author` | The author of the commit.
4886|`id` | The id of the commit.
4887|`time` | Commit time.
4888|`commit_msg` | The commit message.
4889|`ranges` |
4890The blame row coordinates as link:#range-info[RangeInfo] entities.
4891|===========================
4892
Edwin Kempin521c1242015-01-23 12:44:44 +01004893[[change-edit-input]]
4894=== ChangeEditInput
4895The `ChangeEditInput` entity contains information for restoring a
4896path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02004897
Edwin Kempin521c1242015-01-23 12:44:44 +01004898[options="header",cols="1,^1,5"]
4899|===========================
4900|Field Name ||Description
4901|`restore_path`|optional|Path to file to restore.
4902|`old_path` |optional|Old path to file to rename.
4903|`new_path` |optional|New path to file to rename.
4904|===========================
4905
4906[[change-edit-message-input]]
4907=== ChangeEditMessageInput
4908The `ChangeEditMessageInput` entity contains information for changing
4909the commit message within a change edit.
4910
4911[options="header",cols="1,^1,5"]
4912|===========================
4913|Field Name ||Description
4914|`message` ||New commit message.
4915|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02004916
Edwin Kempine3446292013-02-19 16:40:14 +01004917[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004918=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004919The `ChangeInfo` entity contains information about a change.
4920
David Pursehouseae367192014-11-25 17:24:47 +09004921[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004922|==================================
4923|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01004924|`id` ||
4925The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
John Spurlockd25fad12013-03-09 11:48:49 -05004926where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the
Edwin Kempine3446292013-02-19 16:40:14 +01004927`refs/heads/` prefix is omitted.
4928|`project` ||The name of the project.
4929|`branch` ||
4930The name of the target branch. +
4931The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01004932|`topic` |optional|The topic to which this change belongs.
Edwin Kempine3446292013-02-19 16:40:14 +01004933|`change_id` ||The Change-Id of the change.
4934|`subject` ||
4935The subject of the change (header line of the commit message).
4936|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07004937The status of the change (`NEW`, `MERGED`, `ABANDONED`, `DRAFT`).
Edwin Kempine3446292013-02-19 16:40:14 +01004938|`created` ||
4939The link:rest-api.html#timestamp[timestamp] of when the change was
4940created.
4941|`updated` ||
4942The link:rest-api.html#timestamp[timestamp] of when the change was last
4943updated.
Khai Do96a7caf2016-01-07 14:07:54 -08004944|`submitted` |only set for merged changes|
4945The link:rest-api.html#timestamp[timestamp] of when the change was
4946submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01004947|`starred` |not set if `false`|
Edwin Kempin9e972cc2016-04-15 10:39:13 +02004948Whether the calling user has starred this change with the default label.
4949|`stars` |optional|
4950A list of star labels that are applied by the calling user to this
4951change. The labels are lexicographically sorted.
Edwin Kempine3446292013-02-19 16:40:14 +01004952|`reviewed` |not set if `false`|
4953Whether the change was reviewed by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07004954Only set if link:#reviewed[reviewed] is requested.
Dave Borowitzace32102015-12-17 13:08:25 -05004955|`submit_type` |optional|
4956The link:project-configuration.html#submit_type[submit type] of the change. +
4957Not set for merged changes.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01004958|`mergeable` |optional|
4959Whether the change is mergeable. +
Dave Borowitze5fbeeb2014-06-27 09:47:49 -07004960Not set for merged changes, or if the change has not yet been tested.
Shawn Pearce4cd05b22016-09-17 22:45:33 -07004961|`submittable` |optional|
4962Whether the change has been approved by the project submit rules. +
Jonathan Niedercb51d742016-09-23 11:37:57 -07004963Only set if link:#submittable[requested].
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004964|`insertions` ||
4965Number of inserted lines.
4966|`deletions` ||
4967Number of deleted lines.
Edwin Kempine3446292013-02-19 16:40:14 +01004968|`_number` ||The legacy numeric ID of the change.
4969|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01004970The owner of the change as an link:rest-api-accounts.html#account-info[
4971AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07004972|`actions` |optional|
4973Actions the caller might be able to perform on this revision. The
4974information is a map of view name to link:#action-info[ActionInfo]
4975entities.
Edwin Kempine3446292013-02-19 16:40:14 +01004976|`labels` |optional|
4977The labels of the change as a map that maps the label names to
4978link:#label-info[LabelInfo] entries. +
4979Only set if link:#labels[labels] or link:#detailed-labels[detailed
4980labels] are requested.
4981|`permitted_labels` |optional|
4982A map of the permitted labels that maps a label name to the list of
4983values that are allowed for that label. +
4984Only set if link:#detailed-labels[detailed labels] are requested.
4985|`removable_reviewers`|optional|
4986The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01004987link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Edwin Kempine3446292013-02-19 16:40:14 +01004988Only set if link:#detailed-labels[detailed labels] are requested.
Edwin Kempin66af3d82015-11-10 17:38:40 -08004989|`reviewers` ||
4990The reviewers as a map that maps a reviewer state to a list of
4991link:rest-api-accounts.html#account-info[AccountInfo] entities.
4992Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
4993`REVIEWER`: Users with at least one non-zero vote on the change. +
4994`CC`: Users that were added to the change, but have not voted. +
4995`REMOVED`: Users that were previously reviewers on the change, but have
4996been removed. +
4997Only set if link:#detailed-labels[detailed labels] are requested.
Viktar Donich316bf7a2016-07-06 11:29:01 -07004998|`reviewer_updates`|optional|
4999Updates to reviewers set for the change as
5000link:#review-update-info[ReviewerUpdateInfo] entities.
5001Only set if link:#reviewer-updates[reviewer updates] are requested and
5002if NoteDb is enabled.
John Spurlock74a70cc2013-03-23 16:41:50 -04005003|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07005004Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04005005link:#change-message-info[ChangeMessageInfo] entities. +
5006Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005007|`current_revision` |optional|
5008The commit ID of the current patch set of this change. +
5009Only set if link:#current-revision[the current revision] is requested
5010or if link:#all-revisions[all revisions] are requested.
5011|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05005012All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01005013patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08005014Only set if link:#current-revision[the current revision] is requested
5015(in which case it will only contain a key for the current revision) or
5016if link:#all-revisions[all revisions] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005017|`_more_changes` |optional, not set if `false`|
5018Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08005019Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05005020|`problems` |optional|
5021A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08005022problems with this change. Only set if link:#check[CHECK] is set.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08005023|==================================
5024
5025[[change-input]]
5026=== ChangeInput
5027The `ChangeInput` entity contains information about creating a new change.
5028
5029[options="header",cols="1,^1,5"]
5030|==================================
5031|Field Name ||Description
5032|`project` ||The name of the project.
5033|`branch` ||
5034The name of the target branch. +
5035The `refs/heads/` prefix is omitted.
5036|`subject` ||
5037The subject of the change (header line of the commit message).
5038|`topic` |optional|The topic to which this change belongs.
5039|`status` |optional, default to `NEW`|
5040The status of the change (only `NEW` and `DRAFT` accepted here).
David Ostrovsky9d8ec422014-12-24 00:52:09 +01005041|`base_change` |optional|
5042A link:#change-id[\{change-id\}] that identifies the base change for a create
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08005043change operation.
5044|`new_branch` |optional, default to `false`|
5045Allow creating a new branch when set to `true`.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07005046|`merge` |optional|
5047The detail of a merge commit as a link:#merge-input[MergeInput] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01005048|==================================
5049
John Spurlock74a70cc2013-03-23 16:41:50 -04005050[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005051=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04005052The `ChangeMessageInfo` entity contains information about a message
5053attached to a change.
5054
David Pursehouseae367192014-11-25 17:24:47 +09005055[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04005056|==================================
5057|Field Name ||Description
5058|`id` ||The ID of the message.
5059|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07005060Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04005061link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5062Unset if written by the Gerrit system.
5063|`date` ||
5064The link:rest-api.html#timestamp[timestamp] this message was posted.
5065|`message` ||The text left by the user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005066|`tag` |optional|
5067Value of the `tag` field from link:#review-input[ReviewInput] set
5068while posting the review.
5069NOTE: To apply different tags on on different votes/comments multiple
5070invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04005071|`_revision_number` |optional|
5072Which patchset (if any) generated this message.
5073|==================================
5074
Gustaf Lundh019fb262012-11-28 14:20:22 +01005075[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005076=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01005077The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
5078
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005079[options="header",cols="1,^1,5"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01005080|===========================
Alice Kober-Sotzekf271c252016-10-12 13:13:54 +02005081|Field Name ||Description
5082|`message` ||Commit message for the cherry-picked change
5083|`destination` ||Destination branch
5084|`parent` |optional, defaults to 1|
5085Number of the parent relative to which the cherry-pick should be considered.
Gustaf Lundh019fb262012-11-28 14:20:22 +01005086|===========================
5087
Edwin Kempincb6724a2013-02-26 16:58:51 +01005088[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005089=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05005090The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005091
David Pursehouseae367192014-11-25 17:24:47 +09005092[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01005093|===========================
5094|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07005095|`patch_set` |optional|
5096The patch set number for the comment; only set in contexts where +
5097comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04005098|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005099|`path` |optional|
5100The path of the file for which the inline comment was done. +
5101Not set if returned in a map where the key is the file path.
5102|`side` |optional|
5103The side on which the comment was added. +
5104Allowed values are `REVISION` and `PARENT`. +
5105If not set, the default is `REVISION`.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01005106|`parent` |optional|
5107The 1-based parent number. Used only for merge commits when `side == PARENT`.
5108When not set the comment is for the auto-merge tree.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005109|`line` |optional|
5110The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04005111If range is set, this equals the end line of the range. +
5112If neither line nor range is set, it's a file comment.
5113|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09005114The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04005115entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005116|`in_reply_to` |optional|
5117The URL encoded UUID of the comment to which this comment is a reply.
5118|`message` |optional|The comment message.
5119|`updated` ||
5120The link:rest-api.html#timestamp[timestamp] of when this comment was
5121written.
John Spurlock5e402f02013-03-24 11:35:04 -04005122|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09005123The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04005124link:rest-api-accounts.html#account-info[AccountInfo] entity. +
5125Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005126|`tag` |optional|
5127Value of the `tag` field from link:#review-input[ReviewInput] set
5128while posting the review.
5129NOTE: To apply different tags on on different votes/comments multiple
5130invocations of the REST call are required.
Edwin Kempincb6724a2013-02-26 16:58:51 +01005131|===========================
5132
Edwin Kempin67498de2013-02-25 16:15:34 +01005133[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005134=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03005135The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01005136comment.
5137
David Pursehouseae367192014-11-25 17:24:47 +09005138[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01005139|===========================
5140|Field Name ||Description
5141|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01005142The URL encoded UUID of the comment if an existing draft comment should
5143be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005144|`path` |optional|
5145The path of the file for which the inline comment should be added. +
5146Doesn't need to be set if contained in a map where the key is the file
5147path.
Edwin Kempin67498de2013-02-25 16:15:34 +01005148|`side` |optional|
5149The side on which the comment should be added. +
5150Allowed values are `REVISION` and `PARENT`. +
5151If not set, the default is `REVISION`.
5152|`line` |optional|
5153The number of the line for which the comment should be added. +
5154`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04005155If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09005156If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04005157|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09005158The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04005159entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01005160|`in_reply_to` |optional|
5161The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01005162|`updated` |optional|
5163The link:rest-api.html#timestamp[timestamp] of this comment. +
5164Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01005165|`message` |optional|
5166The comment message. +
5167If not set and an existing draft comment is updated, the existing draft
5168comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04005169|`tag` |optional, drafts only|
5170Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
5171inputs; for published comments, use the `tag` field in +
5172link#review-input[ReviewInput]
Edwin Kempin67498de2013-02-25 16:15:34 +01005173|===========================
5174
Michael Zhou596c7682013-08-25 05:43:34 -04005175[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005176=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04005177The `CommentRange` entity describes the range of an inline comment.
5178
David Pursehouseae367192014-11-25 17:24:47 +09005179[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04005180|===========================
5181|Field Name ||Description
5182|`start_line` ||The start line number of the range.
5183|`start_character` ||The character position in the start line.
5184|`end_line` ||The end line number of the range.
5185|`end_character` ||The character position in the end line.
5186|===========================
5187
Edwin Kempine3446292013-02-19 16:40:14 +01005188[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005189=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005190The `CommitInfo` entity contains information about a commit.
5191
Edwin Kempinf0c57152015-07-15 18:18:24 +02005192[options="header",cols="1,^1,5"]
5193|===========================
5194|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02005195|`commit` |Optional|
5196The commit ID. Not set if included in a link:#revision-info[
5197RevisionInfo] entity that is contained in a map which has the commit ID
5198as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005199|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01005200The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02005201link:#commit-info[CommitInfo] entities. In each parent
5202only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005203|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01005204link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005205|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01005206link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005207|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01005208The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02005209|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01005210|`web_links` |optional|
5211Links to the commit in external sites as a list of
5212link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02005213|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01005214
Edwin Kempin407fca32016-08-29 12:01:00 +02005215[[delete-reviewer-input]]
5216=== DeleteReviewerInput
5217The `DeleteReviewerInput` entity contains options for the deletion of a
5218reviewer.
5219
5220[options="header",cols="1,^1,5"]
5221|=======================
5222|Field Name||Description
5223|`notify` |optional|
5224Notify handling that defines to whom email notifications should be sent
5225after the reviewer is deleted. +
5226Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5227If not set, the default is `ALL`.
5228|=======================
5229
Edwin Kempin1dfecb62016-06-16 10:45:00 +02005230[[delete-vote-input]]
5231=== DeleteVoteInput
5232The `DeleteVoteInput` entity contains options for the deletion of a
5233vote.
5234
5235[options="header",cols="1,^1,5"]
5236|=======================
5237|Field Name||Description
5238|`label` |optional|
5239The label for which the vote should be deleted. +
5240If set, must match the label in the URL.
5241|`notify` |optional|
5242Notify handling that defines to whom email notifications should be sent
5243after the vote is deleted. +
5244Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5245If not set, the default is `ALL`.
5246|=======================
5247
Kasper Nilsson9f2ed6a2016-11-15 11:12:37 -08005248[[description-input]]
5249=== DescriptionInput
5250The `DescriptionInput` entity contains information for setting a description.
5251
5252[options="header",cols="1,6"]
5253|===========================
5254|Field Name |Description
5255|`description` |The description text.
5256|===========================
5257
David Pursehouse882aef22013-06-05 10:56:37 +09005258[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005259=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09005260The `DiffContent` entity contains information about the content differences
5261in a file.
5262
David Pursehouseae367192014-11-25 17:24:47 +09005263[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09005264|==========================
5265|Field Name ||Description
5266|`a` |optional|Content only in the file on side A (deleted in B).
5267|`b` |optional|Content only in the file on side B (added in B).
5268|`ab` |optional|Content in the file on both sides (unchanged).
5269|`edit_a` |only present during a replace, i.e. both `a` and `b` are present|
5270Text sections deleted from side A as a
5271link:#diff-intraline-info[DiffIntralineInfo] entity.
5272|`edit_b` |only present during a replace, i.e. both `a` and `b` are present|
5273Text sections inserted in side B as a
5274link:#diff-intraline-info[DiffIntralineInfo] entity.
5275|`skip` |optional|count of lines skipped on both sides when the file is
5276too large to include all common lines.
Shawn Pearce425a2be2014-01-02 16:00:58 -08005277|`common` |optional|Set to `true` if the region is common according
5278to the requested ignore-whitespace parameter, but a and b contain
5279differing amounts of whitespace. When present and true a and b are
5280used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09005281|==========================
5282
5283[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005284=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09005285The `DiffFileMetaInfo` entity contains meta information about a file diff.
5286
David Pursehouseae367192014-11-25 17:24:47 +09005287[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09005288|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02005289|Field Name ||Description
5290|`name` ||The name of the file.
5291|`content_type`||The content type of the file.
5292|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01005293|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02005294Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07005295link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09005296|==========================
5297
5298[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005299=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09005300The `DiffInfo` entity contains information about the diff of a file
5301in a revision.
5302
Edwin Kempin8cdce502014-12-06 10:55:38 +01005303If the link:#weblinks-only[weblinks-only] parameter is specified, only
5304the `web_links` field is set.
5305
David Pursehouseae367192014-11-25 17:24:47 +09005306[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09005307|==========================
5308|Field Name ||Description
5309|`meta_a` |not present when the file is added|
5310Meta information about the file on side A as a
5311link:#diff-file-meta-info[DiffFileMetaInfo] entity.
5312|`meta_b` |not present when the file is deleted|
5313Meta information about the file on side B as a
5314link:#diff-file-meta-info[DiffFileMetaInfo] entity.
5315|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
5316`COPIED`, `REWRITE`).
5317|`intraline_status`|only set when the `intraline` parameter was specified in the request|
5318Intraline status (`OK`, `ERROR`, `TIMEOUT`).
5319|`diff_header` ||A list of strings representing the patch set diff header.
5320|`content` ||The content differences in the file as a list of
5321link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01005322|`web_links` |optional|
5323Links to the file diff in external sites as a list of
5324link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01005325|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09005326|==========================
5327
5328[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005329=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09005330The `DiffIntralineInfo` entity contains information about intraline edits in a
5331file.
5332
David Pursehouse31203f52013-06-08 17:05:45 +09005333The information consists of a list of `<skip length, mark length>` pairs, where
5334the skip length is the number of characters between the end of the previous edit
5335and the start of this edit, and the mark length is the number of edited characters
5336following the skip. The start of the edits is from the beginning of the related
5337diff content lines.
David Pursehouse882aef22013-06-05 10:56:37 +09005338
David Pursehouse31203f52013-06-08 17:05:45 +09005339Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07005340the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09005341
Edwin Kempin8cdce502014-12-06 10:55:38 +01005342[[diff-web-link-info]]
5343=== DiffWebLinkInfo
5344The `DiffWebLinkInfo` entity describes a link on a diff screen to an
5345external site.
5346
5347[options="header",cols="1,6"]
5348|=======================
5349|Field Name|Description
5350|`name` |The link name.
5351|`url` |The link URL.
5352|`image_url`|URL to the icon of the link.
5353|show_on_side_by_side_diff_view|
5354Whether the web link should be shown on the side-by-side diff screen.
5355|show_on_unified_diff_view|
5356Whether the web link should be shown on the unified diff screen.
5357|=======================
5358
David Ostrovsky9ea9c112015-01-25 00:12:38 +01005359[[edit-file-info]]
5360=== EditFileInfo
5361The `EditFileInfo` entity contains additional information
5362of a file within a change edit.
5363
5364[options="header",cols="1,^1,5"]
5365|===========================
5366|Field Name ||Description
5367|`web_links` |optional|
5368Links to the diff info in external sites as a list of
5369link:#web-link-info[WebLinkInfo] entities.
5370|===========================
5371
Edwin Kempin521c1242015-01-23 12:44:44 +01005372[[edit-info]]
5373=== EditInfo
5374The `EditInfo` entity contains information about a change edit.
5375
5376[options="header",cols="1,^1,5"]
5377|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04005378|Field Name ||Description
5379|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01005380link:#commit-info[CommitInfo] entity.
Michael Zhoud03fe282016-04-25 17:13:17 -04005381|`base_revision`||The revision of the patch set the change edit is based on.
5382|`fetch` ||
Edwin Kempin521c1242015-01-23 12:44:44 +01005383Information about how to fetch this patch set. The fetch information is
5384provided as a map that maps the protocol name ("`git`", "`http`",
5385"`ssh`") to link:#fetch-info[FetchInfo] entities.
Michael Zhoud03fe282016-04-25 17:13:17 -04005386|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01005387The files of the change edit as a map that maps the file names to
5388link:#file-info[FileInfo] entities.
5389|===========================
5390
Edwin Kempine3446292013-02-19 16:40:14 +01005391[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005392=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005393The `FetchInfo` entity contains information about how to fetch a patch
5394set via a certain protocol.
5395
David Pursehouseae367192014-11-25 17:24:47 +09005396[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005397|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02005398|Field Name ||Description
5399|`url` ||The URL of the project.
5400|`ref` ||The ref of the patch set.
5401|`commands` |optional|
5402The download commands for this patch set as a map that maps the command
5403names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09005404Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01005405|==========================
5406
5407[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005408=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005409The `FileInfo` entity contains information about a file in a patch set.
5410
David Pursehouseae367192014-11-25 17:24:47 +09005411[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005412|=============================
5413|Field Name ||Description
5414|`status` |optional|
5415The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
5416"`C`"=Copied, "`W`"=Rewritten). +
5417Not set if the file was Modified ("`M`").
5418|`binary` |not set if `false`|Whether the file is binary.
5419|`old_path` |optional|
5420The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05005421Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01005422|`lines_inserted`|optional|
5423Number of inserted lines. +
5424Not set for binary files or if no lines were inserted.
5425|`lines_deleted` |optional|
5426Number of deleted lines. +
5427Not set for binary files or if no lines were deleted.
Edwin Kempin640f9842015-10-08 15:53:20 +02005428|`size_delta` ||
5429Number of bytes by which the file size increased/decreased.
Edwin Kempin971a5f52015-10-28 10:50:39 +01005430|`size` ||
5431File size in bytes.
Edwin Kempine3446292013-02-19 16:40:14 +01005432|=============================
5433
Dave Borowitzbad53ee2015-06-11 10:10:18 -04005434[[fix-input]]
5435=== FixInput
5436The `FixInput` entity contains options for fixing commits using the
5437link:#fix-change[fix change] endpoint.
5438
5439[options="header",cols="1,6"]
5440|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07005441|Field Name |Description
5442|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04005443database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07005444|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07005445merged into the destination branch as this exact SHA-1. If not, insert
5446a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04005447|==========================
5448
Edwin Kempine3446292013-02-19 16:40:14 +01005449[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005450=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005451The `GitPersonInfo` entity contains information about the
5452author/committer of a commit.
5453
David Pursehouseae367192014-11-25 17:24:47 +09005454[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01005455|==========================
5456|Field Name |Description
5457|`name` |The name of the author/committer.
5458|`email` |The email address of the author/committer.
5459|`date` |The link:rest-api.html#timestamp[timestamp] of when
5460this identity was constructed.
5461|`tz` |The timezone offset from UTC of when this identity was
5462constructed.
5463|==========================
5464
Edwin Kempin521c1242015-01-23 12:44:44 +01005465[[group-base-info]]
5466=== GroupBaseInfo
5467The `GroupBaseInfo` entity contains base information about the group.
5468
5469[options="header",cols="1,6"]
5470|==========================
5471|Field Name |Description
Edwin Kempin703613c2016-11-25 16:06:04 +01005472|`id` |The UUID of the group.
Edwin Kempin521c1242015-01-23 12:44:44 +01005473|`name` |The name of the group.
5474|==========================
5475
David Pursehoused9dac372016-11-24 19:41:10 +09005476[[hashtags-input]]
5477=== HashtagsInput
5478
5479The `HashtagsInput` entity contains information about hashtags to add to,
5480and/or remove from, a change.
5481
5482[options="header",cols="1,^1,5"]
5483|=======================
5484|Field Name||Description
5485|`add` |optional|The list of hashtags to be added to the change.
5486|`remove |optional|The list of hashtags to be removed from the change.
5487|=======================
5488
Edwin Kempin521c1242015-01-23 12:44:44 +01005489[[included-in-info]]
5490=== IncludedInInfo
5491The `IncludedInInfo` entity contains information about the branches a
5492change was merged into and tags it was tagged with.
5493
Edwin Kempin78279ba2015-05-22 15:22:41 +02005494[options="header",cols="1,^1,5"]
5495|=======================
5496|Field Name||Description
5497|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01005498Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02005499|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01005500Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02005501|`external`|optional|A map that maps a name to a list of external
5502systems that include this change, e.g. a list of servers on which this
5503change is deployed.
5504|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01005505
Edwin Kempine3446292013-02-19 16:40:14 +01005506[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005507=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07005508The `LabelInfo` entity contains information about a label on a change, always
5509corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01005510
Dave Borowitz88159512013-06-14 14:21:50 -07005511There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07005512link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07005513
5514* For a quick summary of the state of labels, use `LABELS`.
5515* For detailed information about labels, including exact numeric votes for all
5516 users and the allowed range of votes for the current user, use `DETAILED_LABELS`.
5517
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005518==== Common fields
David Pursehouseae367192014-11-25 17:24:47 +09005519[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005520|===========================
5521|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01005522|`optional` |not set if `false`|
5523Whether the label is optional. Optional means the label may be set, but
5524it's neither necessary for submission nor does it block submission if
5525set.
Dave Borowitz88159512013-06-14 14:21:50 -07005526|===========================
5527
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005528==== Fields set by `LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09005529[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07005530|===========================
5531|Field Name ||Description
5532|`approved` |optional|One user who approved this label on the change
5533(voted the maximum value) as an
5534link:rest-api-accounts.html#account-info[AccountInfo] entity.
5535|`rejected` |optional|One user who rejected this label on the change
5536(voted the minimum value) as an
5537link:rest-api-accounts.html#account-info[AccountInfo] entity.
5538|`recommended` |optional|One user who recommended this label on the
5539change (voted positively, but not the maximum value) as an
5540link:rest-api-accounts.html#account-info[AccountInfo] entity.
5541|`disliked` |optional|One user who disliked this label on the change
5542(voted negatively, but not the minimum value) as an
5543link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01005544|`blocking` |optional|If `true`, the label blocks submit operation.
5545If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07005546|`value` |optional|The voting value of the user who
5547recommended/disliked this label on the change if it is not
5548"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07005549|`default_value`|optional|The default voting value for the label.
5550This value may be outside the range specified in permitted_labels.
Dave Borowitz88159512013-06-14 14:21:50 -07005551|===========================
5552
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005553==== Fields set by `DETAILED_LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09005554[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07005555|===========================
5556|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01005557|`all` |optional|List of all approvals for this label as a list
Dave Borowitz88159512013-06-14 14:21:50 -07005558of link:#approval-info[ApprovalInfo] entities.
Edwin Kempine3446292013-02-19 16:40:14 +01005559|`values` |optional|A map of all values that are allowed for this
5560label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07005561to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01005562|===========================
5563
Saša Živkov499873f2014-05-05 13:34:18 +02005564[[mergeable-info]]
5565=== MergeableInfo
5566The `MergeableInfo` entity contains information about the mergeability of a
5567change.
5568
David Pursehouseae367192014-11-25 17:24:47 +09005569[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02005570|============================
Saša Živkov697cab22014-04-29 16:46:50 +02005571|Field Name ||Description
5572|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02005573Submit type used for this change, can be `MERGE_IF_NECESSARY`,
5574`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
5575`CHERRY_PICK`.
Zhen Chenec13e452016-08-03 23:29:43 -07005576|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07005577The strategy of the merge, can be `recursive`, `resolve`,
5578`simple-two-way-in-core`, `ours` or `theirs`.
Saša Živkov697cab22014-04-29 16:46:50 +02005579|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02005580`true` if this change is cleanly mergeable, `false` otherwise
Zhen Chen8f00d552016-07-26 16:54:59 -07005581|`commit_merged` |optional|
5582`true` if this change is already merged, `false` otherwise
5583|`content_merged` |optional|
5584`true` if the content of this change is already merged, `false` otherwise
Zhen Chenf7d85ea2016-05-02 15:14:43 -07005585|`conflicts`|optional|
5586A list of paths with conflicts
Saša Živkov697cab22014-04-29 16:46:50 +02005587|`mergeable_into`|optional|
5588A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02005589|============================
Dave Borowitz88159512013-06-14 14:21:50 -07005590
Zhen Chenf7d85ea2016-05-02 15:14:43 -07005591[[merge-input]]
5592=== MergeInput
5593The `MergeInput` entity contains information about the merge
5594
5595[options="header",cols="1,^1,5"]
5596|============================
5597|Field Name ||Description
5598|`source` ||
5599The source to merge from, e.g. a complete or abbreviated commit SHA-1,
5600a complete reference name, a short reference name under refs/heads, refs/tags,
5601or refs/remotes namespace, etc.
5602|`strategy` |optional|
5603The strategy of the merge, can be `recursive`, `resolve`,
5604`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
5605|============================
5606
Zhen Chenb1e07e52016-09-23 12:59:48 -07005607[[merge-patch-set-input]]
5608=== MergePatchSetInput
5609The `MergePatchSetInput` entity contains information about updating a new
5610change by creating a new merge commit.
5611
5612[options="header",cols="1,^1,5"]
5613|==================================
5614|Field Name ||Description
5615|`subject` |optional|
5616The new subject for the change, if not specified, will reuse the current patch
5617set's subject
5618|`inheritParent` |optional, default to `false`|
5619Use the current patch set's first parent as the merge tip when set to `true`.
5620Otherwise, use the current branch tip of the destination branch.
5621|`merge` ||
5622The detail of the source commit for merge as a link:#merge-input[MergeInput]
5623entity.
5624|==================================
5625
Raviteja Sunkara791f3392015-11-03 13:24:50 +05305626[[move-input]]
5627=== MoveInput
5628The `MoveInput` entity contains information for moving a change to a new branch.
5629
5630[options="header",cols="1,^1,5"]
5631|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04005632|Field Name ||Description
5633|`destination_branch`||Destination branch
5634|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05305635A message to be posted in this change's comments
5636|===========================
5637
Edwin Kempin521c1242015-01-23 12:44:44 +01005638[[problem-info]]
5639=== ProblemInfo
5640The `ProblemInfo` entity contains a description of a potential consistency problem
5641with a change. These are not related to the code review process, but rather
5642indicate some inconsistency in Gerrit's database or repository metadata related
5643to the enclosing change.
5644
5645[options="header",cols="1,^1,5"]
5646|===========================
5647|Field Name||Description
5648|`message` ||Plaintext message describing the problem with the change.
5649|`status` |optional|
5650The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
5651fix was attempted.
5652|`outcome` |optional|
5653If `status` is set, an additional plaintext message describing the
5654outcome of the fix.
5655|===========================
5656
Andrii Shyshkalov2fa8a062016-09-08 15:42:07 +02005657[[publish-change-edit-input]]
5658=== PublishChangeEditInput
5659The `PublishChangeEditInput` entity contains options for the publishing of
5660change edit.
5661
5662[options="header",cols="1,^1,5"]
5663|=======================
5664|Field Name||Description
5665|`notify` |optional|
5666Notify handling that defines to whom email notifications should be sent
5667after the change edit is published. +
5668Allowed values are `NONE` and `ALL`. +
5669If not set, the default is `ALL`.
5670|=======================
5671
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04005672[[push-certificate-info]]
5673=== PushCertificateInfo
5674The `PushCertificateInfo` entity contains information about a push
5675certificate provided when the user pushed for review with `git push
5676--signed HEAD:refs/for/<branch>`. Only used when signed push is
5677link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
5678
5679[options="header",cols="1,6"]
5680|===========================
5681|Field Name|Description
5682|`certificate`|Signed certificate payload and GPG signature block.
5683|`key` |
5684Information about the key that signed the push, along with any problems
5685found while checking the signature or the key itself, as a
5686link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
5687|===========================
5688
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005689[[range-info]]
5690=== RangeInfo
5691The `RangeInfo` entity stores the coordinates of a range.
5692
5693[options="header",cols="1,6"]
5694|===========================
5695|Field Name | Description
5696|`start` | First index.
5697|`end` | Last index.
5698|===========================
5699
Zalan Blenessy874aed72015-01-12 13:26:18 +01005700[[rebase-input]]
5701=== RebaseInput
5702The `RebaseInput` entity contains information for changing parent when rebasing.
5703
5704[options="header",width="50%",cols="1,^1,5"]
5705|===========================
5706|Field Name ||Description
5707|`base` |optional|
5708The new parent revision. This can be a ref or a SHA1 to a concrete patchset. +
5709Alternatively, a change number can be specified, in which case the current
5710patch set is inferred. +
5711Empty string is used for rebasing directly on top of the target branch,
5712which effectively breaks dependency towards a parent change.
5713|===========================
5714
Edwin Kempin521c1242015-01-23 12:44:44 +01005715[[related-change-and-commit-info]]
5716=== RelatedChangeAndCommitInfo
5717
5718The `RelatedChangeAndCommitInfo` entity contains information about
5719a related change and commit.
5720
5721[options="header",cols="1,^1,5"]
5722|===========================
5723|Field Name ||Description
5724|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01005725|`commit` ||The commit as a
5726link:#commit-info[CommitInfo] entity.
5727|`_change_number` |optional|The change number.
5728|`_revision_number` |optional|The revision number.
5729|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07005730|`status` |optional|The status of the change. The status of
Stefan Beller0d3cab02015-07-10 13:32:57 -07005731the change is one of (`NEW`, `MERGED`, `ABANDONED`, `DRAFT`).
Edwin Kempin521c1242015-01-23 12:44:44 +01005732|===========================
5733
5734[[related-changes-info]]
5735=== RelatedChangesInfo
5736The `RelatedChangesInfo` entity contains information about related
5737changes.
5738
5739[options="header",cols="1,6"]
5740|===========================
5741|Field Name |Description
5742|`changes` |A list of
5743link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
5744describing the related changes. Sorted by git commit order, newest to
5745oldest. Empty if there are no related changes.
5746|===========================
5747
Edwin Kempined5364b2013-02-22 10:39:33 +01005748[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005749=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01005750The `RestoreInput` entity contains information for restoring a change.
5751
David Pursehouseae367192014-11-25 17:24:47 +09005752[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01005753|===========================
5754|Field Name ||Description
5755|`message` |optional|
5756Message to be added as review comment to the change when restoring the
5757change.
5758|===========================
5759
Edwin Kempind2ec4152013-02-22 12:17:19 +01005760[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005761=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01005762The `RevertInput` entity contains information for reverting a change.
5763
David Pursehouseae367192014-11-25 17:24:47 +09005764[options="header",cols="1,^1,5"]
Edwin Kempind2ec4152013-02-22 12:17:19 +01005765|===========================
5766|Field Name ||Description
5767|`message` |optional|
5768Message to be added as review comment to the change when reverting the
5769change.
5770|===========================
5771
Edwin Kempin67498de2013-02-25 16:15:34 +01005772[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005773=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01005774The `ReviewInfo` entity contains information about a review.
5775
David Pursehouseae367192014-11-25 17:24:47 +09005776[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01005777|===========================
5778|Field Name |Description
5779|`labels` |
5780The labels of the review as a map that maps the label names to the
5781voting values.
5782|===========================
5783
Viktar Donich316bf7a2016-07-06 11:29:01 -07005784[[review-update-info]]
5785=== ReviewerUpdateInfo
5786The `ReviewerUpdateInfo` entity contains information about updates to
5787change's reviewers set.
5788
5789[options="header",cols="1,6"]
5790|===========================
5791|Field Name |Description
5792|`updated`|
5793Timestamp of the update.
5794|`updated_by`|
5795The account which modified state of the reviewer in question as
5796link:rest-api-accounts.html#account-info[AccountInfo] entity.
5797|`reviewer`|
5798The reviewer account added or removed from the change as an
5799link:rest-api-accounts.html#account-info[AccountInfo] entity.
5800|`state`|
5801The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`.
5802|===========================
5803
Edwin Kempin67498de2013-02-25 16:15:34 +01005804[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005805=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01005806The `ReviewInput` entity contains information for adding a review to a
5807revision.
5808
David Pursehouseae367192014-11-25 17:24:47 +09005809[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01005810|============================
Bill Wendling692b4ec2015-10-19 15:40:57 -07005811|Field Name ||Description
5812|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01005813The message to be added as review comment.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005814|`tag` |optional|
5815Apply this tag to the review comment message, votes, and inline
5816comments. Tags may be used by CI or other automated systems to
5817distinguish them from human reviews. Comments with specific tag
5818values can be filtered out in the web UI.
Bill Wendling692b4ec2015-10-19 15:40:57 -07005819|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01005820The votes that should be added to the revision as a map that maps the
5821label names to the voting values.
Bill Wendling692b4ec2015-10-19 15:40:57 -07005822|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01005823The comments that should be added as a map that maps a file path to a
5824list of link:#comment-input[CommentInput] entities.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005825|`robot_comments` |optional|
5826The robot comments that should be added as a map that maps a file path
5827to a list of link:#robot-comment-input[RobotCommentInput] entities.
Bill Wendling692b4ec2015-10-19 15:40:57 -07005828|`strict_labels` |`true` if not set|
John Spurlockd25fad12013-03-09 11:48:49 -05005829Whether all labels are required to be within the user's permitted ranges
Edwin Kempin67498de2013-02-25 16:15:34 +01005830based on access controls. +
5831If `true`, attempting to use a label not granted to the user will fail
5832the entire modify operation early. +
5833If `false`, the operation will execute anyway, but the proposed labels
5834will be modified to be the "best" value allowed by the access controls.
Bill Wendling692b4ec2015-10-19 15:40:57 -07005835|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01005836Draft handling that defines how draft comments are handled that are
5837already in the database but that were not also described in this
5838input. +
David Ostrovsky8a1da032014-07-25 10:57:35 +02005839Allowed values are `DELETE`, `PUBLISH`, `PUBLISH_ALL_REVISIONS` and
5840`KEEP`. All values except `PUBLISH_ALL_REVISIONS` operate only on drafts
5841for a single revision. +
Dave Borowitzc0640542016-10-05 16:19:21 -04005842Only `KEEP` is allowed when used in conjunction with `on_behalf_of`. +
5843If not set, the default is `DELETE`, unless `on_behalf_of` is set, in
5844which case the default is `KEEP` and any other value is disallowed.
Bill Wendling692b4ec2015-10-19 15:40:57 -07005845|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01005846Notify handling that defines to whom email notifications should be sent
5847after the review is stored. +
5848Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5849If not set, the default is `ALL`.
Bill Wendling692b4ec2015-10-19 15:40:57 -07005850|`omit_duplicate_comments`|optional|
5851If `true`, comments with the same content at the same place will be omitted.
5852|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07005853link:rest-api-accounts.html#account-id[\{account-id\}] the review
5854should be posted on behalf of. To use this option the caller must
5855have been granted `labelAs-NAME` permission for all keys of labels.
Edwin Kempin67498de2013-02-25 16:15:34 +01005856|============================
5857
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01005858[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005859=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01005860The `ReviewerInfo` entity contains information about a reviewer and its
5861votes on a change.
5862
Edwin Kempin963dfd02013-02-27 12:39:32 +01005863`ReviewerInfo` has the same fields as
5864link:rest-api-accounts.html#account-info[AccountInfo] and includes
5865link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01005866In addition `ReviewerInfo` has the following fields:
5867
David Pursehouseae367192014-11-25 17:24:47 +09005868[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01005869|==========================
5870|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01005871|`approvals` |
5872The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09005873approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01005874|==========================
5875
Edwin Kempin392328e2013-02-25 12:50:03 +01005876[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005877=== ReviewerInput
Edwin Kempin392328e2013-02-25 12:50:03 +01005878The `ReviewerInput` entity contains information for adding a reviewer
5879to a change.
5880
David Pursehouseae367192014-11-25 17:24:47 +09005881[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01005882|===========================
5883|Field Name ||Description
5884|`reviewer` ||
5885The link:rest-api-accounts.html#account-id[ID] of one account that
5886should be added as reviewer or the link:rest-api-groups.html#group-id[
5887ID] of one group for which all members should be added as reviewers. +
5888If an ID identifies both an account and a group, only the account is
5889added as reviewer to the change.
Logan Hanksee0a4182016-07-06 14:39:26 -07005890|`state` |optional|
5891Add reviewer in this state. Possible reviewer states are `REVIEWER`
5892and `CC`. If not given, defaults to `REVIEWER`.
Edwin Kempin392328e2013-02-25 12:50:03 +01005893|`confirmed` |optional|
5894Whether adding the reviewer is confirmed. +
5895The Gerrit server may be configured to
5896link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
5897confirmation] when adding a group as reviewer that has many members.
Sven Selberg4d64f972016-09-26 16:15:02 +02005898|`notify` |optional|
5899Notify handling that defines to whom email notifications should be sent
5900after the reviewer is added. +
5901Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5902If not set, the default is `ALL`.
Edwin Kempin392328e2013-02-25 12:50:03 +01005903|===========================
5904
Edwin Kempine3446292013-02-19 16:40:14 +01005905[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005906=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005907The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07005908Not all fields are returned by default. Additional fields can
5909be obtained by adding `o` parameters as described in
5910link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01005911
David Pursehouseae367192014-11-25 17:24:47 +09005912[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005913|===========================
5914|Field Name ||Description
5915|`draft` |not set if `false`|Whether the patch set is a draft.
David Pursehouse4de41112016-06-28 09:24:08 +09005916|`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`,
5917`MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`.
Edwin Kempine3446292013-02-19 16:40:14 +01005918|`_number` ||The patch set number.
Edwin Kempin04cbd342015-02-19 16:31:22 +01005919|`created` ||
5920The link:rest-api.html#timestamp[timestamp] of when the patch set was
5921created.
5922|`uploader` ||
5923The uploader of the patch set as an
5924link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempin4569ced2014-11-25 16:45:05 +01005925|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01005926|`fetch` ||
5927Information about how to fetch this patch set. The fetch information is
5928provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07005929"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
5930only included if a plugin implementing the
5931link:intro-project-owner.html#download-commands[download commands]
5932interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07005933|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01005934link:#commit-info[CommitInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07005935|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01005936The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07005937link:#file-info[FileInfo] entities. Only set if
5938link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
5939option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07005940|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005941Actions the caller might be able to perform on this revision. The
5942information is a map of view name to link:#action-info[ActionInfo]
5943entities.
Khai Dob3139b7532014-09-19 15:13:04 -07005944|`reviewed` |optional|
5945Indicates whether the caller is authenticated and has commented on the
5946current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07005947|`messageWithFooter` |optional|
5948If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
5949this is the current patch set, contains the full commit message with
5950Gerrit-specific commit footers, as if this revision were submitted
5951using the link:project-configuration.html#cherry_pick[Cherry Pick]
5952submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04005953|`push_certificate` |optional|
5954If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
5955contains the push certificate provided by the user when uploading this
5956patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
5957This field is always set if the option is requested; if no push
5958certificate was provided, it is set to an empty object.
Edwin Kempine3446292013-02-19 16:40:14 +01005959|===========================
5960
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005961[[robot-comment-info]]
5962=== RobotCommentInfo
5963The `RobotCommentInfo` entity contains information about a robot inline
5964comment.
5965
5966`RobotCommentInfo` has the same fields as link:#[CommentInfo].
5967In addition `RobotCommentInfo` has the following fields:
5968
5969[options="header",cols="1,^1,5"]
5970|===========================
5971|Field Name ||Description
5972|`robot_id` ||The ID of the robot that generated this comment.
5973|`robot_run_id` ||An ID of the run of the robot.
5974|`url` |optional|URL to more information.
Edwin Kempin66270742016-09-28 15:57:36 +02005975|`properties` |optional|
5976Robot specific properties as map that maps arbitrary keys to values.
Edwin Kempin3fde7e42016-09-19 15:35:10 +02005977|===========================
5978
5979[[robot-comment-input]]
5980=== RobotCommentInput
5981The `RobotCommentInput` entity contains information for creating an inline
5982robot comment.
5983
5984`RobotCommentInput` has the same fields as link:#[RobotCommentInfo].
5985
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005986[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005987=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005988The `RuleInput` entity contains information to test a Prolog rule.
5989
David Pursehouseae367192014-11-25 17:24:47 +09005990[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005991|===========================
5992|Field Name ||Description
5993|`rule`||
5994Prolog code to execute instead of the code in `refs/meta/config`.
5995|`filters`|`RUN` if not set|
5996When `RUN` filter rules in the parent projects are called to
5997post-process the results of the project specific rule. This
5998behavior matches how the rule will execute if installed. +
5999If `SKIP` the parent filters are not called, allowing the test
6000to return results from the input rule.
6001|===========================
6002
Edwin Kempin14b58112013-02-26 16:30:19 +01006003[[submit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006004=== SubmitInfo
Edwin Kempin14b58112013-02-26 16:30:19 +01006005The `SubmitInfo` entity contains information about the change status
6006after submitting.
6007
Stefan Bellere4785b42015-06-18 12:31:03 -07006008[options="header",cols="1,^1,5"]
Edwin Kempin14b58112013-02-26 16:30:19 +01006009|==========================
Stefan Bellere4785b42015-06-18 12:31:03 -07006010|Field Name ||Description
6011|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07006012The status of the change after submitting is `MERGED`.
David Ostrovsky868e3412014-01-30 19:50:57 +01006013|`on_behalf_of`|optional|
6014The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on
6015whose behalf the action should be done. To use this option the caller must
David Pursehouse22bd6f92014-02-20 21:11:01 +09006016have been granted both `Submit` and `Submit (On Behalf Of)` permissions.
6017The user named by `on_behalf_of` does not need to be granted the `Submit`
6018permission. This feature is aimed for CI solutions: the CI account can be
David Pursehousea61ee502016-09-06 16:27:09 +09006019granted both permissions, so individual users don't need `Submit` permission
6020themselves. Still the changes can be submitted on behalf of real users and
David Pursehouse22bd6f92014-02-20 21:11:01 +09006021not with the identity of the CI account.
Edwin Kempin14b58112013-02-26 16:30:19 +01006022|==========================
6023
Edwin Kempin0eddba02013-02-22 15:30:12 +01006024[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006025=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01006026The `SubmitInput` entity contains information for submitting a change.
6027
David Pursehouseae367192014-11-25 17:24:47 +09006028[options="header",cols="1,^1,5"]
Edwin Kempin0eddba02013-02-22 15:30:12 +01006029|===========================
6030|Field Name ||Description
Dave Borowitzc6d143d2016-02-24 12:32:23 -05006031|`on_behalf_of`|optional|
6032If set, submit the change on behalf of the given user. The value may take any
6033format link:rest-api-accounts.html#account-id[accepted by the accounts REST
6034API]. Using this option requires
6035link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
6036permission on the branch.
Stephen Lia5a5ef02016-03-31 16:55:53 -07006037|`notify`|optional|
6038Notify handling that defines to whom email notifications should be sent after
6039the change is submitted. +
6040Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
6041If not set, the default is `ALL`.
Edwin Kempin0eddba02013-02-22 15:30:12 +01006042|===========================
6043
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006044[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006045=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006046The `SubmitRecord` entity describes results from a submit_rule.
Dave Borowitz6453fce2016-09-22 16:11:56 +02006047Fields in this entity roughly correspond to the fields set by `LABELS`
6048in link:#label-info[LabelInfo].
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006049
David Pursehouseae367192014-11-25 17:24:47 +09006050[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006051|===========================
6052|Field Name ||Description
6053|`status`||
6054`OK`, the change can be submitted. +
6055`NOT_READY`, additional labels are required before submit. +
6056`CLOSED`, closed changes cannot be submitted. +
6057`RULE_ERROR`, rule code failed with an error.
6058|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01006059Map of labels that are approved; an
6060link:rest-api-accounts.html#account-info[AccountInfo] identifies the
6061voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006062|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01006063Map of labels that are preventing submit;
6064link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006065|`need`|optional|
6066Map of labels that need to be given to submit. The value is
6067currently an empty object.
6068|`may`|optional|
6069Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01006070link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
6071if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08006072|`impossible`|optional|
6073Map of labels that should have been in `need` but cannot be
6074used by any user because of access restrictions. The value
6075is currently an empty object.
6076|`error_message`|optional|
6077When status is RULE_ERROR this message provides some text describing
6078the failure of the rule predicate.
6079|===========================
6080
Jonathan Nieder2a629b02016-06-16 15:15:25 -07006081[[submitted-together-info]]
6082=== SubmittedTogetherInfo
6083The `SubmittedTogetherInfo` entity contains information about a
6084collection of changes that would be submitted together.
6085
6086[options="header",cols="1,6"]
6087|===========================
6088|Field Name |Description
6089|`changes` |
6090A list of ChangeInfo entities representing the changes to be submitted together.
6091|`non_visible_changes`|
6092The number of changes to be submitted together that the current user
6093cannot see. (This count includes changes that are visible to the
6094current user when their reason for being submitted together involves
6095changes the user cannot see.)
6096|===========================
6097
Edwin Kempin521c1242015-01-23 12:44:44 +01006098[[suggested-reviewer-info]]
6099=== SuggestedReviewerInfo
6100The `SuggestedReviewerInfo` entity contains information about a reviewer
6101that can be added to a change (an account or a group).
6102
6103`SuggestedReviewerInfo` has either the `account` field that contains
6104the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
6105the `group` field that contains the
6106link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
6107
Logan Hanksab3c81e2016-07-20 15:42:52 -07006108[options="header",cols="1,^1,5"]
6109|===========================
6110|Field Name ||Description
6111|`account` |optional|
6112An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the
6113suggestion is an account.
6114|`group` |optional|
6115A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the
6116suggestion is a group.
6117|`count` ||
6118The total number of accounts in the suggestion. This is `1` if `account` is
6119present. If `group` is present, the total number of accounts that are
6120members of the group is returned (this count includes members of nested
6121groups).
6122|`confirm` |optional|
6123True if `group` is present and `count` is above the threshold where the
6124`confirmed` flag must be passed to add the group as a reviewer.
6125|===========================
6126
Edwin Kempin64006bb2013-02-22 08:17:04 +01006127[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08006128=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01006129The `TopicInput` entity contains information for setting a topic.
6130
David Pursehouseae367192014-11-25 17:24:47 +09006131[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01006132|===========================
6133|Field Name ||Description
6134|`topic` |optional|The topic. +
6135The topic will be deleted if not set.
Edwin Kempin64006bb2013-02-22 08:17:04 +01006136|===========================
6137
Oleg Aravinbf313bb2016-10-24 12:28:56 -07006138[[voting-range-info]]
6139=== VotingRangeInfo
6140The `VotingRangeInfo` entity describes the continuous voting range from min
6141to max values.
6142
6143[options="header",cols="1,6"]
6144|======================
6145|Field Name|Description
6146|`min` |The minimum voting value.
6147|`max` |The maximum voting value.
6148|======================
6149
Edwin Kempinbd885ff2014-04-11 16:11:56 +02006150[[web-link-info]]
6151=== WebLinkInfo
6152The `WebLinkInfo` entity describes a link to an external site.
6153
David Pursehouseae367192014-11-25 17:24:47 +09006154[options="header",cols="1,6"]
Edwin Kempinbd885ff2014-04-11 16:11:56 +02006155|======================
6156|Field Name|Description
6157|`name` |The link name.
6158|`url` |The link URL.
Sven Selberg55484202014-06-26 08:48:51 +02006159|`image_url`|URL to the icon of the link.
Edwin Kempinbd885ff2014-04-11 16:11:56 +02006160|======================
6161
Edwin Kempind0a63922013-01-23 16:32:59 +01006162GERRIT
6163------
6164Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07006165
6166SEARCHBOX
6167---------