blob: d537a57ddf57c96bd4961d27cec98c23e7848fcf [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 Kempind0a63922013-01-23 16:32:59 +0100249* `CURRENT_FILES`: list files modified by the commit, including
250 basic line counts inserted/deleted per file. Only valid when
David Pursehouse98006e82013-10-02 10:15:52 +0900251 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 Kempind0a63922013-01-23 16:32:59 +0100256* `ALL_FILES`: list files modified by the commit, including
257 basic line counts inserted/deleted per file. If only the
David Pursehouse98006e82013-10-02 10:15:52 +0900258 `CURRENT_REVISION` was requested then only that commit's
Edwin Kempind0a63922013-01-23 16:32:59 +0100259 modified 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
Khai Do2a23ec82014-09-19 16:33:02 -0700304[[web-links]]
Sven Selbergae1a10c2014-02-14 14:24:29 +0100305--
Sven Selbergd26bd542014-11-21 16:28:10 +0100306* `WEB_LINKS`: include the `web_links` field in link:#commit-info[CommitInfo],
307 therefore only valid in combination with `CURRENT_COMMIT` or
308 `ALL_COMMITS`.
Sven Selbergae1a10c2014-02-14 14:24:29 +0100309--
310
Dave Borowitz4c46c242014-12-03 16:46:45 -0800311[[check]]
312--
313* `CHECK`: include potential problems with the change.
314--
315
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700316[[commit-footers]]
317--
318* `COMMIT_FOOTERS`: include the full commit message with
319 Gerrit-specific commit footers in the
320 link:#revision-info[RevisionInfo].
Yuxuan 'fishy' Wang16baf212015-05-05 16:49:55 -0700321--
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -0700322
Dave Borowitz6f58dbe2015-09-14 12:34:31 -0400323[[push-certificates]]
324--
325* `PUSH_CERTIFICATES`: include push certificate information in the
326 link:#revision-info[RevisionInfo]. Ignored if signed push is not
327 link:config-gerrit.html#receive.enableSignedPush[enabled] on the
328 server.
329--
330
Edwin Kempin37440832013-02-06 11:36:00 +0100331.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100332----
Edwin Kempinea621482013-10-16 12:58:24 +0200333 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 +0100334----
Edwin Kempind0a63922013-01-23 16:32:59 +0100335
Edwin Kempin37440832013-02-06 11:36:00 +0100336.Response
337----
Edwin Kempind0a63922013-01-23 16:32:59 +0100338 HTTP/1.1 200 OK
339 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900340 Content-Type: application/json; charset=UTF-8
Edwin Kempind0a63922013-01-23 16:32:59 +0100341
342 )]}'
343 [
344 {
David Pursehousec3be6ad2014-07-18 12:03:06 +0900345 "id": "gerrit~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
Edwin Kempind0a63922013-01-23 16:32:59 +0100346 "project": "gerrit",
347 "branch": "master",
348 "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
349 "subject": "Use an EventBus to manage star icons",
350 "status": "NEW",
351 "created": "2012-04-25 00:52:25.580000000",
352 "updated": "2012-04-25 00:52:25.586000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100353 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100354 "insertions": 16,
355 "deletions": 7,
Edwin Kempind0a63922013-01-23 16:32:59 +0100356 "_number": 97,
357 "owner": {
358 "name": "Shawn Pearce"
359 },
360 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c",
361 "revisions": {
362 "184ebe53805e102605d11f6b143486d15c23a09c": {
David Pursehouse4de41112016-06-28 09:24:08 +0900363 "kind": "REWORK",
Edwin Kempind0a63922013-01-23 16:32:59 +0100364 "_number": 1,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100365 "ref": "refs/changes/97/97/1",
Edwin Kempind0a63922013-01-23 16:32:59 +0100366 "fetch": {
367 "git": {
368 "url": "git://localhost/gerrit",
Edwin Kempinea621482013-10-16 12:58:24 +0200369 "ref": "refs/changes/97/97/1",
370 "commands": {
371 "Checkout": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
372 "Cherry-Pick": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
373 "Format-Patch": "git fetch git://localhost/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
374 "Pull": "git pull git://localhost/gerrit refs/changes/97/97/1"
375 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100376 },
377 "http": {
Edwin Kempinea621482013-10-16 12:58:24 +0200378 "url": "http://myuser@127.0.0.1:8080/gerrit",
379 "ref": "refs/changes/97/97/1",
380 "commands": {
381 "Checkout": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
382 "Cherry-Pick": "git fetch http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
383 "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",
384 "Pull": "git pull http://myuser@127.0.0.1:8080/gerrit refs/changes/97/97/1"
385 }
386 },
387 "ssh": {
388 "url": "ssh://myuser@*:29418/gerrit",
389 "ref": "refs/changes/97/97/1",
390 "commands": {
391 "Checkout": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git checkout FETCH_HEAD",
392 "Cherry-Pick": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git cherry-pick FETCH_HEAD",
393 "Format-Patch": "git fetch ssh://myuser@*:29418/gerrit refs/changes/97/97/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD",
394 "Pull": "git pull ssh://myuser@*:29418/gerrit refs/changes/97/97/1"
395 }
Edwin Kempind0a63922013-01-23 16:32:59 +0100396 }
397 },
398 "commit": {
399 "parents": [
400 {
401 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
402 "subject": "Migrate contributor agreements to All-Projects."
403 }
404 ],
405 "author": {
406 "name": "Shawn O. Pearce",
407 "email": "sop@google.com",
408 "date": "2012-04-24 18:08:08.000000000",
409 "tz": -420
410 },
411 "committer": {
412 "name": "Shawn O. Pearce",
413 "email": "sop@google.com",
414 "date": "2012-04-24 18:08:08.000000000",
415 "tz": -420
416 },
417 "subject": "Use an EventBus to manage star icons",
418 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
419 },
420 "files": {
421 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200422 "lines_deleted": 8,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100423 "size_delta": -412,
424 "size": 7782
Edwin Kempind0a63922013-01-23 16:32:59 +0100425 },
426 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200427 "lines_inserted": 1,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100428 "size_delta": 23,
429 "size": 6762
Edwin Kempind0a63922013-01-23 16:32:59 +0100430 },
431 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": {
432 "lines_inserted": 11,
Edwin Kempin640f9842015-10-08 15:53:20 +0200433 "lines_deleted": 19,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100434 "size_delta": -298,
435 "size": 47023
Edwin Kempind0a63922013-01-23 16:32:59 +0100436 },
437 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": {
438 "lines_inserted": 23,
Edwin Kempin640f9842015-10-08 15:53:20 +0200439 "lines_deleted": 20,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100440 "size_delta": 132,
441 "size": 17727
Edwin Kempind0a63922013-01-23 16:32:59 +0100442 },
443 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": {
444 "status": "D",
Edwin Kempin640f9842015-10-08 15:53:20 +0200445 "lines_deleted": 139,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100446 "size_delta": -5512,
447 "size": 13098
Edwin Kempind0a63922013-01-23 16:32:59 +0100448 },
449 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": {
450 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +0200451 "lines_inserted": 204,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100452 "size_delta": 8345,
453 "size": 8345
Edwin Kempind0a63922013-01-23 16:32:59 +0100454 },
455 "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": {
Edwin Kempin640f9842015-10-08 15:53:20 +0200456 "lines_deleted": 9,
Edwin Kempin971a5f52015-10-28 10:50:39 +0100457 "size_delta": -343,
458 "size": 5385
Edwin Kempind0a63922013-01-23 16:32:59 +0100459 }
460 }
461 }
462 }
463 }
464 ]
465----
466
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100467[[get-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800468=== Get Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800469--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100470'GET /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800471--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100472
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100473Retrieves a change.
474
Dave Borowitz0314f732013-10-03 09:34:30 -0700475Additional fields can be obtained by adding `o` parameters, each
476option requires more database lookups and slows down the query
477response time to the client so they are generally disabled by
478default. Fields are described in link:#list-changes[Query Changes].
479
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100480.Request
481----
482 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
483----
484
485As response a link:#change-info[ChangeInfo] entity is returned that
486describes the change.
487
488.Response
489----
490 HTTP/1.1 200 OK
491 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900492 Content-Type: application/json; charset=UTF-8
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100493
494 )]}'
495 {
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100496 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
497 "project": "myProject",
498 "branch": "master",
499 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
500 "subject": "Implementing Feature X",
501 "status": "NEW",
502 "created": "2013-02-01 09:59:32.126000000",
503 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100504 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100505 "insertions": 34,
506 "deletions": 101,
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100507 "_number": 3965,
508 "owner": {
509 "name": "John Doe"
510 }
511 }
512----
513
Edwin Kempin8e492202013-02-21 15:38:25 +0100514[[get-change-detail]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800515=== Get Change Detail
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800516--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100517'GET /changes/link:#change-id[\{change-id\}]/detail'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800518--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100519
Edwin Kempin8e492202013-02-21 15:38:25 +0100520Retrieves a change with link:#labels[labels], link:#detailed-labels[
Viktar Donich316bf7a2016-07-06 11:29:01 -0700521detailed labels], link:#detailed-accounts[detailed accounts],
522link:#reviewer-updates[reviewer updates], and link:#messages[messages].
Edwin Kempin8e492202013-02-21 15:38:25 +0100523
Shawn Pearce7f3dccf2013-07-06 19:24:29 -0700524Additional fields can be obtained by adding `o` parameters, each
525option requires more database lookups and slows down the query
526response time to the client so they are generally disabled by
527default. Fields are described in link:#list-changes[Query Changes].
528
Edwin Kempin8e492202013-02-21 15:38:25 +0100529.Request
530----
531 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0
532----
533
534As response a link:#change-info[ChangeInfo] entity is returned that
Khai Doad632012014-06-22 08:29:57 -0700535describes the change. This response will contain all votes for each
536label and include one combined vote. The combined label vote is
537calculated in the following order (from highest to lowest):
538REJECTED > APPROVED > DISLIKED > RECOMMENDED.
Edwin Kempin8e492202013-02-21 15:38:25 +0100539
540.Response
541----
542 HTTP/1.1 200 OK
543 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900544 Content-Type: application/json; charset=UTF-8
Edwin Kempin8e492202013-02-21 15:38:25 +0100545
546 )]}'
547 {
Edwin Kempin8e492202013-02-21 15:38:25 +0100548 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
549 "project": "myProject",
550 "branch": "master",
551 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
552 "subject": "Implementing Feature X",
553 "status": "NEW",
554 "created": "2013-02-01 09:59:32.126000000",
555 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempin8e492202013-02-21 15:38:25 +0100556 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100557 "insertions": 126,
558 "deletions": 11,
Edwin Kempin8e492202013-02-21 15:38:25 +0100559 "_number": 3965,
560 "owner": {
561 "_account_id": 1000096,
562 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200563 "email": "john.doe@example.com",
564 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100565 },
566 "labels": {
567 "Verified": {
568 "all": [
569 {
570 "value": 0,
571 "_account_id": 1000096,
572 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200573 "email": "john.doe@example.com",
574 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100575 },
576 {
577 "value": 0,
578 "_account_id": 1000097,
579 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200580 "email": "jane.roe@example.com",
581 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100582 }
583 ],
584 "values": {
585 "-1": "Fails",
586 " 0": "No score",
587 "+1": "Verified"
588 }
589 },
590 "Code-Review": {
Edwin Kempin8e492202013-02-21 15:38:25 +0100591 "disliked": {
592 "_account_id": 1000096,
593 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200594 "email": "john.doe@example.com",
595 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100596 },
597 "all": [
598 {
599 "value": -1,
600 "_account_id": 1000096,
601 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200602 "email": "john.doe@example.com",
603 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100604 },
605 {
606 "value": 1,
607 "_account_id": 1000097,
608 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200609 "email": "jane.roe@example.com",
610 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100611 }
612 ]
613 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +0400614 "-2": "This shall not be merged",
615 "-1": "I would prefer this is not merged as is",
Edwin Kempin8e492202013-02-21 15:38:25 +0100616 " 0": "No score",
617 "+1": "Looks good to me, but someone else must approve",
618 "+2": "Looks good to me, approved"
619 }
620 }
621 },
622 "permitted_labels": {
623 "Verified": [
624 "-1",
625 " 0",
626 "+1"
627 ],
628 "Code-Review": [
629 "-2",
630 "-1",
631 " 0",
632 "+1",
633 "+2"
634 ]
635 },
636 "removable_reviewers": [
637 {
638 "_account_id": 1000096,
639 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200640 "email": "john.doe@example.com",
641 "username": "jdoe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100642 },
643 {
644 "_account_id": 1000097,
645 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200646 "email": "jane.roe@example.com",
647 "username": "jroe"
Edwin Kempin8e492202013-02-21 15:38:25 +0100648 }
John Spurlock74a70cc2013-03-23 16:41:50 -0400649 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -0800650 "reviewers": {
651 "REVIEWER": [
652 {
653 "_account_id": 1000096,
654 "name": "John Doe",
655 "email": "john.doe@example.com",
656 "username": "jdoe"
657 },
658 {
659 "_account_id": 1000097,
660 "name": "Jane Roe",
661 "email": "jane.roe@example.com",
662 "username": "jroe"
663 }
664 ]
665 },
Viktar Donich316bf7a2016-07-06 11:29:01 -0700666 "reviewer_updates": [
667 {
668 "state": "REVIEWER",
669 "reviewer": {
670 "_account_id": 1000096,
671 "name": "John Doe",
672 "email": "john.doe@example.com",
673 "username": "jdoe"
674 },
675 "updated_by": {
676 "_account_id": 1000096,
677 "name": "John Doe",
678 "email": "john.doe@example.com",
679 "username": "jdoe"
680 },
681 "updated": "2016-07-21 20:12:39.000000000"
682 },
683 {
684 "state": "REMOVED",
685 "reviewer": {
686 "_account_id": 1000096,
687 "name": "John Doe",
688 "email": "john.doe@example.com",
689 "username": "jdoe"
690 },
691 "updated_by": {
692 "_account_id": 1000096,
693 "name": "John Doe",
694 "email": "john.doe@example.com",
695 "username": "jdoe"
696 },
697 "updated": "2016-07-21 20:12:33.000000000"
698 },
699 {
700 "state": "CC",
701 "reviewer": {
702 "_account_id": 1000096,
703 "name": "John Doe",
704 "email": "john.doe@example.com",
705 "username": "jdoe"
706 },
707 "updated_by": {
708 "_account_id": 1000096,
709 "name": "John Doe",
710 "email": "john.doe@example.com",
711 "username": "jdoe"
712 },
713 "updated": "2016-03-23 21:34:02.419000000",
714 },
715 ],
John Spurlock74a70cc2013-03-23 16:41:50 -0400716 "messages": [
717 {
718 "id": "YH-egE",
719 "author": {
720 "_account_id": 1000096,
721 "name": "John Doe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200722 "email": "john.doe@example.com",
723 "username": "jdoe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400724 },
725 "updated": "2013-03-23 21:34:02.419000000",
726 "message": "Patch Set 1:\n\nThis is the first message.",
727 "revision_number": 1
728 },
729 {
730 "id": "WEEdhU",
731 "author": {
732 "_account_id": 1000097,
733 "name": "Jane Roe",
Edwin Kempin65886f02013-10-16 15:03:17 +0200734 "email": "jane.roe@example.com",
735 "username": "jroe"
John Spurlock74a70cc2013-03-23 16:41:50 -0400736 },
737 "updated": "2013-03-23 21:36:52.332000000",
738 "message": "Patch Set 1:\n\nThis is the second message.\n\nWith a line break.",
739 "revision_number": 1
740 }
Edwin Kempin8e492202013-02-21 15:38:25 +0100741 ]
742 }
743----
744
Edwin Kempin64006bb2013-02-22 08:17:04 +0100745[[get-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800746=== Get Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800747--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100748'GET /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800749--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100750
Edwin Kempin64006bb2013-02-22 08:17:04 +0100751Retrieves the topic of a change.
752
753.Request
754----
755 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
756----
757
758.Response
759----
760 HTTP/1.1 200 OK
761 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900762 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100763
764 )]}'
765 "Documentation"
766----
767
768If the change does not have a topic an empty string is returned.
769
770[[set-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800771=== Set Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800772--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100773'PUT /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800774--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100775
Edwin Kempin64006bb2013-02-22 08:17:04 +0100776Sets the topic of a change.
777
778The new topic must be provided in the request body inside a
779link:#topic-input[TopicInput] entity.
780
781.Request
782----
783 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900784 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100785
786 {
787 "topic": "Documentation"
788 }
789----
790
791As response the new topic is returned.
792
793.Response
794----
795 HTTP/1.1 200 OK
796 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900797 Content-Type: application/json; charset=UTF-8
Edwin Kempin64006bb2013-02-22 08:17:04 +0100798
799 )]}'
800 "Documentation"
801----
802
803If the topic was deleted the response is "`204 No Content`".
804
805[[delete-topic]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800806=== Delete Topic
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800807--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100808'DELETE /changes/link:#change-id[\{change-id\}]/topic'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800809--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100810
Edwin Kempin64006bb2013-02-22 08:17:04 +0100811Deletes the topic of a change.
812
Edwin Kempin64006bb2013-02-22 08:17:04 +0100813Please note that some proxies prohibit request bodies for DELETE
814requests. In this case, if you want to specify a commit message, use
815link:#set-topic[PUT] to delete the topic.
816
817.Request
818----
819 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
820----
821
822.Response
823----
824 HTTP/1.1 204 No Content
825----
826
Edwin Kempined5364b2013-02-22 10:39:33 +0100827[[abandon-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800828=== Abandon Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800829--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100830'POST /changes/link:#change-id[\{change-id\}]/abandon'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800831--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100832
Edwin Kempined5364b2013-02-22 10:39:33 +0100833Abandons a change.
834
835The request body does not need to include a link:#abandon-input[
836AbandonInput] entity if no review comment is added.
837
838.Request
839----
840 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/abandon HTTP/1.0
841----
842
843As response a link:#change-info[ChangeInfo] entity is returned that
844describes the abandoned change.
845
846.Response
847----
848 HTTP/1.1 200 OK
849 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900850 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +0100851
852 )]}'
853 {
Edwin Kempined5364b2013-02-22 10:39:33 +0100854 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
855 "project": "myProject",
856 "branch": "master",
857 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
858 "subject": "Implementing Feature X",
859 "status": "ABANDONED",
860 "created": "2013-02-01 09:59:32.126000000",
861 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +0100862 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100863 "insertions": 3,
864 "deletions": 310,
Edwin Kempined5364b2013-02-22 10:39:33 +0100865 "_number": 3965,
866 "owner": {
867 "name": "John Doe"
868 }
869 }
870----
871
872If the change cannot be abandoned because the change state doesn't
873allow abandoning of the change, the response is "`409 Conflict`" and
874the error message is contained in the response body.
875
876.Response
877----
878 HTTP/1.1 409 Conflict
879 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900880 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +0100881
882 change is merged
883----
884
885[[restore-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800886=== Restore Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800887--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100888'POST /changes/link:#change-id[\{change-id\}]/restore'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800889--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +0100890
Edwin Kempined5364b2013-02-22 10:39:33 +0100891Restores a change.
892
893The request body does not need to include a link:#restore-input[
894RestoreInput] entity if no review comment is added.
895
896.Request
897----
898 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/restore HTTP/1.0
899----
900
901As response a link:#change-info[ChangeInfo] entity is returned that
902describes the restored change.
903
904.Response
905----
906 HTTP/1.1 200 OK
907 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900908 Content-Type: application/json; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +0100909
910 )]}'
911 {
Edwin Kempined5364b2013-02-22 10:39:33 +0100912 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
913 "project": "myProject",
914 "branch": "master",
915 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
916 "subject": "Implementing Feature X",
917 "status": "NEW",
918 "created": "2013-02-01 09:59:32.126000000",
919 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempined5364b2013-02-22 10:39:33 +0100920 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100921 "insertions": 2,
922 "deletions": 13,
Edwin Kempined5364b2013-02-22 10:39:33 +0100923 "_number": 3965,
924 "owner": {
925 "name": "John Doe"
926 }
927 }
928----
929
930If the change cannot be restored because the change state doesn't
931allow restoring the change, the response is "`409 Conflict`" and
932the error message is contained in the response body.
933
934.Response
935----
936 HTTP/1.1 409 Conflict
937 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900938 Content-Type: text/plain; charset=UTF-8
Edwin Kempined5364b2013-02-22 10:39:33 +0100939
940 change is new
941----
942
Edwin Kempincdae63b2013-03-15 15:06:59 +0100943[[rebase-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800944=== Rebase Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800945--
Edwin Kempincdae63b2013-03-15 15:06:59 +0100946'POST /changes/link:#change-id[\{change-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -0800947--
Edwin Kempincdae63b2013-03-15 15:06:59 +0100948
949Rebases a change.
950
Zalan Blenessy874aed72015-01-12 13:26:18 +0100951Optionally, the parent revision can be changed to another patch set through the
952link:#rebase-input[RebaseInput] entity.
953
Edwin Kempincdae63b2013-03-15 15:06:59 +0100954.Request
955----
956 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +0100957 Content-Type: application/json;charset=UTF-8
958
959 {
960 "base" : "1234",
961 }
Edwin Kempincdae63b2013-03-15 15:06:59 +0100962----
963
964As response a link:#change-info[ChangeInfo] entity is returned that
965describes the rebased change. Information about the current patch set
966is included.
967
968.Response
969----
970 HTTP/1.1 200 OK
971 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +0900972 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +0100973
974 )]}'
975 {
Edwin Kempincdae63b2013-03-15 15:06:59 +0100976 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
977 "project": "myProject",
978 "branch": "master",
979 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
980 "subject": "Implement Feature X",
981 "status": "NEW",
982 "created": "2013-02-01 09:59:32.126000000",
983 "updated": "2013-02-21 11:16:36.775000000",
984 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +0100985 "insertions": 33,
986 "deletions": 9,
Edwin Kempincdae63b2013-03-15 15:06:59 +0100987 "_number": 4799,
988 "owner": {
989 "name": "John Doe"
990 },
991 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
992 "revisions": {
993 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +0900994 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +0100995 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +0100996 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +0100997 "fetch": {
998 "http": {
999 "url": "http://gerrit:8080/myProject",
1000 "ref": "refs/changes/99/4799/2"
1001 }
1002 },
1003 "commit": {
1004 "parents": [
1005 {
1006 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
1007 "subject": "Implement Feature A"
1008 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00001009 ],
1010 "author": {
1011 "name": "John Doe",
1012 "email": "john.doe@example.com",
1013 "date": "2013-05-07 15:21:27.000000000",
1014 "tz": 120
1015 },
1016 "committer": {
1017 "name": "Gerrit Code Review",
1018 "email": "gerrit-server@example.com",
1019 "date": "2013-05-07 15:35:43.000000000",
1020 "tz": 120
1021 },
1022 "subject": "Implement Feature X",
1023 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01001024 }
1025 }
1026 }
1027----
1028
1029If the change cannot be rebased, e.g. due to conflicts, the response is
1030"`409 Conflict`" and the error message is contained in the response
1031body.
1032
1033.Response
1034----
1035 HTTP/1.1 409 Conflict
1036 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001037 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01001038
1039 The change could not be rebased due to a path conflict during merge.
1040----
1041
Raviteja Sunkara791f3392015-11-03 13:24:50 +05301042[[move-change]]
1043=== Move Change
1044--
1045'POST /changes/link:#change-id[\{change-id\}]/move'
1046--
1047
1048Move a change.
1049
1050The destination branch must be provided in the request body inside a
1051link:#move-input[MoveInput] entity.
1052
1053.Request
1054----
1055 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/move HTTP/1.0
1056 Content-Type: application/json; charset=UTF-8
1057
1058 {
1059 "destination_branch" : "release-branch"
1060 }
1061
1062----
1063
1064As response a link:#change-info[ChangeInfo] entity is returned that
1065describes the moved change.
1066
1067.Response
1068----
1069 HTTP/1.1 200 OK
1070 Content-Disposition: attachment
1071 Content-Type: application/json; charset=UTF-8
1072
1073 )]}'
1074 {
1075 "id": "myProject~release-branch~I8473b95934b5732ac55d26311a706c9c2bde9940",
1076 "project": "myProject",
1077 "branch": "release-branch",
1078 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1079 "subject": "Implementing Feature X",
1080 "status": "NEW",
1081 "created": "2013-02-01 09:59:32.126000000",
1082 "updated": "2013-02-21 11:16:36.775000000",
1083 "mergeable": true,
1084 "insertions": 2,
1085 "deletions": 13,
1086 "_number": 3965,
1087 "owner": {
1088 "name": "John Doe"
1089 }
1090 }
1091----
1092
1093If the change cannot be moved because the change state doesn't
1094allow moving the change, the response is "`409 Conflict`" and
1095the error message is contained in the response body.
1096
1097.Response
1098----
1099 HTTP/1.1 409 Conflict
1100 Content-Disposition: attachment
1101 Content-Type: text/plain; charset=UTF-8
1102
1103 change is merged
1104----
1105
1106If the change cannot be moved because the user doesn't have
1107abandon permission on the change or upload permission on the destination,
1108the response is "`409 Conflict`" and the error message is contained in the
1109response body.
1110
1111.Response
1112----
1113 HTTP/1.1 409 Conflict
1114 Content-Disposition: attachment
1115 Content-Type: text/plain; charset=UTF-8
1116
1117 move not permitted
1118----
1119
Edwin Kempind2ec4152013-02-22 12:17:19 +01001120[[revert-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001121=== Revert Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001122--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001123'POST /changes/link:#change-id[\{change-id\}]/revert'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001124--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001125
Edwin Kempind2ec4152013-02-22 12:17:19 +01001126Reverts a change.
1127
1128The request body does not need to include a link:#revert-input[
1129RevertInput] entity if no review comment is added.
1130
1131.Request
1132----
Michael Zhou10270492016-03-24 22:35:40 -04001133 POST /changes/myProject~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14/revert HTTP/1.0
Edwin Kempind2ec4152013-02-22 12:17:19 +01001134----
1135
1136As response a link:#change-info[ChangeInfo] entity is returned that
1137describes the reverting change.
1138
1139.Response
1140----
1141 HTTP/1.1 200 OK
1142 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001143 Content-Type: application/json; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001144
1145 )]}'
1146 {
Edwin Kempind2ec4152013-02-22 12:17:19 +01001147 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1148 "project": "myProject",
1149 "branch": "master",
1150 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1151 "subject": "Revert \"Implementing Feature X\"",
1152 "status": "NEW",
1153 "created": "2013-02-01 09:59:32.126000000",
1154 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempind2ec4152013-02-22 12:17:19 +01001155 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01001156 "insertions": 6,
1157 "deletions": 4,
Edwin Kempind2ec4152013-02-22 12:17:19 +01001158 "_number": 3965,
1159 "owner": {
1160 "name": "John Doe"
1161 }
1162 }
1163----
1164
1165If the change cannot be reverted because the change state doesn't
1166allow reverting the change, the response is "`409 Conflict`" and
1167the error message is contained in the response body.
1168
1169.Response
1170----
1171 HTTP/1.1 409 Conflict
1172 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001173 Content-Type: text/plain; charset=UTF-8
Edwin Kempind2ec4152013-02-22 12:17:19 +01001174
1175 change is new
1176----
1177
Edwin Kempin0eddba02013-02-22 15:30:12 +01001178[[submit-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001179=== Submit Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001180--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001181'POST /changes/link:#change-id[\{change-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001182--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01001183
Edwin Kempin0eddba02013-02-22 15:30:12 +01001184Submits a change.
1185
1186The request body only needs to include a link:#submit-input[
David Pursehousea8f48f82016-03-10 15:27:47 +09001187SubmitInput] entity if submitting on behalf of another user.
Edwin Kempin0eddba02013-02-22 15:30:12 +01001188
1189.Request
1190----
1191 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001192 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001193
1194 {
David Pursehousea8f48f82016-03-10 15:27:47 +09001195 "on_behalf_of": 1001439
Edwin Kempin0eddba02013-02-22 15:30:12 +01001196 }
1197----
1198
1199As response a link:#change-info[ChangeInfo] entity is returned that
1200describes the submitted/merged change.
1201
1202.Response
1203----
1204 HTTP/1.1 200 OK
1205 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001206 Content-Type: application/json; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001207
1208 )]}'
1209 {
Edwin Kempin0eddba02013-02-22 15:30:12 +01001210 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1211 "project": "myProject",
1212 "branch": "master",
1213 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1214 "subject": "Implementing Feature X",
1215 "status": "MERGED",
1216 "created": "2013-02-01 09:59:32.126000000",
1217 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001218 "submitted": "2013-02-21 11:16:36.615000000",
Edwin Kempin0eddba02013-02-22 15:30:12 +01001219 "_number": 3965,
1220 "owner": {
1221 "name": "John Doe"
1222 }
1223 }
1224----
1225
1226If the change cannot be submitted because the submit rule doesn't allow
1227submitting the change, the response is "`409 Conflict`" and the error
1228message is contained in the response body.
1229
1230.Response
1231----
1232 HTTP/1.1 409 Conflict
1233 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001234 Content-Type: text/plain; charset=UTF-8
Edwin Kempin0eddba02013-02-22 15:30:12 +01001235
1236 blocked by Verified
1237----
1238
David Pursehouse025c1af2015-11-20 17:02:50 +09001239[[submitted-together]]
Stefan Bellera7ad6612015-06-26 10:05:43 -07001240=== Changes submitted together
1241--
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001242'GET /changes/link:#change-id[\{change-id\}]/submitted_together?o=NON_VISIBLE_CHANGES'
Stefan Bellera7ad6612015-06-26 10:05:43 -07001243--
1244
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001245Computes list of all changes which are submitted when
Stefan Beller460f3542015-07-20 14:10:41 -07001246link:#submit-change[\{submit\}] is called for this change,
1247including the current change itself.
1248
Stefan Bellera7ad6612015-06-26 10:05:43 -07001249The list consists of:
1250
1251* The given change.
1252* If link:config-gerrit.html#change.submitWholeTopic[`change.submitWholeTopic`]
1253 is enabled, include all open changes with the same topic.
1254* For each change whose submit type is not CHERRY_PICK, include unmerged
1255 ancestors targeting the same branch.
1256
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001257As a special case, the list is empty if this change would be
1258submitted by itself (without other changes).
1259
1260.Request
1261----
1262 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/submitted_together?o=NON_VISIBLE_CHANGES HTTP/1.0
1263 Content-Type: application/json; charset=UTF-8
1264----
1265
1266As a response a link:#submitted-together-info[SubmittedTogetherInfo]
1267entity is returned that describes what would happen if the change were
1268submitted. This response contains a list of changes and a count of
1269changes that are not visible to the caller that are part of the set of
1270changes to be merged.
1271
1272The listed changes use the same format as in
1273link:#list-changes[\{listing changes\}] with the options
1274link:#labels[\{LABELS\}], link:#detailed-labels[\{DETAILED_LABELS\}],
1275link:#current-revision[\{CURRENT_REVISION\}],
1276link:#current-commit[\{CURRENT_COMMIT\}] set.
1277
Stefan Bellera7ad6612015-06-26 10:05:43 -07001278.Response
1279----
1280 HTTP/1.1 200 OK
1281 Content-Disposition: attachment
1282 Content-Type: application/json; charset=UTF-8
1283
1284)]}'
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001285{
1286 "changes": [
1287 {
1288 "id": "gerrit~master~I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1289 "project": "gerrit",
1290 "branch": "master",
1291 "hashtags": [],
1292 "change_id": "I1ffe09a505e25f15ce1521bcfb222e51e62c2a14",
1293 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1294 "status": "NEW",
1295 "created": "2015-05-01 15:39:57.979000000",
1296 "updated": "2015-05-20 19:25:21.592000000",
1297 "mergeable": true,
1298 "insertions": 303,
1299 "deletions": 210,
1300 "_number": 1779,
1301 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001302 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001303 },
1304 "labels": {
1305 "Code-Review": {
1306 "approved": {
1307 "_account_id": 1000000
1308 },
1309 "all": [
1310 {
1311 "value": 2,
1312 "date": "2015-05-20 19:25:21.592000000",
1313 "_account_id": 1000000
1314 }
1315 ],
1316 "values": {
1317 "-2": "This shall not be merged",
1318 "-1": "I would prefer this is not merged as is",
1319 " 0": "No score",
1320 "+1": "Looks good to me, but someone else must approve",
1321 "+2": "Looks good to me, approved"
1322 },
1323 "default_value": 0
1324 },
1325 "Verified": {
1326 "approved": {
1327 "_account_id": 1000000
1328 },
1329 "all": [
1330 {
1331 "value": 1,
1332 "date": "2015-05-20 19:25:21.592000000",
1333 "_account_id": 1000000
1334 }
1335 ],
1336 "values": {
1337 "-1": "Fails",
1338 " 0": "No score",
1339 "+1": "Verified"
1340 },
1341 "default_value": 0
1342 }
1343 },
1344 "permitted_labels": {
1345 "Code-Review": [
1346 "-2",
1347 "-1",
1348 " 0",
1349 "+1",
1350 "+2"
1351 ],
1352 "Verified": [
1353 "-1",
1354 " 0",
1355 "+1"
1356 ]
1357 },
1358 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001359 {
1360 "_account_id": 1000000
1361 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001362 ],
1363 "reviewers": {
1364 "REVIEWER": [
1365 {
1366 "_account_id": 1000000
1367 }
1368 ]
1369 },
1370 "current_revision": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1371 "revisions": {
1372 "9adb9f4c7b40eeee0646e235de818d09164d7379": {
David Pursehouse4de41112016-06-28 09:24:08 +09001373 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001374 "_number": 1,
1375 "created": "2015-05-01 15:39:57.979000000",
1376 "uploader": {
1377 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001378 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001379 "ref": "refs/changes/79/1779/1",
1380 "fetch": {},
1381 "commit": {
1382 "parents": [
1383 {
1384 "commit": "2d3176497a2747faed075f163707e57d9f961a1c",
1385 "subject": "Merge changes from topic \u0027submodule-subscription-tests-and-fixes-3\u0027"
1386 }
1387 ],
1388 "author": {
1389 "name": "Stefan Beller",
1390 "email": "sbeller@google.com",
1391 "date": "2015-04-29 21:36:52.000000000",
1392 "tz": -420
1393 },
1394 "committer": {
1395 "name": "Stefan Beller",
1396 "email": "sbeller@google.com",
1397 "date": "2015-05-01 00:11:16.000000000",
1398 "tz": -420
1399 },
1400 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes",
1401 "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"
1402 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001403 }
1404 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001405 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001406 {
1407 "id": "gerrit~master~I7fe807e63792b3d26776fd1422e5e790a5697e22",
1408 "project": "gerrit",
1409 "branch": "master",
1410 "hashtags": [],
1411 "change_id": "I7fe807e63792b3d26776fd1422e5e790a5697e22",
1412 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1413 "status": "NEW",
1414 "created": "2015-05-01 15:39:57.979000000",
1415 "updated": "2015-05-20 19:25:21.546000000",
1416 "mergeable": true,
1417 "insertions": 15,
1418 "deletions": 6,
1419 "_number": 1780,
1420 "owner": {
Stefan Bellera7ad6612015-06-26 10:05:43 -07001421 "_account_id": 1000000
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001422 },
1423 "labels": {
1424 "Code-Review": {
1425 "approved": {
1426 "_account_id": 1000000
1427 },
1428 "all": [
1429 {
1430 "value": 2,
1431 "date": "2015-05-20 19:25:21.546000000",
1432 "_account_id": 1000000
1433 }
1434 ],
1435 "values": {
1436 "-2": "This shall not be merged",
1437 "-1": "I would prefer this is not merged as is",
1438 " 0": "No score",
1439 "+1": "Looks good to me, but someone else must approve",
1440 "+2": "Looks good to me, approved"
1441 },
1442 "default_value": 0
1443 },
1444 "Verified": {
1445 "approved": {
1446 "_account_id": 1000000
1447 },
1448 "all": [
1449 {
1450 "value": 1,
1451 "date": "2015-05-20 19:25:21.546000000",
1452 "_account_id": 1000000
1453 }
1454 ],
1455 "values": {
1456 "-1": "Fails",
1457 " 0": "No score",
1458 "+1": "Verified"
1459 },
1460 "default_value": 0
1461 }
1462 },
1463 "permitted_labels": {
1464 "Code-Review": [
1465 "-2",
1466 "-1",
1467 " 0",
1468 "+1",
1469 "+2"
1470 ],
1471 "Verified": [
1472 "-1",
1473 " 0",
1474 "+1"
1475 ]
1476 },
1477 "removable_reviewers": [
Edwin Kempin66af3d82015-11-10 17:38:40 -08001478 {
1479 "_account_id": 1000000
1480 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001481 ],
1482 "reviewers": {
1483 "REVIEWER": [
1484 {
1485 "_account_id": 1000000
1486 }
1487 ]
1488 },
1489 "current_revision": "1bd7c12a38854a2c6de426feec28800623f492c4",
1490 "revisions": {
1491 "1bd7c12a38854a2c6de426feec28800623f492c4": {
David Pursehouse4de41112016-06-28 09:24:08 +09001492 "kind": "REWORK",
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001493 "_number": 1,
1494 "created": "2015-05-01 15:39:57.979000000",
1495 "uploader": {
1496 "_account_id": 1000000
Stefan Bellera7ad6612015-06-26 10:05:43 -07001497 },
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001498 "ref": "refs/changes/80/1780/1",
1499 "fetch": {},
1500 "commit": {
1501 "parents": [
1502 {
1503 "commit": "9adb9f4c7b40eeee0646e235de818d09164d7379",
1504 "subject": "ChangeMergeQueue: Rewrite such that it works on set of changes"
1505 }
1506 ],
1507 "author": {
1508 "name": "Stefan Beller",
1509 "email": "sbeller@google.com",
1510 "date": "2015-04-25 00:11:59.000000000",
1511 "tz": -420
1512 },
1513 "committer": {
1514 "name": "Stefan Beller",
1515 "email": "sbeller@google.com",
1516 "date": "2015-05-01 00:11:16.000000000",
1517 "tz": -420
1518 },
1519 "subject": "AbstractSubmoduleSubscription: Split up createSubscription",
1520 "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"
1521 }
Stefan Bellera7ad6612015-06-26 10:05:43 -07001522 }
1523 }
1524 }
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001525 ],
1526 "non_visible_changes": 0
1527}
Stefan Bellera7ad6612015-06-26 10:05:43 -07001528----
1529
Jonathan Nieder2a629b02016-06-16 15:15:25 -07001530If the `o=NON_VISIBLE_CHANGES` query parameter is not passed, then
1531instead of a link:#submitted-together-info[SubmittedTogetherInfo]
1532entity, the response is a list of changes, or a 403 response with a
1533message if the set of changes to be submitted with this change
1534includes changes the caller cannot read.
1535
Stefan Bellera7ad6612015-06-26 10:05:43 -07001536
David Ostrovsky0d69c232013-09-10 23:10:23 +02001537[[publish-draft-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001538=== Publish Draft Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001539--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001540'POST /changes/link:#change-id[\{change-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001541--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001542
1543Publishes a draft change.
1544
1545.Request
1546----
1547 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/publish HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001548 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001549----
1550
1551.Response
1552----
1553 HTTP/1.1 204 No Content
1554----
1555
1556[[delete-draft-change]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001557=== Delete Draft Change
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001558--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001559'DELETE /changes/link:#change-id[\{change-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001560--
David Ostrovsky0d69c232013-09-10 23:10:23 +02001561
1562Deletes a draft change.
1563
1564.Request
1565----
1566 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001567 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02001568----
1569
1570.Response
1571----
1572 HTTP/1.1 204 No Content
1573----
1574
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001575[[get-included-in]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001576=== Get Included In
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001577--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001578'GET /changes/link:#change-id[\{change-id\}]/in'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08001579--
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001580
1581Retrieves the branches and tags in which a change is included. As result
1582an link:#included-in-info[IncludedInInfo] entity is returned.
1583
1584.Request
1585----
1586 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/in HTTP/1.0
1587----
1588
1589.Response
1590----
1591 HTTP/1.1 200 OK
1592 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001593 Content-Type: application/json; charset=UTF-8
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001594
1595 )]}'
1596 {
David Ostrovsky83e8aee2013-09-30 22:37:26 +02001597 "branches": [
1598 "master"
1599 ],
1600 "tags": []
1601 }
1602----
1603
David Pursehouse4e38b972014-05-30 10:36:40 +09001604[[index-change]]
1605=== Index Change
1606--
1607'POST /changes/link:#change-id[\{change-id\}]/index'
1608--
1609
1610Adds or updates the change in the secondary index.
1611
1612.Request
1613----
1614 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/index HTTP/1.0
1615----
1616
1617.Response
1618----
1619 HTTP/1.1 204 No Content
1620----
1621
Dave Borowitz23fec2b2015-04-28 17:40:07 -07001622[[list-change-comments]]
1623=== List Change Comments
1624--
1625'GET /changes/link:#change-id[\{change-id\}]/comments'
1626--
1627
1628Lists the published comments of all revisions of the change.
1629
1630Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1631entries. The entries in the map are sorted by file path, and the
1632comments for each path are sorted by patch set number. Each comment has
1633the `patch_set` and `author` fields set.
1634
1635.Request
1636----
1637 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/comments HTTP/1.0
1638----
1639
1640.Response
1641----
1642 HTTP/1.1 200 OK
1643 Content-Disposition: attachment
1644 Content-Type: application/json; charset=UTF-8
1645
1646 )]}'
1647 {
1648 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1649 {
1650 "patch_set": 1,
1651 "id": "TvcXrmjM",
1652 "line": 23,
1653 "message": "[nit] trailing whitespace",
1654 "updated": "2013-02-26 15:40:43.986000000"
1655 "author": {
1656 "_account_id": 1000096,
1657 "name": "John Doe",
1658 "email": "john.doe@example.com"
1659 }
1660 },
1661 {
1662 "patch_set": 2,
1663 "id": "TveXwFiA",
1664 "line": 49,
1665 "in_reply_to": "TfYX-Iuo",
1666 "message": "Done",
1667 "updated": "2013-02-26 15:40:45.328000000"
1668 "author": {
1669 "_account_id": 1000097,
1670 "name": "Jane Roe",
1671 "email": "jane.roe@example.com"
1672 }
1673 }
1674 ]
1675 }
1676----
1677
1678[[list-change-drafts]]
1679=== List Change Drafts
1680--
1681'GET /changes/link:#change-id[\{change-id\}]/drafts'
1682--
1683
1684Lists the draft comments of all revisions of the change that belong to
1685the calling user.
1686
1687Returns a map of file paths to lists of link:#comment-info[CommentInfo]
1688entries. The entries in the map are sorted by file path, and the
1689comments for each path are sorted by patch set number. Each comment has
1690the `patch_set` field set, and no `author`.
1691
1692.Request
1693----
1694 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/drafts HTTP/1.0
1695----
1696
1697.Response
1698----
1699 HTTP/1.1 200 OK
1700 Content-Disposition: attachment
1701 Content-Type: application/json; charset=UTF-8
1702
1703 )]}'
1704 {
1705 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
1706 {
1707 "patch_set": 1,
1708 "id": "TvcXrmjM",
1709 "line": 23,
1710 "message": "[nit] trailing whitespace",
1711 "updated": "2013-02-26 15:40:43.986000000"
1712 },
1713 {
1714 "patch_set": 2,
1715 "id": "TveXwFiA",
1716 "line": 49,
1717 "in_reply_to": "TfYX-Iuo",
1718 "message": "Done",
1719 "updated": "2013-02-26 15:40:45.328000000"
1720 }
1721 ]
1722 }
1723----
1724
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001725[[check-change]]
1726=== Check change
1727--
1728'GET /changes/link:#change-id[\{change-id\}]/check'
1729--
1730
1731Performs consistency checks on the change, and returns a
Dave Borowitz5c894d42014-11-25 17:43:06 -05001732link:#change-info[ChangeInfo] entity with the `problems` field set to a
1733list of link:#problem-info[ProblemInfo] entities.
1734
1735Depending on the type of problem, some fields not marked optional may be
1736missing from the result. At least `id`, `project`, `branch`, and
1737`_number` will be present.
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001738
1739.Request
1740----
1741 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
1742----
1743
1744.Response
1745----
1746 HTTP/1.1 200 OK
1747 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001748 Content-Type: application/json; charset=UTF-8
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001749
1750 )]}'
1751 {
Dave Borowitz5c894d42014-11-25 17:43:06 -05001752 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1753 "project": "myProject",
1754 "branch": "master",
1755 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1756 "subject": "Implementing Feature X",
1757 "status": "NEW",
1758 "created": "2013-02-01 09:59:32.126000000",
1759 "updated": "2013-02-21 11:16:36.775000000",
1760 "mergeable": true,
1761 "insertions": 34,
1762 "deletions": 101,
Dave Borowitz5c894d42014-11-25 17:43:06 -05001763 "_number": 3965,
1764 "owner": {
1765 "name": "John Doe"
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001766 },
Dave Borowitz5c894d42014-11-25 17:43:06 -05001767 "problems": [
1768 {
1769 "message": "Current patch set 1 not found"
1770 }
Dave Borowitzfd508ca2014-11-06 15:24:04 -08001771 ]
1772 }
1773----
1774
Dave Borowitz3be39d02014-12-03 17:57:38 -08001775[[fix-change]]
1776=== Fix change
1777--
1778'POST /changes/link:#change-id[\{change-id\}]/check'
1779--
1780
1781Performs consistency checks on the change as with link:#check-change[GET
1782/check], and additionally fixes any problems that can be fixed
1783automatically. The returned field values reflect any fixes.
1784
Dave Borowitzbad53ee2015-06-11 10:10:18 -04001785Some fixes have options controlling their behavior, which can be set in the
1786link:#fix-input[FixInput] entity body.
1787
Dave Borowitz3be39d02014-12-03 17:57:38 -08001788Only the change owner, a project owner, or an administrator may fix changes.
1789
1790.Request
1791----
1792 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/check HTTP/1.0
1793----
1794
1795.Response
1796----
1797 HTTP/1.1 200 OK
1798 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001799 Content-Type: application/json; charset=UTF-8
Dave Borowitz3be39d02014-12-03 17:57:38 -08001800
1801 )]}'
1802 {
1803 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
1804 "project": "myProject",
1805 "branch": "master",
1806 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
1807 "subject": "Implementing Feature X",
1808 "status": "MERGED",
1809 "created": "2013-02-01 09:59:32.126000000",
1810 "updated": "2013-02-21 11:16:36.775000000",
Khai Do96a7caf2016-01-07 14:07:54 -08001811 "submitted": "2013-02-21 11:16:36.615000000",
Dave Borowitz3be39d02014-12-03 17:57:38 -08001812 "mergeable": true,
1813 "insertions": 34,
1814 "deletions": 101,
Dave Borowitz3be39d02014-12-03 17:57:38 -08001815 "_number": 3965,
1816 "owner": {
1817 "name": "John Doe"
1818 },
1819 "problems": [
1820 {
1821 "message": "Current patch set 2 not found"
1822 },
1823 {
1824 "message": "Patch set 1 (1eee2c9d8f352483781e772f35dc586a69ff5646) is merged into destination ref master (1eee2c9d8f352483781e772f35dc586a69ff5646), but change status is NEW",
1825 "status": FIXED,
1826 "outcome": "Marked change as merged"
1827 }
1828 ]
1829 }
1830----
1831
David Ostrovsky1a49f622014-07-29 00:40:02 +02001832[[edit-endpoints]]
1833== Change Edit Endpoints
1834
David Ostrovsky1a49f622014-07-29 00:40:02 +02001835[[get-edit-detail]]
1836=== Get Change Edit Details
1837--
1838'GET /changes/link:#change-id[\{change-id\}]/edit
1839--
1840
1841Retrieves a change edit details.
1842
1843.Request
1844----
1845 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
1846----
1847
1848As response an link:#edit-info[EditInfo] entity is returned that
1849describes the change edit, or "`204 No Content`" when change edit doesn't
1850exist for this change. Change edits are stored on special branches and there
1851can be max one edit per user per change. Edits aren't tracked in the database.
David Ostrovsky5d98e342014-08-01 09:23:28 +02001852When request parameter `list` is provided the response also includes the file
1853list. When `base` request parameter is provided the file list is computed
David Ostrovsky5562fe52014-08-12 22:36:27 +02001854against this base revision. When request parameter `download-commands` is
1855provided fetch info map is also included.
David Ostrovsky1a49f622014-07-29 00:40:02 +02001856
1857.Response
1858----
1859 HTTP/1.1 200 OK
1860 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001861 Content-Type: application/json; charset=UTF-8
David Ostrovsky1a49f622014-07-29 00:40:02 +02001862
1863 )]}'
1864 {
1865 "commit":{
1866 "parents":[
1867 {
1868 "commit":"1eee2c9d8f352483781e772f35dc586a69ff5646",
1869 }
1870 ],
1871 "author":{
1872 "name":"Shawn O. Pearce",
1873 "email":"sop@google.com",
1874 "date":"2012-04-24 18:08:08.000000000",
1875 "tz":-420
1876 },
1877 "committer":{
1878 "name":"Shawn O. Pearce",
1879 "email":"sop@google.com",
1880 "date":"2012-04-24 18:08:08.000000000",
1881 "tz":-420
1882 },
1883 "subject":"Use an EventBus to manage star icons",
1884 "message":"Use an EventBus to manage star icons\n\nImage widgets that need to ..."
1885 },
Michael Zhoud03fe282016-04-25 17:13:17 -04001886 "base_revision":"c35558e0925e6985c91f3a16921537d5e572b7a3"
David Ostrovsky1a49f622014-07-29 00:40:02 +02001887 }
1888----
David Pursehouse4e38b972014-05-30 10:36:40 +09001889
David Ostrovskya5ab8292014-08-01 02:11:39 +02001890[[put-edit-file]]
1891=== Change file content in Change Edit
1892--
1893'PUT /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
1894--
1895
1896Put content of a file to a change edit.
1897
1898.Request
1899----
1900 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
1901----
1902
1903When change edit doesn't exist for this change yet it is created. When file
1904content isn't provided, it is wiped out for that file. As response
1905"`204 No Content`" is returned.
1906
1907.Response
1908----
1909 HTTP/1.1 204 No Content
1910----
1911
David Ostrovsky138edb42014-08-15 21:31:43 +02001912[[post-edit]]
David Ostrovskya00c9532015-01-21 00:17:49 +01001913=== Restore file content or rename files in Change Edit
David Ostrovsky138edb42014-08-15 21:31:43 +02001914--
1915'POST /changes/link:#change-id[\{change-id\}]/edit
1916--
1917
David Ostrovskya00c9532015-01-21 00:17:49 +01001918Creates empty change edit, restores file content or renames files in change
1919edit. The request body needs to include a
1920link:#change-edit-input[ChangeEditInput] entity when a file within change
1921edit should be restored or old and new file names to rename a file.
David Ostrovsky138edb42014-08-15 21:31:43 +02001922
1923.Request
1924----
1925 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001926 Content-Type: application/json; charset=UTF-8
David Ostrovsky138edb42014-08-15 21:31:43 +02001927
1928 {
David Ostrovskybd12e172014-08-21 23:08:15 +02001929 "restore_path": "foo"
David Ostrovsky138edb42014-08-15 21:31:43 +02001930 }
1931----
1932
David Ostrovskya00c9532015-01-21 00:17:49 +01001933or for rename:
1934
1935.Request
1936----
1937 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
1938 Content-Type: application/json; charset=UTF-8
1939
1940 {
1941 "old_path": "foo",
1942 "new_path": "bar"
1943 }
1944----
1945
David Ostrovsky138edb42014-08-15 21:31:43 +02001946When change edit doesn't exist for this change yet it is created. When path
David Ostrovskya00c9532015-01-21 00:17:49 +01001947and restore flag are provided in request body, this file is restored. When
1948old and new file names are provided, the file is renamed. As response
1949"`204 No Content`" is returned.
David Ostrovsky138edb42014-08-15 21:31:43 +02001950
1951.Response
1952----
1953 HTTP/1.1 204 No Content
1954----
1955
David Ostrovskyc967e152014-10-24 17:36:16 +02001956[[put-change-edit-message]]
1957=== Change commit message in Change Edit
1958--
1959'PUT /changes/link:#change-id[\{change-id\}]/edit:message
1960--
1961
1962Modify commit message. The request body needs to include a
1963link:#change-edit-message-input[ChangeEditMessageInput]
1964entity.
1965
1966.Request
1967----
1968 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09001969 Content-Type: application/json; charset=UTF-8
David Ostrovskyc967e152014-10-24 17:36:16 +02001970
1971 {
1972 "message": "New commit message\n\nChange-Id: I10394472cbd17dd12454f229e4f6de00b143a444"
1973 }
1974----
1975
1976If a change edit doesn't exist for this change yet, it is created. As
1977response "`204 No Content`" is returned.
1978
1979.Response
1980----
1981 HTTP/1.1 204 No Content
1982----
1983
David Ostrovsky2830c292014-08-01 02:24:31 +02001984[[delete-edit-file]]
1985=== Delete file in Change Edit
1986--
1987'DELETE /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile'
1988--
1989
1990Deletes a file from a change edit. This deletes the file from the repository
1991completely. This is not the same as reverting or restoring a file to its
1992previous contents.
1993
1994.Request
1995----
1996 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
1997----
1998
1999When change edit doesn't exist for this change yet it is created.
2000
2001.Response
2002----
2003 HTTP/1.1 204 No Content
2004----
2005
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002006[[get-edit-file]]
2007=== Retrieve file content from Change Edit
2008--
2009'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile
2010--
2011
2012Retrieves content of a file from a change edit.
2013
2014.Request
2015----
2016 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo HTTP/1.0
2017----
2018
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002019The content of the file is returned as text encoded inside base64.
2020The Content-Type header will always be `text/plain` reflecting the
2021outer base64 encoding. A Gerrit-specific `X-FYI-Content-Type` header
2022can be examined to find the server detected content type of the file.
2023
2024When the specified file was deleted in the change edit
2025"`204 No Content`" is returned.
2026
2027If only the content type is required, callers should use HEAD to
2028avoid downloading the encoded file contents.
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002029
Michael Zhou551ad0c2016-04-26 01:21:42 -04002030If the `base` parameter is set to true, the returned content is from the
2031revision that the edit is based on.
2032
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002033.Response
2034----
2035 HTTP/1.1 200 OK
2036 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002037 Content-Type: text/plain; charset=ISO-8859-1
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002038 X-FYI-Content-Encoding: base64
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05002039 X-FYI-Content-Type: text/xml
David Ostrovskyfd6c1752014-08-01 19:43:21 +02002040
2041 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
2042----
2043
David Ostrovskyd0078672015-02-06 21:51:04 +01002044Alternatively, if the only value of the Accept request header is
2045`application/json` the content is returned as JSON string and
2046`X-FYI-Content-Encoding` is set to `json`.
2047
David Ostrovsky9ea9c112015-01-25 00:12:38 +01002048[[get-edit-meta-data]]
2049=== Retrieve meta data of a file from Change Edit
2050--
2051'GET /changes/link:#change-id[\{change-id\}]/edit/path%2fto%2ffile/meta
2052--
2053
2054Retrieves meta data of a file from a change edit. Currently only
2055web links are returned.
2056
2057.Request
2058----
2059 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit/foo/meta HTTP/1.0
2060----
2061
2062This REST endpoint retrieves additional information for a file in a
2063change edit. As result an link:#edit-file-info[EditFileInfo] entity is
2064returned.
2065
2066.Response
2067----
2068 HTTP/1.1 200 OK
2069 Content-Disposition: attachment
2070 Content-Type: application/json; charset=UTF-8
2071
2072 )]}'
2073 {
2074 "web_links":[
2075 {
2076 "show_on_side_by_side_diff_view": true,
2077 "name": "side-by-side preview diff",
2078 "image_url": "plugins/xdocs/static/sideBySideDiffPreview.png",
2079 "url": "#/x/xdocs/c/42/1..0/README.md",
2080 "target": "_self"
2081 },
2082 {
2083 "show_on_unified_diff_view": true,
2084 "name": "unified preview diff",
2085 "image_url": "plugins/xdocs/static/unifiedDiffPreview.png",
2086 "url": "#/x/xdocs/c/42/1..0/README.md,unified",
2087 "target": "_self"
2088 }
2089 ]}
2090----
2091
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002092[[get-edit-message]]
2093=== Retrieve commit message from Change Edit or current patch set of the change
2094--
2095'GET /changes/link:#change-id[\{change-id\}]/edit:message
2096--
2097
David Ostrovsky25ad15e2014-12-15 21:18:59 +01002098Retrieves commit message from change edit.
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002099
David Ostrovsky0ee0bb22016-05-31 22:47:47 +02002100If the `base` parameter is set to true, the returned message is from the
2101revision that the edit is based on.
2102
David Ostrovsky3d2c0702014-10-28 23:44:27 +01002103.Request
2104----
2105 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:message HTTP/1.0
2106----
2107
2108The commit message is returned as base64 encoded string.
2109
2110.Response
2111----
2112 HTTP/1.1 200 OK
2113
2114 VGhpcyBpcyBhIGNvbW1pdCBtZXNzYWdlCgpDaGFuZ2UtSWQ6IElhYzhmZGM1MGRlZjFiYWUzYjAz
2115M2JhNjcxZTk0OTBmNzUxNDU5ZGUzCg==
2116----
2117
David Ostrovskyd0078672015-02-06 21:51:04 +01002118Alternatively, if the only value of the Accept request header is
2119`application/json` the commit message is returned as JSON string:
2120
2121.Response
2122----
2123 HTTP/1.1 200 OK
2124
2125)]}'
2126"Subject of the commit message\n\nThis is the body of the commit message.\n\nChange-Id: Iaf1ba916bf843c175673d675bf7f52862f452db9\n"
2127----
2128
2129
David Ostrovskye9988f92014-08-01 09:56:34 +02002130[[publish-edit]]
2131=== Publish Change Edit
2132--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002133'POST /changes/link:#change-id[\{change-id\}]/edit:publish
David Ostrovskye9988f92014-08-01 09:56:34 +02002134--
2135
2136Promotes change edit to a regular patch set.
2137
2138.Request
2139----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002140 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:publish HTTP/1.0
David Ostrovskye9988f92014-08-01 09:56:34 +02002141----
2142
2143As response "`204 No Content`" is returned.
2144
2145.Response
2146----
2147 HTTP/1.1 204 No Content
2148----
2149
David Ostrovsky46999d22014-08-16 02:19:13 +02002150[[rebase-edit]]
2151=== Rebase Change Edit
2152--
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002153'POST /changes/link:#change-id[\{change-id\}]/edit:rebase
David Ostrovsky46999d22014-08-16 02:19:13 +02002154--
2155
2156Rebases change edit on top of latest patch set.
2157
2158.Request
2159----
David Ostrovsky9cbdb202014-11-11 22:39:59 +01002160 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit:rebase HTTP/1.0
David Ostrovsky46999d22014-08-16 02:19:13 +02002161----
2162
2163When change was rebased on top of latest patch set, response
David Pursehouse56fbc082015-05-19 16:33:03 +09002164"`204 No Content`" is returned. When change edit is already
David Ostrovsky46999d22014-08-16 02:19:13 +02002165based on top of the latest patch set, the response
2166"`409 Conflict`" is returned.
2167
2168.Response
2169----
2170 HTTP/1.1 204 No Content
2171----
2172
David Ostrovsky8e75f502014-08-10 00:36:31 +02002173[[delete-edit]]
2174=== Delete Change Edit
2175--
2176'DELETE /changes/link:#change-id[\{change-id\}]/edit'
2177--
2178
2179Deletes change edit.
2180
2181.Request
2182----
2183 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/edit HTTP/1.0
2184----
2185
2186As response "`204 No Content`" is returned.
2187
2188.Response
2189----
2190 HTTP/1.1 204 No Content
2191----
2192
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002193[[reviewer-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002194== Reviewer Endpoints
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002195
2196[[list-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002197=== List Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002198--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002199'GET /changes/link:#change-id[\{change-id\}]/reviewers/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002200--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002201
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002202Lists the reviewers of a change.
2203
2204As result a list of link:#reviewer-info[ReviewerInfo] entries is returned.
2205
2206.Request
2207----
2208 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/ HTTP/1.0
2209----
2210
2211.Response
2212----
2213 HTTP/1.1 200 OK
2214 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002215 Content-Type: application/json; charset=UTF-8
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002216
2217 )]}'
2218 [
2219 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002220 "approvals": {
2221 "Verified": "+1",
2222 "Code-Review": "+2"
2223 },
2224 "_account_id": 1000096,
2225 "name": "John Doe",
2226 "email": "john.doe@example.com"
2227 },
2228 {
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01002229 "approvals": {
2230 "Verified": " 0",
2231 "Code-Review": "-1"
2232 },
2233 "_account_id": 1000097,
2234 "name": "Jane Roe",
2235 "email": "jane.roe@example.com"
2236 }
2237 ]
2238----
2239
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002240[[suggest-reviewers]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002241=== Suggest Reviewers
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002242--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002243'GET /changes/link:#change-id[\{change-id\}]/suggest_reviewers?q=J&n=5'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002244--
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002245
2246Suggest the reviewers for a given query `q` and result limit `n`. If result
2247limit is not passed, then the default 10 is used.
2248
2249As result a list of link:#suggested-reviewer-info[SuggestedReviewerInfo] entries is returned.
2250
2251.Request
2252----
2253 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/suggest_reviewers?q=J HTTP/1.0
2254----
2255
2256.Response
2257----
2258 HTTP/1.1 200 OK
2259 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002260 Content-Type: application/json; charset=UTF-8
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002261
2262 )]}'
2263 [
2264 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002265 "account": {
2266 "_account_id": 1000097,
2267 "name": "Jane Roe",
2268 "email": "jane.roe@example.com"
Logan Hanksab3c81e2016-07-20 15:42:52 -07002269 },
2270 "count": 1
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002271 },
2272 {
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002273 "group": {
2274 "id": "4fd581c0657268f2bdcc26699fbf9ddb76e3a279",
2275 "name": "Joiner"
Logan Hanksab3c81e2016-07-20 15:42:52 -07002276 },
2277 "count": 5
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02002278 }
2279 ]
2280----
2281
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002282[[get-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002283=== Get Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002284--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002285'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 -08002286--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002287
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002288Retrieves a reviewer of a change.
2289
2290As response a link:#reviewer-info[ReviewerInfo] entity is returned that
2291describes the reviewer.
2292
2293.Request
2294----
2295 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/john.doe@example.com HTTP/1.0
2296----
2297
2298.Response
2299----
2300 HTTP/1.1 200 OK
2301 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002302 Content-Type: application/json; charset=UTF-8
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002303
2304 )]}'
2305 {
Edwin Kempina3d02ef2013-02-22 16:31:53 +01002306 "approvals": {
2307 "Verified": "+1",
2308 "Code-Review": "+2"
2309 },
2310 "_account_id": 1000096,
2311 "name": "John Doe",
2312 "email": "john.doe@example.com"
2313 }
2314----
2315
Edwin Kempin392328e2013-02-25 12:50:03 +01002316[[add-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002317=== Add Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002318--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002319'POST /changes/link:#change-id[\{change-id\}]/reviewers'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002320--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002321
Edwin Kempin392328e2013-02-25 12:50:03 +01002322Adds one user or all members of one group as reviewer to the change.
2323
2324The reviewer to be added to the change must be provided in the request
2325body as a link:#reviewer-input[ReviewerInput] entity.
2326
2327.Request
2328----
2329 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002330 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002331
2332 {
2333 "reviewer": "john.doe@example.com"
2334 }
2335----
2336
2337As response an link:#add-reviewer-result[AddReviewerResult] entity is
2338returned that describes the newly added reviewers.
2339
2340.Response
2341----
2342 HTTP/1.1 200 OK
2343 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002344 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002345
2346 )]}'
2347 {
2348 "reviewers": [
2349 {
Logan Hanks23e70282016-07-06 14:31:56 -07002350 "input": "john.doe@example.com",
Edwin Kempin392328e2013-02-25 12:50:03 +01002351 "approvals": {
2352 "Verified": " 0",
2353 "Code-Review": " 0"
2354 },
2355 "_account_id": 1000096,
2356 "name": "John Doe",
2357 "email": "john.doe@example.com"
2358 }
2359 ]
2360 }
2361----
2362
2363If a group is specified, adding the group members as reviewers is an
2364atomic operation. This means if an error is returned, none of the
2365members are added as reviewer.
2366
2367If a group with many members is added as reviewer a confirmation may be
2368required.
2369
2370.Request
2371----
2372 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002373 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002374
2375 {
2376 "reviewer": "MyProjectVerifiers"
2377 }
2378----
2379
2380.Response
2381----
2382 HTTP/1.1 200 OK
2383 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002384 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002385
2386 )]}'
2387 {
Logan Hanks23e70282016-07-06 14:31:56 -07002388 "input": "MyProjectVerifiers",
Edwin Kempin392328e2013-02-25 12:50:03 +01002389 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
2390 "confirm": true
2391 }
2392----
2393
2394To confirm the addition of the reviewers, resend the request with the
Edwin Kempin08da43d2013-02-26 11:06:58 +01002395`confirmed` flag being set.
Edwin Kempin392328e2013-02-25 12:50:03 +01002396
2397.Request
2398----
2399 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002400 Content-Type: application/json; charset=UTF-8
Edwin Kempin392328e2013-02-25 12:50:03 +01002401
2402 {
Logan Hanks23e70282016-07-06 14:31:56 -07002403 "input": "MyProjectVerifiers",
Edwin Kempin08da43d2013-02-26 11:06:58 +01002404 "confirmed": true
Edwin Kempin392328e2013-02-25 12:50:03 +01002405 }
2406----
2407
Edwin Kempin53301072013-02-25 12:57:07 +01002408[[delete-reviewer]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002409=== Delete Reviewer
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002410--
Edwin Kempin407fca32016-08-29 12:01:00 +02002411'DELETE /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]' +
2412'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 -08002413--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002414
Edwin Kempin53301072013-02-25 12:57:07 +01002415Deletes a reviewer from a change.
2416
Edwin Kempin407fca32016-08-29 12:01:00 +02002417Options can be provided in the request body as a
2418link:#delete-reviewer-input[DeleteReviewerInput] entity.
2419
Edwin Kempin53301072013-02-25 12:57:07 +01002420.Request
2421----
2422 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe HTTP/1.0
Edwin Kempin407fca32016-08-29 12:01:00 +02002423 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
2424----
2425
2426Please note that some proxies prohibit request bodies for DELETE
2427requests. In this case, if you want to specify options, use a POST
2428request:
2429
2430.Request
2431----
2432 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/delete HTTP/1.0
2433 Content-Type: application/json; charset=UTF-8
2434
2435 {
2436 "notify": "NONE"
2437 }
Edwin Kempin53301072013-02-25 12:57:07 +01002438----
2439
2440.Response
2441----
2442 HTTP/1.1 204 No Content
2443----
2444
David Ostrovskybeb0b842014-12-13 00:24:29 +01002445[[list-votes]]
2446=== List Votes
2447--
2448'GET /changes/link:#change-id[\{change-id\}]/reviewers/link:rest-api-accounts.html#account-id[\{account-id\}]/votes/'
2449--
2450
2451Lists the votes for a specific reviewer of the change.
2452
2453.Request
2454----
Edwin Kempin314f10a2016-07-11 11:39:05 +02002455 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/ HTTP/1.0
David Ostrovskybeb0b842014-12-13 00:24:29 +01002456----
2457
2458As result a map is returned that maps the label name to the label value.
2459The entries in the map are sorted by label name.
2460
2461.Response
2462----
2463 HTTP/1.1 200 OK
2464 Content-Disposition: attachment
2465 Content-Type: application/json;charset=UTF-8
2466
2467 )]}'
2468 {
2469 "Code-Review": -1,
2470 "Verified": 1
2471 "Work-In-Progress": 1,
2472 }
2473----
2474
2475[[delete-vote]]
2476=== Delete Vote
2477--
2478'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 +02002479'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 +01002480--
2481
2482Deletes a single vote from a change. Note, that even when the last vote of
2483a reviewer is removed the reviewer itself is still listed on the change.
2484
Edwin Kempin1dfecb62016-06-16 10:45:00 +02002485Options can be provided in the request body as a
2486link:#delete-vote-input[DeleteVoteInput] entity.
2487
David Ostrovskybeb0b842014-12-13 00:24:29 +01002488.Request
2489----
2490 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review HTTP/1.0
Edwin Kempin1dfecb62016-06-16 10:45:00 +02002491 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
2492----
2493
2494Please note that some proxies prohibit request bodies for DELETE
2495requests. In this case, if you want to specify options, use a POST
2496request:
2497
2498.Request
2499----
2500 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/reviewers/John%20Doe/votes/Code-Review/delete HTTP/1.0
2501 Content-Type: application/json; charset=UTF-8
2502
2503 {
2504 "notify": "NONE"
2505 }
David Ostrovskybeb0b842014-12-13 00:24:29 +01002506----
2507
2508.Response
2509----
2510 HTTP/1.1 204 No Content
2511----
2512
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002513[[revision-endpoints]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002514== Revision Endpoints
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002515
Shawn Pearce728ba882013-07-08 23:13:08 -07002516[[get-commit]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002517=== Get Commit
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002518--
Shawn Pearce728ba882013-07-08 23:13:08 -07002519'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/commit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002520--
Shawn Pearce728ba882013-07-08 23:13:08 -07002521
2522Retrieves a parsed commit of a revision.
2523
2524.Request
2525----
2526 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/commit HTTP/1.0
2527----
2528
2529As response a link:#commit-info[CommitInfo] entity is returned that
2530describes the revision.
2531
2532.Response
2533----
2534 HTTP/1.1 200 OK
2535 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002536 Content-Type: application/json; charset=UTF-8
Shawn Pearce728ba882013-07-08 23:13:08 -07002537
2538 )]}'
2539 {
Edwin Kempinc8237402015-07-15 18:27:55 +02002540 "commit": "674ac754f91e64a0efb8087e59a176484bd534d1",
Shawn Pearce728ba882013-07-08 23:13:08 -07002541 "parents": [
2542 {
2543 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
2544 "subject": "Migrate contributor agreements to All-Projects."
2545 }
2546 ],
2547 "author": {
2548 "name": "Shawn O. Pearce",
2549 "email": "sop@google.com",
2550 "date": "2012-04-24 18:08:08.000000000",
2551 "tz": -420
2552 },
2553 "committer": {
2554 "name": "Shawn O. Pearce",
2555 "email": "sop@google.com",
2556 "date": "2012-04-24 18:08:08.000000000",
2557 "tz": -420
2558 },
2559 "subject": "Use an EventBus to manage star icons",
2560 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
2561 }
2562----
2563
Sven Selbergd26bd542014-11-21 16:28:10 +01002564Adding query parameter `links` (for example `/changes/.../commit?links`)
2565returns a link:#commit-info[CommitInfo] with the additional field `web_links`.
Shawn Pearce728ba882013-07-08 23:13:08 -07002566
Stefan Bellerc7259662015-02-12 17:23:05 -08002567[[get-revision-actions]]
2568=== Get Revision Actions
2569--
2570'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/actions'
2571--
2572
2573Retrieves revision link:#action-info[actions] of the revision of a change.
2574
2575.Request
2576----
2577 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/actions' HTTP/1.0
2578----
2579
2580.Response
2581----
2582 HTTP/1.1 200 OK
2583 Content-Disposition: attachment
2584 Content-Type: application/json; charset=UTF-8
2585
2586 )]}'
2587
2588{
2589 "submit": {
2590 "method": "POST",
2591 "label": "Submit",
2592 "title": "Submit patch set 1 into master",
2593 "enabled": true
2594 },
2595 "cherrypick": {
2596 "method": "POST",
2597 "label": "Cherry Pick",
2598 "title": "Cherry pick change to a different branch",
2599 "enabled": true
2600 }
2601}
2602----
2603
2604The response is a flat map of possible revision actions mapped to their
2605link:#action-info[ActionInfo].
2606
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002607[[get-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002608=== Get Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002609--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002610'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002611--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002612
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002613Retrieves a review of a revision.
2614
2615.Request
2616----
2617 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
2618----
2619
2620As response a link:#change-info[ChangeInfo] entity with
2621link:#detailed-labels[detailed labels] and link:#detailed-accounts[
2622detailed accounts] is returned that describes the review of the
2623revision. The revision for which the review is retrieved is contained
2624in the `revisions` field. In addition the `current_revision` field is
John Spurlockd25fad12013-03-09 11:48:49 -05002625set if the revision for which the review is retrieved is the current
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002626revision of the change. Please note that the returned labels are always
2627for the current patch set.
2628
2629.Response
2630----
2631 HTTP/1.1 200 OK
2632 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002633 Content-Type: application/json; charset=UTF-8
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002634
2635 )]}'
2636 {
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002637 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
2638 "project": "myProject",
2639 "branch": "master",
2640 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
2641 "subject": "Implementing Feature X",
2642 "status": "NEW",
2643 "created": "2013-02-01 09:59:32.126000000",
2644 "updated": "2013-02-21 11:16:36.775000000",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002645 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01002646 "insertions": 34,
2647 "deletions": 45,
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002648 "_number": 3965,
2649 "owner": {
2650 "_account_id": 1000096,
2651 "name": "John Doe",
2652 "email": "john.doe@example.com"
2653 },
2654 "labels": {
2655 "Verified": {
2656 "all": [
2657 {
2658 "value": 0,
2659 "_account_id": 1000096,
2660 "name": "John Doe",
2661 "email": "john.doe@example.com"
2662 },
2663 {
2664 "value": 0,
2665 "_account_id": 1000097,
2666 "name": "Jane Roe",
2667 "email": "jane.roe@example.com"
2668 }
2669 ],
2670 "values": {
2671 "-1": "Fails",
2672 " 0": "No score",
2673 "+1": "Verified"
2674 }
2675 },
2676 "Code-Review": {
2677 "all": [
2678 {
2679 "value": -1,
2680 "_account_id": 1000096,
2681 "name": "John Doe",
2682 "email": "john.doe@example.com"
2683 },
2684 {
2685 "value": 1,
2686 "_account_id": 1000097,
2687 "name": "Jane Roe",
2688 "email": "jane.roe@example.com"
2689 }
2690 ]
2691 "values": {
Paul Fertser2474e522014-01-23 10:00:59 +04002692 "-2": "This shall not be merged",
2693 "-1": "I would prefer this is not merged as is",
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002694 " 0": "No score",
2695 "+1": "Looks good to me, but someone else must approve",
2696 "+2": "Looks good to me, approved"
2697 }
2698 }
2699 },
2700 "permitted_labels": {
2701 "Verified": [
2702 "-1",
2703 " 0",
2704 "+1"
2705 ],
2706 "Code-Review": [
2707 "-2",
2708 "-1",
2709 " 0",
2710 "+1",
2711 "+2"
2712 ]
2713 },
2714 "removable_reviewers": [
2715 {
2716 "_account_id": 1000096,
2717 "name": "John Doe",
2718 "email": "john.doe@example.com"
2719 },
2720 {
2721 "_account_id": 1000097,
2722 "name": "Jane Roe",
2723 "email": "jane.roe@example.com"
2724 }
2725 ],
Edwin Kempin66af3d82015-11-10 17:38:40 -08002726 "reviewers": {
2727 "REVIEWER": [
2728 {
2729 "_account_id": 1000096,
2730 "name": "John Doe",
2731 "email": "john.doe@example.com"
2732 },
2733 {
2734 "_account_id": 1000097,
2735 "name": "Jane Roe",
2736 "email": "jane.roe@example.com"
2737 }
2738 ]
2739 },
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002740 "current_revision": "674ac754f91e64a0efb8087e59a176484bd534d1",
2741 "revisions": {
2742 "674ac754f91e64a0efb8087e59a176484bd534d1": {
David Pursehouse4de41112016-06-28 09:24:08 +09002743 "kind": "REWORK",
2744 "_number": 2,
2745 "ref": "refs/changes/65/3965/2",
2746 "fetch": {
2747 "http": {
2748 "url": "http://gerrit/myProject",
2749 "ref": "refs/changes/65/3965/2"
2750 }
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01002751 }
2752 }
2753 }
2754 }
2755----
2756
David Pursehouse669f2512014-07-18 11:41:42 +09002757[[get-related-changes]]
2758=== Get Related Changes
2759--
2760'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/related'
2761--
2762
2763Retrieves related changes of a revision. Related changes are changes that either
2764depend on, or are dependencies of the revision.
2765
2766.Request
2767----
2768 GET /changes/gerrit~master~I5e4fc08ce34d33c090c9e0bf320de1b17309f774/revisions/b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe/related HTTP/1.0
2769----
2770
2771As result a link:#related-changes-info[RelatedChangesInfo] entity is returned
2772describing the related changes.
2773
2774.Response
2775----
2776 HTTP/1.1 200 OK
2777 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002778 Content-Type: application/json; charset=UTF-8
David Pursehouse669f2512014-07-18 11:41:42 +09002779
2780 )]}'
2781 {
2782 "changes": [
2783 {
2784 "change_id": "Ic62ae3103fca2214904dbf2faf4c861b5f0ae9b5",
2785 "commit": {
2786 "commit": "78847477532e386f5a2185a4e8c90b2509e354e3",
2787 "parents": [
2788 {
2789 "commit": "bb499510bbcdbc9164d96b0dbabb4aa45f59a87e"
2790 }
2791 ],
2792 "author": {
2793 "name": "David Ostrovsky",
2794 "email": "david@ostrovsky.org",
2795 "date": "2014-07-12 15:04:24.000000000",
2796 "tz": 120
2797 },
2798 "subject": "Remove Solr"
2799 },
2800 "_change_number": 58478,
2801 "_revision_number": 2,
2802 "_current_revision_number": 2
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07002803 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09002804 },
2805 {
2806 "change_id": "I5e4fc08ce34d33c090c9e0bf320de1b17309f774",
2807 "commit": {
2808 "commit": "b1cb4caa6be46d12b94c25aa68aebabcbb3f53fe",
2809 "parents": [
2810 {
2811 "commit": "d898f12a9b7a92eb37e7a80636195a1b06417aad"
2812 }
2813 ],
2814 "author": {
2815 "name": "David Pursehouse",
2816 "email": "david.pursehouse@sonymobile.com",
2817 "date": "2014-06-24 02:01:28.000000000",
2818 "tz": 540
2819 },
2820 "subject": "Add support for secondary index with Elasticsearch"
2821 },
2822 "_change_number": 58081,
2823 "_revision_number": 10,
2824 "_current_revision_number": 10
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07002825 "status": "NEW"
David Pursehouse669f2512014-07-18 11:41:42 +09002826 }
2827 ]
2828 }
2829----
2830
2831
Edwin Kempin67498de2013-02-25 16:15:34 +01002832[[set-review]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002833=== Set Review
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002834--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002835'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/review'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002836--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01002837
Edwin Kempin67498de2013-02-25 16:15:34 +01002838Sets a review on a revision.
2839
2840The review must be provided in the request body as a
2841link:#review-input[ReviewInput] entity.
2842
2843.Request
2844----
2845 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002846 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01002847
2848 {
Dariusz Lukszac70e8622016-03-15 14:05:51 +01002849 "tag": "jenkins",
Edwin Kempin67498de2013-02-25 16:15:34 +01002850 "message": "Some nits need to be fixed.",
2851 "labels": {
2852 "Code-Review": -1
2853 },
2854 "comments": {
2855 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
2856 {
2857 "line": 23,
2858 "message": "[nit] trailing whitespace"
2859 },
2860 {
2861 "line": 49,
2862 "message": "[nit] s/conrtol/control"
David Pursehouseb53c1f62014-08-26 14:51:33 +09002863 },
2864 {
2865 "range": {
2866 "start_line": 50,
2867 "start_character": 0,
2868 "end_line": 55,
2869 "end_character": 20
2870 },
David Pursehouseb53c1f62014-08-26 14:51:33 +09002871 "message": "Incorrect indentation"
Edwin Kempin67498de2013-02-25 16:15:34 +01002872 }
2873 ]
2874 }
2875 }
2876----
2877
2878As response a link:#review-info[ReviewInfo] entity is returned that
2879describes the applied labels.
2880
2881.Response
2882----
2883 HTTP/1.1 200 OK
2884 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09002885 Content-Type: application/json; charset=UTF-8
Edwin Kempin67498de2013-02-25 16:15:34 +01002886
2887 )]}'
2888 {
2889 "labels": {
2890 "Code-Review": -1
2891 }
2892 }
2893----
2894
Edwin Kempind0febd32015-01-07 10:27:31 +01002895A review cannot be set on a change edit. Trying to post a review for a
2896change edit fails with `409 Conflict`.
2897
Logan Hanks5f1c7592016-07-06 14:39:33 -07002898It is also possible to add one or more reviewers to a change simultaneously
2899with a review.
2900
2901.Request
2902----
2903 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/review HTTP/1.0
2904 Content-Type: application/json; charset=UTF-8
2905
2906 {
2907 "message": "Looks good to me, but Jane and John should also take a look.",
2908 "labels": {
2909 "Code-Review": 1
2910 },
2911 "reviewers": [
2912 {
2913 "reviewer": "jane.roe@example.com"
2914 },
2915 {
2916 "reviewer": "john.doe@example.com"
2917 }
2918 ]
2919 }
2920----
2921
2922Each element of the `reviewers` list is an instance of
2923link:#reviewer-input[ReviewerInput]. The corresponding result of
2924adding each reviewer will be returned in a list of
Logan Hankse2aacef2016-07-22 15:54:52 -07002925link:#add-reviewer-result[AddReviewerResult].
Logan Hanks5f1c7592016-07-06 14:39:33 -07002926
2927.Response
2928----
2929 HTTP/1.1 200 OK
2930 Content-Disposition: attachment
2931 Content-Type: application/json; charset=UTF-8
2932
2933 )]}'
2934 {
2935 "labels": {
2936 "Code-Review": 1
2937 },
2938 "reviewers": [
2939 {
2940 "input": "jane.roe@example.com",
2941 "approvals": {
2942 "Verified": " 0",
2943 "Code-Review": " 0"
2944 },
2945 "_account_id": 1000097,
2946 "name": "Jane Roe",
2947 "email": "jane.roe@example.com"
2948 },
2949 {
2950 "input": "john.doe@example.com",
2951 "approvals": {
2952 "Verified": " 0",
2953 "Code-Review": " 0"
2954 },
2955 "_account_id": 1000096,
2956 "name": "John Doe",
2957 "email": "john.doe@example.com"
2958 }
2959 ]
2960 }
2961----
2962
Logan Hankse2aacef2016-07-22 15:54:52 -07002963If there are any errors returned for reviewers, the entire review request will
2964be rejected with `400 Bad Request`.
2965
2966.Error Response
2967----
2968 HTTP/1.1 400 Bad Request
2969 Content-Disposition: attachment
2970 Content-Type: application/json; charset=UTF-8
2971
2972 )]}'
2973 {
2974 "reviewers": {
2975 "MyProjectVerifiers": {
2976 "input": "MyProjectVerifiers",
2977 "error": "The group My Group has 15 members. Do you want to add them all as reviewers?",
2978 "confirm": true
2979 }
2980 }
2981 }
2982----
2983
Edwin Kempincdae63b2013-03-15 15:06:59 +01002984[[rebase-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002985=== Rebase Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002986--
Edwin Kempincdae63b2013-03-15 15:06:59 +01002987'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/rebase'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08002988--
Edwin Kempincdae63b2013-03-15 15:06:59 +01002989
2990Rebases a revision.
2991
Zalan Blenessy874aed72015-01-12 13:26:18 +01002992Optionally, the parent revision can be changed to another patch set through the
2993link:#rebase-input[RebaseInput] entity.
2994
Edwin Kempincdae63b2013-03-15 15:06:59 +01002995.Request
2996----
2997 POST /changes/myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/rebase HTTP/1.0
Zalan Blenessy874aed72015-01-12 13:26:18 +01002998 Content-Type: application/json;charset=UTF-8
2999
3000 {
3001 "base" : "1234",
3002 }
Edwin Kempincdae63b2013-03-15 15:06:59 +01003003----
3004
3005As response a link:#change-info[ChangeInfo] entity is returned that
3006describes the rebased change. Information about the current patch set
3007is included.
3008
3009.Response
3010----
3011 HTTP/1.1 200 OK
3012 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003013 Content-Type: application/json; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01003014
3015 )]}'
3016 {
Edwin Kempincdae63b2013-03-15 15:06:59 +01003017 "id": "myProject~master~I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
3018 "project": "myProject",
3019 "branch": "master",
3020 "change_id": "I3ea943139cb62e86071996f2480e58bf3eeb9dd2",
3021 "subject": "Implement Feature X",
3022 "status": "NEW",
3023 "created": "2013-02-01 09:59:32.126000000",
3024 "updated": "2013-02-21 11:16:36.775000000",
3025 "mergeable": false,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01003026 "insertions": 21,
3027 "deletions": 21,
Edwin Kempincdae63b2013-03-15 15:06:59 +01003028 "_number": 4799,
3029 "owner": {
3030 "name": "John Doe"
3031 },
3032 "current_revision": "27cc4558b5a3d3387dd11ee2df7a117e7e581822",
3033 "revisions": {
3034 "27cc4558b5a3d3387dd11ee2df7a117e7e581822": {
David Pursehouse4de41112016-06-28 09:24:08 +09003035 "kind": "REWORK",
Edwin Kempincdae63b2013-03-15 15:06:59 +01003036 "_number": 2,
Edwin Kempin4569ced2014-11-25 16:45:05 +01003037 "ref": "refs/changes/99/4799/2",
Edwin Kempincdae63b2013-03-15 15:06:59 +01003038 "fetch": {
3039 "http": {
3040 "url": "http://gerrit:8080/myProject",
3041 "ref": "refs/changes/99/4799/2"
3042 }
3043 },
3044 "commit": {
3045 "parents": [
3046 {
3047 "commit": "b4003890dadd406d80222bf1ad8aca09a4876b70",
3048 "subject": "Implement Feature A"
3049 }
Yuxuan Wangcc598ac2016-07-12 17:11:05 +00003050 ],
3051 "author": {
3052 "name": "John Doe",
3053 "email": "john.doe@example.com",
3054 "date": "2013-05-07 15:21:27.000000000",
3055 "tz": 120
3056 },
3057 "committer": {
3058 "name": "Gerrit Code Review",
3059 "email": "gerrit-server@example.com",
3060 "date": "2013-05-07 15:35:43.000000000",
3061 "tz": 120
3062 },
3063 "subject": "Implement Feature X",
3064 "message": "Implement Feature X\n\nAdded feature X."
Edwin Kempincdae63b2013-03-15 15:06:59 +01003065 }
3066 }
3067 }
3068----
3069
3070If the revision cannot be rebased, e.g. due to conflicts, the response is
3071"`409 Conflict`" and the error message is contained in the response
3072body.
3073
3074.Response
3075----
3076 HTTP/1.1 409 Conflict
3077 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003078 Content-Type: text/plain; charset=UTF-8
Edwin Kempincdae63b2013-03-15 15:06:59 +01003079
3080 The change could not be rebased due to a path conflict during merge.
3081----
3082
Edwin Kempin14b58112013-02-26 16:30:19 +01003083[[submit-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003084=== Submit Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003085--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003086'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003087--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003088
Edwin Kempin14b58112013-02-26 16:30:19 +01003089Submits a revision.
3090
Edwin Kempin14b58112013-02-26 16:30:19 +01003091.Request
3092----
3093 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/submit HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003094 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003095----
3096
3097As response a link:#submit-info[SubmitInfo] entity is returned that
3098describes the status of the submitted change.
3099
3100.Response
3101----
3102 HTTP/1.1 200 OK
3103 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003104 Content-Type: application/json; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003105
3106 )]}'
3107 {
3108 "status": "MERGED"
3109 }
3110----
3111
3112If the revision cannot be submitted, e.g. because the submit rule
3113doesn't allow submitting the revision or the revision is not the
3114current revision, the response is "`409 Conflict`" and the error
3115message is contained in the response body.
3116
3117.Response
3118----
3119 HTTP/1.1 409 Conflict
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003120 Content-Type: text/plain; charset=UTF-8
Edwin Kempin14b58112013-02-26 16:30:19 +01003121
3122 "revision 674ac754f91e64a0efb8087e59a176484bd534d1 is not current revision"
3123----
3124
David Ostrovsky0d69c232013-09-10 23:10:23 +02003125[[publish-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003126=== Publish Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003127--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003128'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/publish'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003129--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003130
3131Publishes a draft revision.
3132
3133.Request
3134----
3135 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/publish HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003136 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02003137----
3138
3139.Response
3140----
3141 HTTP/1.1 204 No Content
3142----
3143
3144[[delete-draft-revision]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003145=== Delete Draft Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003146--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003147'DELETE /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003148--
David Ostrovsky0d69c232013-09-10 23:10:23 +02003149
3150Deletes a draft revision.
3151
3152.Request
3153----
3154 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1 HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003155 Content-Type: application/json; charset=UTF-8
David Ostrovsky0d69c232013-09-10 23:10:23 +02003156----
3157
3158.Response
3159----
3160 HTTP/1.1 204 No Content
3161----
3162
Edwin Kempin257d70f2013-03-28 14:31:14 +01003163[[get-patch]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003164=== Get Patch
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003165--
Edwin Kempin257d70f2013-03-28 14:31:14 +01003166'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/patch'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003167--
Edwin Kempin257d70f2013-03-28 14:31:14 +01003168
3169Gets the formatted patch for one revision.
3170
3171.Request
3172----
3173 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/patch HTTP/1.0
3174----
3175
Shawn Pearce98361f72013-05-10 16:27:36 -07003176The formatted patch is returned as text encoded inside base64:
Edwin Kempin257d70f2013-03-28 14:31:14 +01003177
3178.Response
3179----
3180 HTTP/1.1 200 OK
3181 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003182 Content-Type: text/plain; charset=ISO-8859-1
Shawn Pearce98361f72013-05-10 16:27:36 -07003183 X-FYI-Content-Encoding: base64
3184 X-FYI-Content-Type: application/mbox
Edwin Kempin257d70f2013-03-28 14:31:14 +01003185
Shawn Pearce98361f72013-05-10 16:27:36 -07003186 RnJvbSA3ZGFkY2MxNTNmZGVhMTdhYTg0ZmYzMmE2ZTI0NWRiYjY...
Edwin Kempin257d70f2013-03-28 14:31:14 +01003187----
3188
David Ostrovsky973f38b2013-08-22 00:24:51 -07003189Adding query parameter `zip` (for example `/changes/.../patch?zip`)
3190returns the patch as a single file inside of a ZIP archive. Clients
3191can expand the ZIP to obtain the plain text patch, avoiding the
3192need for a base64 decoding step. This option implies `download`.
3193
3194Query parameter `download` (e.g. `/changes/.../patch?download`)
3195will suggest the browser save the patch as `commitsha1.diff.base64`,
3196for later processing by command line tools.
3197
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003198[[get-mergeable]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003199=== Get Mergeable
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003200--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003201'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/mergeable'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003202--
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003203
3204Gets the method the server will use to submit (merge) the change and
3205an indicator if the change is currently mergeable.
3206
3207.Request
3208----
3209 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable HTTP/1.0
3210----
3211
Saša Živkov499873f2014-05-05 13:34:18 +02003212As response a link:#mergeable-info[MergeableInfo] entity is returned.
3213
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003214.Response
3215----
3216 HTTP/1.1 200 OK
3217 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003218 Content-Type: application/json; charset=UTF-8
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003219
3220 )]}'
3221 {
3222 submit_type: "MERGE_IF_NECESSARY",
Zhen Chenf7d85ea2016-05-02 15:14:43 -07003223 strategy: "recursive",
3224 mergeable: true
Shawn Pearce3a2a2472013-07-17 16:40:45 -07003225 }
3226----
3227
Saša Živkov697cab22014-04-29 16:46:50 +02003228If the `other-branches` parameter is specified, the mergeability will also be
3229checked for all other branches.
3230
3231.Request
3232----
3233 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/mergeable?other-branches HTTP/1.0
3234----
3235
3236The response will then contain a list of all other branches where this changes
3237could merge cleanly.
3238
3239.Response
3240----
3241 HTTP/1.1 200 OK
3242 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003243 Content-Type: application/json; charset=UTF-8
Saša Živkov697cab22014-04-29 16:46:50 +02003244
3245 )]}'
3246 {
3247 submit_type: "MERGE_IF_NECESSARY",
3248 mergeable: true,
3249 mergeable_into: [
3250 "refs/heads/stable-2.7",
3251 "refs/heads/stable-2.8",
3252 ]
3253 }
3254----
3255
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003256[[get-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003257=== Get Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003258--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003259'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003260--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003261
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003262Gets the method the server will use to submit (merge) the change.
3263
3264.Request
3265----
3266 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/submit_type HTTP/1.0
3267----
3268
3269.Response
3270----
3271 HTTP/1.1 200 OK
3272 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003273 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003274
3275 )]}'
3276 "MERGE_IF_NECESSARY"
3277----
3278
3279[[test-submit-type]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003280=== Test Submit Type
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003281--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003282'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_type'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003283--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003284
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003285Tests the submit_type Prolog rule in the project, or the one given.
3286
3287Request body may be either the Prolog code as `text/plain` or a
3288link:#rule-input[RuleInput] object. The query parameter `filters`
3289may be set to `SKIP` to bypass parent project filters while testing
3290a project-specific rule.
3291
3292.Request
3293----
3294 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_type HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003295 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003296
3297 submit_type(cherry_pick).
3298----
3299
3300.Response
3301----
3302 HTTP/1.1 200 OK
3303 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003304 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003305
3306 )]}'
Shawn Pearce7076f4e2013-08-20 22:11:51 -07003307 "CHERRY_PICK"
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003308----
3309
3310[[test-submit-rule]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003311=== Test Submit Rule
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003312--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003313'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/test.submit_rule'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003314--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003315
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003316Tests the submit_rule Prolog rule in the project, or the one given.
3317
3318Request body may be either the Prolog code as `text/plain` or a
3319link:#rule-input[RuleInput] object. The query parameter `filters`
3320may be set to `SKIP` to bypass parent project filters while testing
3321a project-specific rule.
3322
3323.Request
3324----
Shawn Pearcea3cce712014-03-21 08:16:11 -07003325 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/current/test.submit_rule?filters=SKIP HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003326 Content-Type: text/plain; charset-UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003327
3328 submit_rule(submit(R)) :-
3329 R = label('Any-Label-Name', reject(_)).
3330----
3331
3332The response is a list of link:#submit-record[SubmitRecord] entries
3333describing the permutations that satisfy the tested submit rule.
3334
3335.Response
3336----
3337 HTTP/1.1 200 OK
3338 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003339 Content-Type: application/json; charset=UTF-8
Shawn Pearceb1f730b2013-03-04 07:54:09 -08003340
3341 )]}'
3342 [
3343 {
3344 "status": "NOT_READY",
3345 "reject": {
3346 "Any-Label-Name": {}
3347 }
3348 }
3349 ]
3350----
3351
Shawn Pearceb42e3032015-04-02 10:28:10 -07003352When testing with the `curl` command line client the
3353`--data-binary @rules.pl` flag should be used to ensure
3354all LFs are included in the Prolog code:
3355
3356----
3357 curl -X POST \
3358 -H 'Content-Type: text/plain; charset=UTF-8' \
3359 --data-binary @rules.pl \
3360 http://.../test.submit_rule
3361----
3362
Edwin Kempincb6724a2013-02-26 16:58:51 +01003363[[list-drafts]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07003364=== List Revision Drafts
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003365--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003366'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003367--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003368
Edwin Kempin3ca57192013-02-27 07:44:01 +01003369Lists the draft comments of a revision that belong to the calling
Edwin Kempincb6724a2013-02-26 16:58:51 +01003370user.
3371
Dave Borowitz23fec2b2015-04-28 17:40:07 -07003372Returns a map of file paths to lists of link:#comment-info[CommentInfo]
3373entries. The entries in the map are sorted by file path.
Edwin Kempincb6724a2013-02-26 16:58:51 +01003374
3375.Request
3376----
3377 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/ HTTP/1.0
3378----
3379
3380.Response
3381----
3382 HTTP/1.1 200 OK
3383 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003384 Content-Type: application/json; charset=UTF-8
Edwin Kempincb6724a2013-02-26 16:58:51 +01003385
3386 )]}'
3387 {
3388 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3389 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01003390 "id": "TvcXrmjM",
3391 "line": 23,
3392 "message": "[nit] trailing whitespace",
3393 "updated": "2013-02-26 15:40:43.986000000"
3394 },
3395 {
Edwin Kempincb6724a2013-02-26 16:58:51 +01003396 "id": "TveXwFiA",
3397 "line": 49,
3398 "in_reply_to": "TfYX-Iuo",
3399 "message": "Done",
3400 "updated": "2013-02-26 15:40:45.328000000"
3401 }
3402 ]
3403 }
3404----
3405
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003406[[create-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003407=== Create Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003408--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003409'PUT /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/drafts'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003410--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003411
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003412Creates a draft comment on a revision.
3413
3414The new draft comment must be provided in the request body inside a
3415link:#comment-input[CommentInput] entity.
3416
3417.Request
3418----
3419 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003420 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003421
3422 {
3423 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3424 "line": 23,
3425 "message": "[nit] trailing whitespace"
3426 }
3427----
3428
3429As response a link:#comment-info[CommentInfo] entity is returned that
3430describes the draft comment.
3431
3432.Response
3433----
3434 HTTP/1.1 200 OK
3435 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003436 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003437
3438 )]}'
3439 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003440 "id": "TvcXrmjM",
3441 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3442 "line": 23,
3443 "message": "[nit] trailing whitespace",
3444 "updated": "2013-02-26 15:40:43.986000000"
3445 }
3446----
3447
Edwin Kempin3ca57192013-02-27 07:44:01 +01003448[[get-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003449=== Get Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003450--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003451'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 -08003452--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003453
Edwin Kempin3ca57192013-02-27 07:44:01 +01003454Retrieves a draft comment of a revision that belongs to the calling
3455user.
3456
3457.Request
3458----
3459 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
3460----
3461
3462As response a link:#comment-info[CommentInfo] entity is returned that
3463describes the draft comment.
3464
3465.Response
3466----
3467 HTTP/1.1 200 OK
3468 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003469 Content-Type: application/json; charset=UTF-8
Edwin Kempin3ca57192013-02-27 07:44:01 +01003470
3471 )]}'
3472 {
Edwin Kempin3ca57192013-02-27 07:44:01 +01003473 "id": "TvcXrmjM",
3474 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3475 "line": 23,
3476 "message": "[nit] trailing whitespace",
3477 "updated": "2013-02-26 15:40:43.986000000"
3478 }
3479----
3480
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003481[[update-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003482=== Update Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003483--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003484'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 -08003485--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003486
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003487Updates a draft comment on a revision.
3488
3489The new draft comment must be provided in the request body inside a
3490link:#comment-input[CommentInput] entity.
3491
3492.Request
3493----
3494 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003495 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003496
3497 {
3498 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3499 "line": 23,
3500 "message": "[nit] trailing whitespace"
3501 }
3502----
3503
3504As response a link:#comment-info[CommentInfo] entity is returned that
3505describes the draft comment.
3506
3507.Response
3508----
3509 HTTP/1.1 200 OK
3510 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003511 Content-Type: application/json; charset=UTF-8
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003512
3513 )]}'
3514 {
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003515 "id": "TvcXrmjM",
3516 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3517 "line": 23,
3518 "message": "[nit] trailing whitespace",
3519 "updated": "2013-02-26 15:40:43.986000000"
3520 }
3521----
3522
3523[[delete-draft]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003524=== Delete Draft
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003525--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003526'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 -08003527--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01003528
Edwin Kempin7faf41e2013-02-27 08:17:02 +01003529Deletes a draft comment from a revision.
3530
3531.Request
3532----
3533 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/drafts/TvcXrmjM HTTP/1.0
3534----
3535
3536.Response
3537----
3538 HTTP/1.1 204 No Content
3539----
3540
John Spurlock5e402f02013-03-24 11:35:04 -04003541[[list-comments]]
Dave Borowitz23fec2b2015-04-28 17:40:07 -07003542=== List Revision Comments
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003543--
John Spurlock5e402f02013-03-24 11:35:04 -04003544'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/comments/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003545--
John Spurlock5e402f02013-03-24 11:35:04 -04003546
3547Lists the published comments of a revision.
3548
3549As result a map is returned that maps the file path to a list of
3550link:#comment-info[CommentInfo] entries. The entries in the map are
Khai Do23845a12014-06-02 11:28:16 -07003551sorted by file path and only include file (or inline) comments. Use
3552the link:#get-change-detail[Get Change Detail] endpoint to retrieve
3553the general change message (or comment).
John Spurlock5e402f02013-03-24 11:35:04 -04003554
3555.Request
3556----
3557 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/ HTTP/1.0
3558----
3559
3560.Response
3561----
3562 HTTP/1.1 200 OK
3563 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003564 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04003565
3566 )]}'
3567 {
3568 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": [
3569 {
John Spurlock5e402f02013-03-24 11:35:04 -04003570 "id": "TvcXrmjM",
3571 "line": 23,
3572 "message": "[nit] trailing whitespace",
3573 "updated": "2013-02-26 15:40:43.986000000",
3574 "author": {
3575 "_account_id": 1000096,
3576 "name": "John Doe",
3577 "email": "john.doe@example.com"
3578 }
3579 },
3580 {
John Spurlock5e402f02013-03-24 11:35:04 -04003581 "id": "TveXwFiA",
3582 "line": 49,
3583 "in_reply_to": "TfYX-Iuo",
3584 "message": "Done",
3585 "updated": "2013-02-26 15:40:45.328000000",
3586 "author": {
3587 "_account_id": 1000097,
3588 "name": "Jane Roe",
3589 "email": "jane.roe@example.com"
3590 }
3591 }
3592 ]
3593 }
3594----
3595
3596[[get-comment]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003597=== Get Comment
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003598--
John Spurlock5e402f02013-03-24 11:35:04 -04003599'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 -08003600--
John Spurlock5e402f02013-03-24 11:35:04 -04003601
3602Retrieves a published comment of a revision.
3603
3604.Request
3605----
3606 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/comments/TvcXrmjM HTTP/1.0
3607----
3608
3609As response a link:#comment-info[CommentInfo] entity is returned that
3610describes the published comment.
3611
3612.Response
3613----
3614 HTTP/1.1 200 OK
3615 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003616 Content-Type: application/json; charset=UTF-8
John Spurlock5e402f02013-03-24 11:35:04 -04003617
3618 )]}'
3619 {
John Spurlock5e402f02013-03-24 11:35:04 -04003620 "id": "TvcXrmjM",
3621 "path": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3622 "line": 23,
3623 "message": "[nit] trailing whitespace",
3624 "updated": "2013-02-26 15:40:43.986000000",
3625 "author": {
3626 "_account_id": 1000096,
3627 "name": "John Doe",
3628 "email": "john.doe@example.com"
3629 }
3630 }
3631----
3632
Edwin Kempin682ac712013-05-14 13:40:46 +02003633[[list-files]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003634=== List Files
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003635--
Edwin Kempin682ac712013-05-14 13:40:46 +02003636'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003637--
Edwin Kempin682ac712013-05-14 13:40:46 +02003638
3639Lists the files that were modified, added or deleted in a revision.
3640
3641.Request
3642----
3643 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/ HTTP/1.0
3644----
3645
3646As result a map is returned that maps the file path to a list of
3647link:#file-info[FileInfo] entries. The entries in the map are
3648sorted by file path.
3649
3650.Response
3651----
3652 HTTP/1.1 200 OK
3653 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003654 Content-Type: application/json; charset=UTF-8
Edwin Kempin682ac712013-05-14 13:40:46 +02003655
3656 )]}'
3657 {
3658 "/COMMIT_MSG": {
3659 "status": "A",
Edwin Kempin640f9842015-10-08 15:53:20 +02003660 "lines_inserted": 7,
Edwin Kempin971a5f52015-10-28 10:50:39 +01003661 "size_delta": 551,
3662 "size": 551
Edwin Kempin682ac712013-05-14 13:40:46 +02003663 },
3664 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java": {
3665 "lines_inserted": 5,
Edwin Kempin640f9842015-10-08 15:53:20 +02003666 "lines_deleted": 3,
Edwin Kempin971a5f52015-10-28 10:50:39 +01003667 "size_delta": 98,
3668 "size": 23348
Edwin Kempin682ac712013-05-14 13:40:46 +02003669 }
3670 }
3671----
3672
Shawn Pearce984747d2013-07-18 00:42:16 -07003673The request parameter `reviewed` changes the response to return a list
3674of the paths the caller has marked as reviewed. Clients that also
3675need the FileInfo should make two requests.
3676
Shawn Pearce8ca03a62015-01-02 22:03:20 -08003677The request parameter `q` changes the response to return a list
3678of all files (modified or unmodified) that contain that substring
3679in the path name. This is useful to implement suggestion services
3680finding a file by partial name.
3681
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01003682The integer-valued request parameter `parent` changes the response to return a
3683list of the files which are different in this commit compared to the given
3684parent commit. This is useful for supporting review of merge commits. The value
3685is the 1-based index of the parent's position in the commit object.
3686
Shawn Pearce984747d2013-07-18 00:42:16 -07003687.Request
3688----
3689 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/?reviewed HTTP/1.0
3690----
3691
3692.Response
3693----
3694 HTTP/1.1 200 OK
3695 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003696 Content-Type: application/json; charset=UTF-8
Shawn Pearce984747d2013-07-18 00:42:16 -07003697
3698 )]}'
3699 [
3700 "/COMMIT_MSG",
3701 "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3702 ]
3703----
3704
Edwin Kempinaef44b02013-05-07 16:15:55 +02003705[[get-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003706=== Get Content
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003707--
Edwin Kempinbea55a52013-05-14 13:53:39 +02003708'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 -08003709--
Edwin Kempinaef44b02013-05-07 16:15:55 +02003710
3711Gets the content of a file from a certain revision.
3712
3713.Request
3714----
3715 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/content HTTP/1.0
3716----
3717
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05003718The content is returned as base64 encoded string. The HTTP response
3719Content-Type is always `text/plain`, reflecting the base64 wrapping.
3720A Gerrit-specific `X-FYI-Content-Type` header is returned describing
3721the server detected content type of the file.
3722
3723If only the content type is required, callers should use HEAD to
3724avoid downloading the encoded file contents.
Edwin Kempinaef44b02013-05-07 16:15:55 +02003725
3726.Response
3727----
3728 HTTP/1.1 200 OK
3729 Content-Disposition: attachment
Shawn Pearcefb2b36b2015-01-01 23:42:12 -05003730 Content-Type: text/plain; charset=ISO-8859-1
3731 X-FYI-Content-Encoding: base64
3732 X-FYI-Content-Type: text/xml
Edwin Kempinaef44b02013-05-07 16:15:55 +02003733
3734 Ly8gQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY...
3735----
3736
David Ostrovskyd0078672015-02-06 21:51:04 +01003737Alternatively, if the only value of the Accept request header is
3738`application/json` the content is returned as JSON string and
3739`X-FYI-Content-Encoding` is set to `json`.
3740
David Pletcherd1efb452015-09-01 17:45:55 -07003741[[get-safe-content]]
3742=== Download Content
3743--
3744'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/download'
3745--
3746
3747Downloads the content of a file from a certain revision, in a safe format
3748that poses no risk for inadvertent execution of untrusted code.
3749
3750If the content type is defined as safe, the binary file content is returned
3751verbatim. If the content type is not safe, the file is stored inside a ZIP
3752file, containing a single entry with a random, unpredictable name having the
3753same base and suffix as the true filename. The ZIP file is returned in
3754verbatim binary form.
3755
3756See link:config-gerrit.html#mimetype.name.safe[Gerrit config documentation]
3757for information about safe file type configuration.
3758
3759The HTTP resource Content-Type is dependent on the file type: the
3760applicable type for safe files, or "application/zip" for unsafe files.
3761
David Pletcherec622bf2015-09-18 14:30:05 -07003762The optional, integer-valued `parent` parameter can be specified to request
3763the named file from a parent commit of the specified revision. The value is
3764the 1-based index of the parent's position in the commit object. If the
3765parameter is omitted or the value non-positive, the patch set is referenced.
3766
3767Filenames are decorated with a suffix of `_new` for the current patch,
3768`_old` for the only parent, or `_oldN` for the Nth parent of many.
David Pletcherd1efb452015-09-01 17:45:55 -07003769
3770.Request
3771----
3772 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/website%2Freleases%2Flogo.png/safe_content HTTP/1.0
3773----
3774
3775.Response
3776----
3777 HTTP/1.1 200 OK
3778 Content-Disposition: attachment; filename="logo.png"
3779 Content-Type: image/png
3780
3781 `[binary data for logo.png]`
3782----
3783
3784.Request
3785----
3786 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/safe_content?suffix=new HTTP/1.0
3787----
3788
3789.Response
3790----
3791 HTTP/1.1 200 OK
3792 Content-Disposition: Content-Disposition:attachment; filename="RefControl_new-931cdb73ae9d97eb500a3533455b055d90b99944.java.zip"
3793 Content-Type:application/zip
3794
3795 `[binary ZIP archive containing a single file, "RefControl_new-cb218df1337df48a0e7ab30a49a8067ac7321881.java"]`
3796----
3797
David Pursehouse882aef22013-06-05 10:56:37 +09003798[[get-diff]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08003799=== Get Diff
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08003800--
David Pursehouse882aef22013-06-05 10:56:37 +09003801'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 -08003802--
David Pursehouse882aef22013-06-05 10:56:37 +09003803
3804Gets the diff of a file from a certain revision.
3805
3806.Request
3807----
3808 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/diff HTTP/1.0
3809----
3810
3811As response a link:#diff-info[DiffInfo] entity is returned that describes the diff.
3812
3813.Response
3814----
3815 HTTP/1.1 200 OK
3816 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003817 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09003818
3819 )]
3820 {
3821 "meta_a": {
3822 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08003823 "content_type": "text/x-java-source",
3824 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09003825 },
3826 "meta_b": {
3827 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08003828 "content_type": "text/x-java-source",
3829 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09003830 },
3831 "change_type": "MODIFIED",
3832 "diff_header": [
3833 "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",
3834 "index 59b7670..9faf81c 100644",
3835 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3836 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
3837 ],
3838 "content": [
3839 {
3840 "ab": [
3841 "// Copyright (C) 2010 The Android Open Source Project",
3842 "//",
3843 "// Licensed under the Apache License, Version 2.0 (the \"License\");",
3844 "// you may not use this file except in compliance with the License.",
3845 "// You may obtain a copy of the License at",
3846 "//",
3847 "// http://www.apache.org/licenses/LICENSE-2.0",
3848 "//",
3849 "// Unless required by applicable law or agreed to in writing, software",
3850 "// distributed under the License is distributed on an \"AS IS\" BASIS,",
3851 "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
3852 "// See the License for the specific language governing permissions and",
3853 "// limitations under the License."
3854 ]
3855 },
3856 {
3857 "b": [
3858 "//",
3859 "// Add some more lines in the header."
3860 ]
3861 },
3862 {
3863 "ab": [
3864 "",
3865 "package com.google.gerrit.server.project;",
3866 "",
3867 "import com.google.common.collect.Maps;",
3868 ...
3869 ]
3870 }
3871 ...
3872 ]
3873 }
3874----
3875
3876If the `intraline` parameter is specified, intraline differences are included in the diff.
3877
3878.Request
3879----
3880 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
3881----
3882
3883.Response
3884----
3885 HTTP/1.1 200 OK
3886 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003887 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09003888
3889 )]
3890 {
3891 "meta_a": {
3892 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08003893 "content_type": "text/x-java-source",
3894 "lines": 372
David Pursehouse882aef22013-06-05 10:56:37 +09003895 },
3896 "meta_b": {
3897 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08003898 "content_type": "text/x-java-source",
3899 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09003900 },
3901 "change_type": "MODIFIED",
3902 "diff_header": [
3903 "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",
3904 "index 59b7670..9faf81c 100644",
3905 "--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
3906 "+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java"
3907 ],
3908 "content": [
3909 ...
3910 {
3911 "a": [
3912 "/** Manages access control for Git references (aka branches, tags). */"
3913 ],
3914 "b": [
3915 "/** Manages access control for the Git references (aka branches, tags). */"
3916 ],
3917 "edit_a": [],
3918 "edit_b": [
3919 [
3920 31,
3921 4
3922 ]
3923 ]
3924 }
3925 ]
3926 }
3927----
3928
3929The `base` parameter can be specified to control the base patch set from which the diff should
3930be generated.
3931
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01003932The integer-valued request parameter `parent` can be specified to control the
3933parent commit number against which the diff should be generated. This is useful
3934for supporting review of merge commits. The value is the 1-based index of the
3935parent's position in the commit object.
3936
Edwin Kempin8cdce502014-12-06 10:55:38 +01003937[[weblinks-only]]
3938If the `weblinks-only` parameter is specified, only the diff web links are returned.
3939
David Pursehouse882aef22013-06-05 10:56:37 +09003940.Request
3941----
3942 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
3943----
3944
3945.Response
3946----
3947 HTTP/1.1 200 OK
3948 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09003949 Content-Type: application/json; charset=UTF-8
David Pursehouse882aef22013-06-05 10:56:37 +09003950
3951 )]
3952 {
3953 "meta_a": {
3954 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08003955 "content_type": "text/x-java-source",
3956 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09003957 },
3958 "meta_b": {
3959 "name": "gerrit-server/src/main/java/com/google/gerrit/server/project/RefControl.java",
Shawn Pearced62a6a92013-12-05 12:45:32 -08003960 "content_type": "text/x-java-source",
3961 "lines": 578
David Pursehouse882aef22013-06-05 10:56:37 +09003962 },
3963 "change_type": "MODIFIED",
3964 "content": [
3965 {
3966 "skip": 578
3967 }
3968 ]
3969 }
3970----
3971
Edwin Kempin0b7c40f2016-02-09 17:13:23 +01003972The `whitespace` parameter can be specified to control how whitespace
3973differences are reported in the result. Valid values are `IGNORE_NONE`,
3974`IGNORE_TRAILING`, `IGNORE_LEADING_AND_TRAILING` or `IGNORE_ALL`.
David Pursehouse882aef22013-06-05 10:56:37 +09003975
3976The `context` parameter can be specified to control the number of lines of surrounding context
3977in the diff. Valid values are `ALL` or number of lines.
3978
Gabor Somossyb72d4c62015-10-20 23:40:07 +01003979[[get-blame]]
3980=== Get Blame
3981--
3982'GET /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/files/link:#file-id[\{file-id\}]/blame'
3983--
3984
3985Gets the blame of a file from a certain revision.
3986
3987.Request
3988----
3989 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/blame HTTP/1.0
3990----
3991
3992As response a link:#blame-info[BlameInfo] entity is returned that describes the
3993blame.
3994
3995.Response
3996----
3997 HTTP/1.1 200 OK
3998 Content-Disposition: attachment
3999 Content-Type: application/json; charset=UTF-8
4000
4001 )]
4002 {
4003 [
4004 {
4005 "author": "Joe Daw",
4006 "id": "64e140b4de5883a4dd74d06c2b62ccd7ffd224a7",
4007 "time": 1421441349,
4008 "commit_msg": "RST test\n\nChange-Id: I11e9e24bd122253f4bb10c36dce825ac2410d646\n",
4009 "ranges": [
4010 {
4011 "start": 1,
4012 "end": 10
4013 },
4014 {
4015 "start": 16,
4016 "end": 296
4017 }
4018 ]
4019 },
4020 {
4021 "author": "Jane Daw",
4022 "id": "8d52621a0e2ac6adec73bd3a49f2371cd53137a7",
4023 "time": 1421825421,
4024 "commit_msg": "add banner\n\nChange-Id: I2eced9b2691015ae3c5138f4d0c4ca2b8fb15be9\n",
4025 "ranges": [
4026 {
4027 "start": 13,
4028 "end": 13
4029 }
4030 ]
4031 }
4032 ]
4033 }
4034----
4035
4036The `base` parameter can be specified to control the base patch set from which
4037the blame should be generated.
4038
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004039[[set-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004040=== Set Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004041--
Edwin Kempinbea55a52013-05-14 13:53:39 +02004042'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 -08004043--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004044
Edwin Kempinbea55a52013-05-14 13:53:39 +02004045Marks a file of a revision as reviewed by the calling user.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004046
4047.Request
4048----
4049 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
4050----
4051
4052.Response
4053----
4054 HTTP/1.1 201 Created
4055----
4056
Edwin Kempinbea55a52013-05-14 13:53:39 +02004057If the file was already marked as reviewed by the calling user the
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004058response is "`200 OK`".
4059
4060[[delete-reviewed]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004061=== Delete Reviewed
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004062--
Edwin Kempinbea55a52013-05-14 13:53:39 +02004063'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 -08004064--
Edwin Kempin50d3d9b2013-03-06 16:38:26 +01004065
Edwin Kempinbea55a52013-05-14 13:53:39 +02004066Deletes the reviewed flag of the calling user from a file of a revision.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004067
4068.Request
4069----
4070 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/files/gerrit-server%2Fsrc%2Fmain%2Fjava%2Fcom%2Fgoogle%2Fgerrit%2Fserver%2Fproject%2FRefControl.java/reviewed HTTP/1.0
4071----
4072
4073.Response
4074----
4075 HTTP/1.1 204 No Content
4076----
4077
Gustaf Lundh019fb262012-11-28 14:20:22 +01004078[[cherry-pick]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004079=== Cherry Pick Revision
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004080--
Gustaf Lundh019fb262012-11-28 14:20:22 +01004081'POST /changes/link:#change-id[\{change-id\}]/revisions/link:#revision-id[\{revision-id\}]/cherrypick'
Yuxuan 'fishy' Wangd85b6872013-11-15 11:47:46 -08004082--
Gustaf Lundh019fb262012-11-28 14:20:22 +01004083
4084Cherry picks a revision to a destination branch.
4085
4086The commit message and destination branch must be provided in the request body inside a
4087link:#cherrypick-input[CherryPickInput] entity.
4088
4089.Request
4090----
4091 POST /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/revisions/674ac754f91e64a0efb8087e59a176484bd534d1/cherrypick HTTP/1.0
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004092 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01004093
4094 {
Gustaf Lundh98df5b52013-05-07 19:22:13 +01004095 "message" : "Implementing Feature X",
4096 "destination" : "release-branch"
Gustaf Lundh019fb262012-11-28 14:20:22 +01004097 }
4098----
4099
4100As response a link:#change-info[ChangeInfo] entity is returned that
4101describes the resulting cherry picked change.
4102
4103.Response
4104----
4105 HTTP/1.1 200 OK
4106 Content-Disposition: attachment
David Pursehouse56bf1cb2015-01-06 15:44:00 +09004107 Content-Type: application/json; charset=UTF-8
Gustaf Lundh019fb262012-11-28 14:20:22 +01004108
4109 )]}'
4110 {
Gustaf Lundh019fb262012-11-28 14:20:22 +01004111 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9941",
4112 "project": "myProject",
4113 "branch": "release-branch",
4114 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9941",
4115 "subject": "Implementing Feature X",
4116 "status": "NEW",
4117 "created": "2013-02-01 09:59:32.126000000",
4118 "updated": "2013-02-21 11:16:36.775000000",
Gustaf Lundh019fb262012-11-28 14:20:22 +01004119 "mergeable": true,
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004120 "insertions": 12,
4121 "deletions": 11,
Gustaf Lundh019fb262012-11-28 14:20:22 +01004122 "_number": 3965,
4123 "owner": {
4124 "name": "John Doe"
4125 }
4126 }
4127----
Edwin Kempinff9e6e32013-02-21 13:07:11 +01004128
4129[[ids]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004130== IDs
Edwin Kempinff9e6e32013-02-21 13:07:11 +01004131
Edwin Kempina3d02ef2013-02-22 16:31:53 +01004132[[account-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004133=== link:rest-api-accounts.html#account-id[\{account-id\}]
Edwin Kempina3d02ef2013-02-22 16:31:53 +01004134--
4135--
4136
Edwin Kempinff9e6e32013-02-21 13:07:11 +01004137[[change-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004138=== \{change-id\}
Edwin Kempinff9e6e32013-02-21 13:07:11 +01004139Identifier that uniquely identifies one change.
4140
4141This can be:
4142
4143* an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'",
4144 where for the branch the `refs/heads/` prefix can be omitted
4145 ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$")
4146* a Change-Id if it uniquely identifies one change
4147 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
4148* a legacy numeric change ID ("4247")
4149
John Spurlock5e402f02013-03-24 11:35:04 -04004150[[comment-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004151=== \{comment-id\}
John Spurlock5e402f02013-03-24 11:35:04 -04004152UUID of a published comment.
4153
Edwin Kempin3ca57192013-02-27 07:44:01 +01004154[[draft-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004155=== \{draft-id\}
Edwin Kempin3ca57192013-02-27 07:44:01 +01004156UUID of a draft comment.
Edwin Kempinff9e6e32013-02-21 13:07:11 +01004157
David Ostrovskybeb0b842014-12-13 00:24:29 +01004158[[label-id]]
4159=== \{label-id\}
4160The name of the label.
4161
Edwin Kempinbea55a52013-05-14 13:53:39 +02004162[[file-id]]
4163\{file-id\}
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004164~~~~~~~~~~~~
Edwin Kempinbea55a52013-05-14 13:53:39 +02004165The path of the file.
Edwin Kempin9300e4c2013-02-27 08:42:06 +01004166
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004167[[revision-id]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004168=== \{revision-id\}
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004169Identifier that uniquely identifies one revision of a change.
4170
4171This can be:
4172
Shawn Pearce9c0722a2013-03-02 15:30:31 -08004173* the literal `current` to name the current patch set/revision
Edwin Kempinda6e5fa2013-02-25 14:48:12 +01004174* a commit ID ("674ac754f91e64a0efb8087e59a176484bd534d1")
4175* an abbreviated commit ID that uniquely identifies one revision of the
4176 change ("674ac754"), at least 4 digits are required
4177* a legacy numeric patch number ("1" for first patch set of the change)
4178
Edwin Kempine3446292013-02-19 16:40:14 +01004179[[json-entities]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004180== JSON Entities
Edwin Kempine3446292013-02-19 16:40:14 +01004181
Edwin Kempined5364b2013-02-22 10:39:33 +01004182[[abandon-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004183=== AbandonInput
Edwin Kempined5364b2013-02-22 10:39:33 +01004184The `AbandonInput` entity contains information for abandoning a change.
4185
David Pursehouseae367192014-11-25 17:24:47 +09004186[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01004187|===========================
4188|Field Name ||Description
4189|`message` |optional|
4190Message to be added as review comment to the change when abandoning the
4191change.
Stephen Lie5fcdf72016-08-02 11:05:11 -07004192|`notify` |optional|
4193Notify handling that defines to whom email notifications should be sent after
4194the change is abandoned. +
4195Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
4196If not set, the default is `ALL`.
Edwin Kempined5364b2013-02-22 10:39:33 +01004197|===========================
4198
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07004199[[action-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004200=== ActionInfo
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07004201The `ActionInfo` entity describes a REST API call the client can
4202make to manipulate a resource. These are frequently implemented by
4203plugins and may be discovered at runtime.
4204
David Pursehouseae367192014-11-25 17:24:47 +09004205[options="header",cols="1,^1,5"]
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07004206|====================================
4207|Field Name ||Description
4208|`method` |optional|
4209HTTP method to use with the action. Most actions use `POST`, `PUT`
4210or `DELETE` to cause state changes.
4211|`label` |optional|
4212Short title to display to a user describing the action. In the
4213Gerrit web interface the label is used as the text on the button
4214presented in the UI.
4215|`title` |optional|
4216Longer text to display describing the action. In a web UI this
4217should be the title attribute of the element, displaying when
4218the user hovers the mouse.
4219|`enabled` |optional|
4220If true the action is permitted at this time and the caller is
4221likely allowed to execute it. This may change if state is updated
4222at the server or permissions are modified. Not present if false.
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07004223|====================================
4224
Edwin Kempin392328e2013-02-25 12:50:03 +01004225[[add-reviewer-result]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004226=== AddReviewerResult
Edwin Kempin392328e2013-02-25 12:50:03 +01004227The `AddReviewerResult` entity describes the result of adding a
4228reviewer to a change.
4229
David Pursehouseae367192014-11-25 17:24:47 +09004230[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01004231|===========================
4232|Field Name ||Description
Logan Hanks23e70282016-07-06 14:31:56 -07004233|`input` ||
4234Value of the `reviewer` field from link:#reviewer-input[ReviewerInput]
4235set while adding the reviewer.
Edwin Kempin392328e2013-02-25 12:50:03 +01004236|`reviewers` |optional|
4237The newly added reviewers as a list of link:#reviewer-info[
4238ReviewerInfo] entities.
Logan Hanksee0a4182016-07-06 14:39:26 -07004239|`ccs` |optional|
4240The newly CCed accounts as a list of link:#reviewer-info[
4241ReviewerInfo] entities. This field will only appear if the requested
4242`state` for the reviewer was `CC` *and* NoteDb is enabled on the
4243server.
Edwin Kempin392328e2013-02-25 12:50:03 +01004244|`error` |optional|
4245Error message explaining why the reviewer could not be added. +
4246If a group was specified in the input and an error is returned, it
4247means that none of the members were added as reviewer.
4248|`confirm` |`false` if not set|
4249Whether adding the reviewer requires confirmation.
4250|===========================
4251
Edwin Kempine3446292013-02-19 16:40:14 +01004252[[approval-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004253=== ApprovalInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004254The `ApprovalInfo` entity contains information about an approval from a
4255user for a label on a change.
4256
Edwin Kempin963dfd02013-02-27 12:39:32 +01004257`ApprovalInfo` has the same fields as
4258link:rest-api-accounts.html#account-info[AccountInfo].
Edwin Kempine3446292013-02-19 16:40:14 +01004259In addition `ApprovalInfo` has the following fields:
4260
David Pursehouseae367192014-11-25 17:24:47 +09004261[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004262|===========================
4263|Field Name ||Description
Dave Borowitza30db912013-03-22 14:20:33 -07004264|`value` |optional|
4265The vote that the user has given for the label. If present and zero, the
4266user is permitted to vote on the label. If absent, the user is not
4267permitted to vote on that label.
Gustaf Lundh2e07d5022013-05-08 17:07:42 +01004268|`date` |optional|
4269The time and date describing when the approval was made.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01004270|`tag` |optional|
4271Value of the `tag` field from link:#review-input[ReviewInput] set
4272while posting the review.
4273NOTE: To apply different tags on on different votes/comments multiple
4274invocations of the REST call are required.
Edwin Kempine3446292013-02-19 16:40:14 +01004275|===========================
4276
Gabor Somossyb72d4c62015-10-20 23:40:07 +01004277[[blame-info]]
4278=== BlameInfo
4279The `BlameInfo` entity stores the commit metadata with the row coordinates where
4280it applies.
4281
4282[options="header",cols="1,6"]
4283|===========================
4284|Field Name | Description
4285|`author` | The author of the commit.
4286|`id` | The id of the commit.
4287|`time` | Commit time.
4288|`commit_msg` | The commit message.
4289|`ranges` |
4290The blame row coordinates as link:#range-info[RangeInfo] entities.
4291|===========================
4292
Edwin Kempin521c1242015-01-23 12:44:44 +01004293[[change-edit-input]]
4294=== ChangeEditInput
4295The `ChangeEditInput` entity contains information for restoring a
4296path within change edit.
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02004297
Edwin Kempin521c1242015-01-23 12:44:44 +01004298[options="header",cols="1,^1,5"]
4299|===========================
4300|Field Name ||Description
4301|`restore_path`|optional|Path to file to restore.
4302|`old_path` |optional|Old path to file to rename.
4303|`new_path` |optional|New path to file to rename.
4304|===========================
4305
4306[[change-edit-message-input]]
4307=== ChangeEditMessageInput
4308The `ChangeEditMessageInput` entity contains information for changing
4309the commit message within a change edit.
4310
4311[options="header",cols="1,^1,5"]
4312|===========================
4313|Field Name ||Description
4314|`message` ||New commit message.
4315|===========================
David Ostrovsky8c5f80a2013-09-02 20:22:39 +02004316
Edwin Kempine3446292013-02-19 16:40:14 +01004317[[change-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004318=== ChangeInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004319The `ChangeInfo` entity contains information about a change.
4320
David Pursehouseae367192014-11-25 17:24:47 +09004321[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004322|==================================
4323|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01004324|`id` ||
4325The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
John Spurlockd25fad12013-03-09 11:48:49 -05004326where 'project', 'branch' and 'Change-Id' are URL encoded. For 'branch' the
Edwin Kempine3446292013-02-19 16:40:14 +01004327`refs/heads/` prefix is omitted.
4328|`project` ||The name of the project.
4329|`branch` ||
4330The name of the target branch. +
4331The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +01004332|`topic` |optional|The topic to which this change belongs.
Edwin Kempine3446292013-02-19 16:40:14 +01004333|`change_id` ||The Change-Id of the change.
4334|`subject` ||
4335The subject of the change (header line of the commit message).
4336|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07004337The status of the change (`NEW`, `MERGED`, `ABANDONED`, `DRAFT`).
Edwin Kempine3446292013-02-19 16:40:14 +01004338|`created` ||
4339The link:rest-api.html#timestamp[timestamp] of when the change was
4340created.
4341|`updated` ||
4342The link:rest-api.html#timestamp[timestamp] of when the change was last
4343updated.
Khai Do96a7caf2016-01-07 14:07:54 -08004344|`submitted` |only set for merged changes|
4345The link:rest-api.html#timestamp[timestamp] of when the change was
4346submitted.
Edwin Kempine3446292013-02-19 16:40:14 +01004347|`starred` |not set if `false`|
Edwin Kempin9e972cc2016-04-15 10:39:13 +02004348Whether the calling user has starred this change with the default label.
4349|`stars` |optional|
4350A list of star labels that are applied by the calling user to this
4351change. The labels are lexicographically sorted.
Edwin Kempine3446292013-02-19 16:40:14 +01004352|`reviewed` |not set if `false`|
4353Whether the change was reviewed by the calling user.
Shawn Pearce414c5ff2013-09-06 21:51:02 -07004354Only set if link:#reviewed[reviewed] is requested.
Dave Borowitzace32102015-12-17 13:08:25 -05004355|`submit_type` |optional|
4356The link:project-configuration.html#submit_type[submit type] of the change. +
4357Not set for merged changes.
Edwin Kempinbaf70e12013-02-27 10:36:13 +01004358|`mergeable` |optional|
4359Whether the change is mergeable. +
Dave Borowitze5fbeeb2014-06-27 09:47:49 -07004360Not set for merged changes, or if the change has not yet been tested.
Edwin Kempina6b6eaf2013-11-23 11:05:58 +01004361|`insertions` ||
4362Number of inserted lines.
4363|`deletions` ||
4364Number of deleted lines.
Edwin Kempine3446292013-02-19 16:40:14 +01004365|`_number` ||The legacy numeric ID of the change.
4366|`owner` ||
Edwin Kempin963dfd02013-02-27 12:39:32 +01004367The owner of the change as an link:rest-api-accounts.html#account-info[
4368AccountInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07004369|`actions` |optional|
4370Actions the caller might be able to perform on this revision. The
4371information is a map of view name to link:#action-info[ActionInfo]
4372entities.
Edwin Kempine3446292013-02-19 16:40:14 +01004373|`labels` |optional|
4374The labels of the change as a map that maps the label names to
4375link:#label-info[LabelInfo] entries. +
4376Only set if link:#labels[labels] or link:#detailed-labels[detailed
4377labels] are requested.
4378|`permitted_labels` |optional|
4379A map of the permitted labels that maps a label name to the list of
4380values that are allowed for that label. +
4381Only set if link:#detailed-labels[detailed labels] are requested.
4382|`removable_reviewers`|optional|
4383The reviewers that can be removed by the calling user as a list of
Edwin Kempin963dfd02013-02-27 12:39:32 +01004384link:rest-api-accounts.html#account-info[AccountInfo] entities. +
Edwin Kempine3446292013-02-19 16:40:14 +01004385Only set if link:#detailed-labels[detailed labels] are requested.
Edwin Kempin66af3d82015-11-10 17:38:40 -08004386|`reviewers` ||
4387The reviewers as a map that maps a reviewer state to a list of
4388link:rest-api-accounts.html#account-info[AccountInfo] entities.
4389Possible reviewer states are `REVIEWER`, `CC` and `REMOVED`. +
4390`REVIEWER`: Users with at least one non-zero vote on the change. +
4391`CC`: Users that were added to the change, but have not voted. +
4392`REMOVED`: Users that were previously reviewers on the change, but have
4393been removed. +
4394Only set if link:#detailed-labels[detailed labels] are requested.
Viktar Donich316bf7a2016-07-06 11:29:01 -07004395|`reviewer_updates`|optional|
4396Updates to reviewers set for the change as
4397link:#review-update-info[ReviewerUpdateInfo] entities.
4398Only set if link:#reviewer-updates[reviewer updates] are requested and
4399if NoteDb is enabled.
John Spurlock74a70cc2013-03-23 16:41:50 -04004400|`messages`|optional|
Shawn Pearce414c5ff2013-09-06 21:51:02 -07004401Messages associated with the change as a list of
John Spurlock74a70cc2013-03-23 16:41:50 -04004402link:#change-message-info[ChangeMessageInfo] entities. +
4403Only set if link:#messages[messages] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01004404|`current_revision` |optional|
4405The commit ID of the current patch set of this change. +
4406Only set if link:#current-revision[the current revision] is requested
4407or if link:#all-revisions[all revisions] are requested.
4408|`revisions` |optional|
John Spurlockd25fad12013-03-09 11:48:49 -05004409All patch sets of this change as a map that maps the commit ID of the
Edwin Kempine3446292013-02-19 16:40:14 +01004410patch set to a link:#revision-info[RevisionInfo] entity. +
Dave Borowitz0adf2702014-01-22 10:41:52 -08004411Only set if link:#current-revision[the current revision] is requested
4412(in which case it will only contain a key for the current revision) or
4413if link:#all-revisions[all revisions] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01004414|`_more_changes` |optional, not set if `false`|
4415Whether the query would deliver more results if not limited. +
Dave Borowitz42414592014-12-19 11:27:14 -08004416Only set on the last change that is returned.
Dave Borowitz5c894d42014-11-25 17:43:06 -05004417|`problems` |optional|
4418A list of link:#problem-info[ProblemInfo] entities describing potential
Dave Borowitz4c46c242014-12-03 16:46:45 -08004419problems with this change. Only set if link:#check[CHECK] is set.
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08004420|==================================
4421
4422[[change-input]]
4423=== ChangeInput
4424The `ChangeInput` entity contains information about creating a new change.
4425
4426[options="header",cols="1,^1,5"]
4427|==================================
4428|Field Name ||Description
4429|`project` ||The name of the project.
4430|`branch` ||
4431The name of the target branch. +
4432The `refs/heads/` prefix is omitted.
4433|`subject` ||
4434The subject of the change (header line of the commit message).
4435|`topic` |optional|The topic to which this change belongs.
4436|`status` |optional, default to `NEW`|
4437The status of the change (only `NEW` and `DRAFT` accepted here).
David Ostrovsky9d8ec422014-12-24 00:52:09 +01004438|`base_change` |optional|
4439A link:#change-id[\{change-id\}] that identifies the base change for a create
Yuxuan 'fishy' Wangaf6807f2016-02-10 15:11:57 -08004440change operation.
4441|`new_branch` |optional, default to `false`|
4442Allow creating a new branch when set to `true`.
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004443|`merge` |optional|
4444The detail of a merge commit as a link:#merge-input[MergeInput] entity.
Edwin Kempine3446292013-02-19 16:40:14 +01004445|==================================
4446
John Spurlock74a70cc2013-03-23 16:41:50 -04004447[[change-message-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004448=== ChangeMessageInfo
John Spurlock74a70cc2013-03-23 16:41:50 -04004449The `ChangeMessageInfo` entity contains information about a message
4450attached to a change.
4451
David Pursehouseae367192014-11-25 17:24:47 +09004452[options="header",cols="1,^1,5"]
John Spurlock74a70cc2013-03-23 16:41:50 -04004453|==================================
4454|Field Name ||Description
4455|`id` ||The ID of the message.
4456|`author` |optional|
Khai Do23845a12014-06-02 11:28:16 -07004457Author of the message as an
John Spurlock74a70cc2013-03-23 16:41:50 -04004458link:rest-api-accounts.html#account-info[AccountInfo] entity. +
4459Unset if written by the Gerrit system.
4460|`date` ||
4461The link:rest-api.html#timestamp[timestamp] this message was posted.
4462|`message` ||The text left by the user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01004463|`tag` |optional|
4464Value of the `tag` field from link:#review-input[ReviewInput] set
4465while posting the review.
4466NOTE: To apply different tags on on different votes/comments multiple
4467invocations of the REST call are required.
John Spurlock74a70cc2013-03-23 16:41:50 -04004468|`_revision_number` |optional|
4469Which patchset (if any) generated this message.
4470|==================================
4471
Gustaf Lundh019fb262012-11-28 14:20:22 +01004472[[cherrypick-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004473=== CherryPickInput
Gustaf Lundh019fb262012-11-28 14:20:22 +01004474The `CherryPickInput` entity contains information for cherry-picking a change to a new branch.
4475
David Pursehouseae367192014-11-25 17:24:47 +09004476[options="header",cols="1,6"]
Gustaf Lundh019fb262012-11-28 14:20:22 +01004477|===========================
4478|Field Name |Description
4479|`message` |Commit message for the cherry-picked change
David Ostrovsky9345ebc2014-04-28 23:19:55 +02004480|`destination` |Destination branch
Gustaf Lundh019fb262012-11-28 14:20:22 +01004481|===========================
4482
Edwin Kempincb6724a2013-02-26 16:58:51 +01004483[[comment-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004484=== CommentInfo
John Spurlockd25fad12013-03-09 11:48:49 -05004485The `CommentInfo` entity contains information about an inline comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004486
David Pursehouseae367192014-11-25 17:24:47 +09004487[options="header",cols="1,^1,5"]
Edwin Kempincb6724a2013-02-26 16:58:51 +01004488|===========================
4489|Field Name ||Description
Dave Borowitz23fec2b2015-04-28 17:40:07 -07004490|`patch_set` |optional|
4491The patch set number for the comment; only set in contexts where +
4492comments may be returned for multiple patch sets.
John Spurlock5e402f02013-03-24 11:35:04 -04004493|`id` ||The URL encoded UUID of the comment.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004494|`path` |optional|
4495The path of the file for which the inline comment was done. +
4496Not set if returned in a map where the key is the file path.
4497|`side` |optional|
4498The side on which the comment was added. +
4499Allowed values are `REVISION` and `PARENT`. +
4500If not set, the default is `REVISION`.
Dawid Grzegorczyk59045242015-11-07 11:26:02 +01004501|`parent` |optional|
4502The 1-based parent number. Used only for merge commits when `side == PARENT`.
4503When not set the comment is for the auto-merge tree.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004504|`line` |optional|
4505The number of the line for which the comment was done. +
Michael Zhou596c7682013-08-25 05:43:34 -04004506If range is set, this equals the end line of the range. +
4507If neither line nor range is set, it's a file comment.
4508|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09004509The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04004510entity.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004511|`in_reply_to` |optional|
4512The URL encoded UUID of the comment to which this comment is a reply.
4513|`message` |optional|The comment message.
4514|`updated` ||
4515The link:rest-api.html#timestamp[timestamp] of when this comment was
4516written.
John Spurlock5e402f02013-03-24 11:35:04 -04004517|`author` |optional|
David Pursehousec633a572013-08-26 14:01:59 +09004518The author of the message as an
John Spurlock5e402f02013-03-24 11:35:04 -04004519link:rest-api-accounts.html#account-info[AccountInfo] entity. +
4520Unset for draft comments, assumed to be the calling user.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01004521|`tag` |optional|
4522Value of the `tag` field from link:#review-input[ReviewInput] set
4523while posting the review.
4524NOTE: To apply different tags on on different votes/comments multiple
4525invocations of the REST call are required.
Edwin Kempincb6724a2013-02-26 16:58:51 +01004526|===========================
4527
Edwin Kempin67498de2013-02-25 16:15:34 +01004528[[comment-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004529=== CommentInput
Orgad Shanehc99da3a2014-06-13 14:57:54 +03004530The `CommentInput` entity contains information for creating an inline
Edwin Kempin67498de2013-02-25 16:15:34 +01004531comment.
4532
David Pursehouseae367192014-11-25 17:24:47 +09004533[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01004534|===========================
4535|Field Name ||Description
4536|`id` |optional|
Edwin Kempinc09826d72013-02-26 16:10:39 +01004537The URL encoded UUID of the comment if an existing draft comment should
4538be updated.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004539|`path` |optional|
4540The path of the file for which the inline comment should be added. +
4541Doesn't need to be set if contained in a map where the key is the file
4542path.
Edwin Kempin67498de2013-02-25 16:15:34 +01004543|`side` |optional|
4544The side on which the comment should be added. +
4545Allowed values are `REVISION` and `PARENT`. +
4546If not set, the default is `REVISION`.
4547|`line` |optional|
4548The number of the line for which the comment should be added. +
4549`0` if it is a file comment. +
Michael Zhou596c7682013-08-25 05:43:34 -04004550If neither line nor range is set, a file comment is added. +
David Pursehouse4a159a12014-08-26 15:45:14 +09004551If range is set, this value is ignored in favor of the `end_line` of the range.
Michael Zhou596c7682013-08-25 05:43:34 -04004552|`range` |optional|
David Pursehouse8d869ea2014-08-26 14:09:53 +09004553The range of the comment as a link:#comment-range[CommentRange]
Michael Zhou596c7682013-08-25 05:43:34 -04004554entity.
Edwin Kempin67498de2013-02-25 16:15:34 +01004555|`in_reply_to` |optional|
4556The URL encoded UUID of the comment to which this comment is a reply.
Edwin Kempin7faf41e2013-02-27 08:17:02 +01004557|`updated` |optional|
4558The link:rest-api.html#timestamp[timestamp] of this comment. +
4559Accepted but ignored.
Edwin Kempin67498de2013-02-25 16:15:34 +01004560|`message` |optional|
4561The comment message. +
4562If not set and an existing draft comment is updated, the existing draft
4563comment is deleted.
Dave Borowitz3dd203b2016-04-19 13:52:41 -04004564|`tag` |optional, drafts only|
4565Value of the `tag` field. Only allowed on link:#create-draft[draft comment] +
4566inputs; for published comments, use the `tag` field in +
4567link#review-input[ReviewInput]
Edwin Kempin67498de2013-02-25 16:15:34 +01004568|===========================
4569
Michael Zhou596c7682013-08-25 05:43:34 -04004570[[comment-range]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004571=== CommentRange
Michael Zhou596c7682013-08-25 05:43:34 -04004572The `CommentRange` entity describes the range of an inline comment.
4573
David Pursehouseae367192014-11-25 17:24:47 +09004574[options="header",cols="1,^1,5"]
Michael Zhou596c7682013-08-25 05:43:34 -04004575|===========================
4576|Field Name ||Description
4577|`start_line` ||The start line number of the range.
4578|`start_character` ||The character position in the start line.
4579|`end_line` ||The end line number of the range.
4580|`end_character` ||The character position in the end line.
4581|===========================
4582
Edwin Kempine3446292013-02-19 16:40:14 +01004583[[commit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004584=== CommitInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004585The `CommitInfo` entity contains information about a commit.
4586
Edwin Kempinf0c57152015-07-15 18:18:24 +02004587[options="header",cols="1,^1,5"]
4588|===========================
4589|Field Name ||Description
Edwin Kempinc8237402015-07-15 18:27:55 +02004590|`commit` |Optional|
4591The commit ID. Not set if included in a link:#revision-info[
4592RevisionInfo] entity that is contained in a map which has the commit ID
4593as key.
Edwin Kempinf0c57152015-07-15 18:18:24 +02004594|`parents` ||
Edwin Kempine3446292013-02-19 16:40:14 +01004595The parent commits of this commit as a list of
Edwin Kempincecf90a2014-04-09 14:58:35 +02004596link:#commit-info[CommitInfo] entities. In each parent
4597only the `commit` and `subject` fields are populated.
Edwin Kempinf0c57152015-07-15 18:18:24 +02004598|`author` ||The author of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01004599link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02004600|`committer` ||The committer of the commit as a
Edwin Kempine3446292013-02-19 16:40:14 +01004601link:#git-person-info[GitPersonInfo] entity.
Edwin Kempinf0c57152015-07-15 18:18:24 +02004602|`subject` ||
Edwin Kempine3446292013-02-19 16:40:14 +01004603The subject of the commit (header line of the commit message).
Edwin Kempinf0c57152015-07-15 18:18:24 +02004604|`message` ||The commit message.
Sven Selbergd26bd542014-11-21 16:28:10 +01004605|`web_links` |optional|
4606Links to the commit in external sites as a list of
4607link:#web-link-info[WebLinkInfo] entities.
Edwin Kempinf0c57152015-07-15 18:18:24 +02004608|===========================
Edwin Kempine3446292013-02-19 16:40:14 +01004609
Edwin Kempin407fca32016-08-29 12:01:00 +02004610[[delete-reviewer-input]]
4611=== DeleteReviewerInput
4612The `DeleteReviewerInput` entity contains options for the deletion of a
4613reviewer.
4614
4615[options="header",cols="1,^1,5"]
4616|=======================
4617|Field Name||Description
4618|`notify` |optional|
4619Notify handling that defines to whom email notifications should be sent
4620after the reviewer is deleted. +
4621Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
4622If not set, the default is `ALL`.
4623|=======================
4624
Edwin Kempin1dfecb62016-06-16 10:45:00 +02004625[[delete-vote-input]]
4626=== DeleteVoteInput
4627The `DeleteVoteInput` entity contains options for the deletion of a
4628vote.
4629
4630[options="header",cols="1,^1,5"]
4631|=======================
4632|Field Name||Description
4633|`label` |optional|
4634The label for which the vote should be deleted. +
4635If set, must match the label in the URL.
4636|`notify` |optional|
4637Notify handling that defines to whom email notifications should be sent
4638after the vote is deleted. +
4639Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
4640If not set, the default is `ALL`.
4641|=======================
4642
David Pursehouse882aef22013-06-05 10:56:37 +09004643[[diff-content]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004644=== DiffContent
David Pursehouse882aef22013-06-05 10:56:37 +09004645The `DiffContent` entity contains information about the content differences
4646in a file.
4647
David Pursehouseae367192014-11-25 17:24:47 +09004648[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09004649|==========================
4650|Field Name ||Description
4651|`a` |optional|Content only in the file on side A (deleted in B).
4652|`b` |optional|Content only in the file on side B (added in B).
4653|`ab` |optional|Content in the file on both sides (unchanged).
4654|`edit_a` |only present during a replace, i.e. both `a` and `b` are present|
4655Text sections deleted from side A as a
4656link:#diff-intraline-info[DiffIntralineInfo] entity.
4657|`edit_b` |only present during a replace, i.e. both `a` and `b` are present|
4658Text sections inserted in side B as a
4659link:#diff-intraline-info[DiffIntralineInfo] entity.
4660|`skip` |optional|count of lines skipped on both sides when the file is
4661too large to include all common lines.
Shawn Pearce425a2be2014-01-02 16:00:58 -08004662|`common` |optional|Set to `true` if the region is common according
4663to the requested ignore-whitespace parameter, but a and b contain
4664differing amounts of whitespace. When present and true a and b are
4665used instead of ab.
David Pursehouse882aef22013-06-05 10:56:37 +09004666|==========================
4667
4668[[diff-file-meta-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004669=== DiffFileMetaInfo
David Pursehouse882aef22013-06-05 10:56:37 +09004670The `DiffFileMetaInfo` entity contains meta information about a file diff.
4671
David Pursehouseae367192014-11-25 17:24:47 +09004672[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09004673|==========================
Sven Selberge7f3f0a2014-10-21 11:04:42 +02004674|Field Name ||Description
4675|`name` ||The name of the file.
4676|`content_type`||The content type of the file.
4677|`lines` ||The total number of lines in the file.
Edwin Kempin26c95a42014-11-25 16:29:47 +01004678|`web_links` |optional|
Sven Selberge7f3f0a2014-10-21 11:04:42 +02004679Links to the file in external sites as a list of
Shawn Pearceb62414c2014-10-16 22:48:33 -07004680link:rest-api-changes.html#web-link-info[WebLinkInfo] entries.
David Pursehouse882aef22013-06-05 10:56:37 +09004681|==========================
4682
4683[[diff-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004684=== DiffInfo
David Pursehouse882aef22013-06-05 10:56:37 +09004685The `DiffInfo` entity contains information about the diff of a file
4686in a revision.
4687
Edwin Kempin8cdce502014-12-06 10:55:38 +01004688If the link:#weblinks-only[weblinks-only] parameter is specified, only
4689the `web_links` field is set.
4690
David Pursehouseae367192014-11-25 17:24:47 +09004691[options="header",cols="1,^1,5"]
David Pursehouse882aef22013-06-05 10:56:37 +09004692|==========================
4693|Field Name ||Description
4694|`meta_a` |not present when the file is added|
4695Meta information about the file on side A as a
4696link:#diff-file-meta-info[DiffFileMetaInfo] entity.
4697|`meta_b` |not present when the file is deleted|
4698Meta information about the file on side B as a
4699link:#diff-file-meta-info[DiffFileMetaInfo] entity.
4700|`change_type` ||The type of change (`ADDED`, `MODIFIED`, `DELETED`, `RENAMED`
4701`COPIED`, `REWRITE`).
4702|`intraline_status`|only set when the `intraline` parameter was specified in the request|
4703Intraline status (`OK`, `ERROR`, `TIMEOUT`).
4704|`diff_header` ||A list of strings representing the patch set diff header.
4705|`content` ||The content differences in the file as a list of
4706link:#diff-content[DiffContent] entities.
Edwin Kempin8cdce502014-12-06 10:55:38 +01004707|`web_links` |optional|
4708Links to the file diff in external sites as a list of
4709link:rest-api-changes.html#diff-web-link-info[DiffWebLinkInfo] entries.
David Ostrovskycdbef232015-02-13 01:16:37 +01004710|`binary` |not set if `false`|Whether the file is binary.
David Pursehouse882aef22013-06-05 10:56:37 +09004711|==========================
4712
4713[[diff-intraline-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004714=== DiffIntralineInfo
David Pursehouse882aef22013-06-05 10:56:37 +09004715The `DiffIntralineInfo` entity contains information about intraline edits in a
4716file.
4717
David Pursehouse31203f52013-06-08 17:05:45 +09004718The information consists of a list of `<skip length, mark length>` pairs, where
4719the skip length is the number of characters between the end of the previous edit
4720and the start of this edit, and the mark length is the number of edited characters
4721following the skip. The start of the edits is from the beginning of the related
4722diff content lines.
David Pursehouse882aef22013-06-05 10:56:37 +09004723
David Pursehouse31203f52013-06-08 17:05:45 +09004724Note that the implied newline character at the end of each line is included in
Colby Ranger4c292752013-06-07 11:11:00 -07004725the length calculation, and thus it is possible for the edits to span newlines.
David Pursehouse882aef22013-06-05 10:56:37 +09004726
Edwin Kempin8cdce502014-12-06 10:55:38 +01004727[[diff-web-link-info]]
4728=== DiffWebLinkInfo
4729The `DiffWebLinkInfo` entity describes a link on a diff screen to an
4730external site.
4731
4732[options="header",cols="1,6"]
4733|=======================
4734|Field Name|Description
4735|`name` |The link name.
4736|`url` |The link URL.
4737|`image_url`|URL to the icon of the link.
4738|show_on_side_by_side_diff_view|
4739Whether the web link should be shown on the side-by-side diff screen.
4740|show_on_unified_diff_view|
4741Whether the web link should be shown on the unified diff screen.
4742|=======================
4743
David Ostrovsky9ea9c112015-01-25 00:12:38 +01004744[[edit-file-info]]
4745=== EditFileInfo
4746The `EditFileInfo` entity contains additional information
4747of a file within a change edit.
4748
4749[options="header",cols="1,^1,5"]
4750|===========================
4751|Field Name ||Description
4752|`web_links` |optional|
4753Links to the diff info in external sites as a list of
4754link:#web-link-info[WebLinkInfo] entities.
4755|===========================
4756
Edwin Kempin521c1242015-01-23 12:44:44 +01004757[[edit-info]]
4758=== EditInfo
4759The `EditInfo` entity contains information about a change edit.
4760
4761[options="header",cols="1,^1,5"]
4762|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04004763|Field Name ||Description
4764|`commit` ||The commit of change edit as
Edwin Kempin521c1242015-01-23 12:44:44 +01004765link:#commit-info[CommitInfo] entity.
Michael Zhoud03fe282016-04-25 17:13:17 -04004766|`base_revision`||The revision of the patch set the change edit is based on.
4767|`fetch` ||
Edwin Kempin521c1242015-01-23 12:44:44 +01004768Information about how to fetch this patch set. The fetch information is
4769provided as a map that maps the protocol name ("`git`", "`http`",
4770"`ssh`") to link:#fetch-info[FetchInfo] entities.
Michael Zhoud03fe282016-04-25 17:13:17 -04004771|`files` |optional|
Edwin Kempin521c1242015-01-23 12:44:44 +01004772The files of the change edit as a map that maps the file names to
4773link:#file-info[FileInfo] entities.
4774|===========================
4775
Edwin Kempine3446292013-02-19 16:40:14 +01004776[[fetch-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004777=== FetchInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004778The `FetchInfo` entity contains information about how to fetch a patch
4779set via a certain protocol.
4780
David Pursehouseae367192014-11-25 17:24:47 +09004781[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004782|==========================
Edwin Kempinea621482013-10-16 12:58:24 +02004783|Field Name ||Description
4784|`url` ||The URL of the project.
4785|`ref` ||The ref of the patch set.
4786|`commands` |optional|
4787The download commands for this patch set as a map that maps the command
4788names to the commands. +
David Pursehouse025c1af2015-11-20 17:02:50 +09004789Only set if link:#download-commands[download commands] are requested.
Edwin Kempine3446292013-02-19 16:40:14 +01004790|==========================
4791
4792[[file-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004793=== FileInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004794The `FileInfo` entity contains information about a file in a patch set.
4795
David Pursehouseae367192014-11-25 17:24:47 +09004796[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004797|=============================
4798|Field Name ||Description
4799|`status` |optional|
4800The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
4801"`C`"=Copied, "`W`"=Rewritten). +
4802Not set if the file was Modified ("`M`").
4803|`binary` |not set if `false`|Whether the file is binary.
4804|`old_path` |optional|
4805The old file path. +
John Spurlockd25fad12013-03-09 11:48:49 -05004806Only set if the file was renamed or copied.
Edwin Kempine3446292013-02-19 16:40:14 +01004807|`lines_inserted`|optional|
4808Number of inserted lines. +
4809Not set for binary files or if no lines were inserted.
4810|`lines_deleted` |optional|
4811Number of deleted lines. +
4812Not set for binary files or if no lines were deleted.
Edwin Kempin640f9842015-10-08 15:53:20 +02004813|`size_delta` ||
4814Number of bytes by which the file size increased/decreased.
Edwin Kempin971a5f52015-10-28 10:50:39 +01004815|`size` ||
4816File size in bytes.
Edwin Kempine3446292013-02-19 16:40:14 +01004817|=============================
4818
Dave Borowitzbad53ee2015-06-11 10:10:18 -04004819[[fix-input]]
4820=== FixInput
4821The `FixInput` entity contains options for fixing commits using the
4822link:#fix-change[fix change] endpoint.
4823
4824[options="header",cols="1,6"]
4825|==========================
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07004826|Field Name |Description
4827|`delete_patch_set_if_commit_missing`|If true, delete patch sets from the
Dave Borowitzbad53ee2015-06-11 10:10:18 -04004828database if they refer to missing commit options.
Dave Borowitzb50a7ed2015-07-27 15:10:36 -07004829|`expect_merged_as` |If set, check that the change is
Dave Borowitza828fed2015-05-05 14:43:40 -07004830merged into the destination branch as this exact SHA-1. If not, insert
4831a new patch set referring to this commit.
Dave Borowitzbad53ee2015-06-11 10:10:18 -04004832|==========================
4833
Edwin Kempine3446292013-02-19 16:40:14 +01004834[[git-person-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004835=== GitPersonInfo
Edwin Kempine3446292013-02-19 16:40:14 +01004836The `GitPersonInfo` entity contains information about the
4837author/committer of a commit.
4838
David Pursehouseae367192014-11-25 17:24:47 +09004839[options="header",cols="1,6"]
Edwin Kempine3446292013-02-19 16:40:14 +01004840|==========================
4841|Field Name |Description
4842|`name` |The name of the author/committer.
4843|`email` |The email address of the author/committer.
4844|`date` |The link:rest-api.html#timestamp[timestamp] of when
4845this identity was constructed.
4846|`tz` |The timezone offset from UTC of when this identity was
4847constructed.
4848|==========================
4849
Edwin Kempin521c1242015-01-23 12:44:44 +01004850[[group-base-info]]
4851=== GroupBaseInfo
4852The `GroupBaseInfo` entity contains base information about the group.
4853
4854[options="header",cols="1,6"]
4855|==========================
4856|Field Name |Description
4857|`id` |The id of the group.
4858|`name` |The name of the group.
4859|==========================
4860
4861[[included-in-info]]
4862=== IncludedInInfo
4863The `IncludedInInfo` entity contains information about the branches a
4864change was merged into and tags it was tagged with.
4865
Edwin Kempin78279ba2015-05-22 15:22:41 +02004866[options="header",cols="1,^1,5"]
4867|=======================
4868|Field Name||Description
4869|`branches`||The list of branches this change was merged into.
Edwin Kempin521c1242015-01-23 12:44:44 +01004870Each branch is listed without the 'refs/head/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02004871|`tags` ||The list of tags this change was tagged with.
Edwin Kempin521c1242015-01-23 12:44:44 +01004872Each tag is listed without the 'refs/tags/' prefix.
Edwin Kempin78279ba2015-05-22 15:22:41 +02004873|`external`|optional|A map that maps a name to a list of external
4874systems that include this change, e.g. a list of servers on which this
4875change is deployed.
4876|=======================
Edwin Kempin521c1242015-01-23 12:44:44 +01004877
Edwin Kempine3446292013-02-19 16:40:14 +01004878[[label-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004879=== LabelInfo
Dave Borowitz88159512013-06-14 14:21:50 -07004880The `LabelInfo` entity contains information about a label on a change, always
4881corresponding to the current patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01004882
Dave Borowitz88159512013-06-14 14:21:50 -07004883There are two options that control the contents of `LabelInfo`:
Dave Borowitz7d6aa012013-06-14 16:53:48 -07004884link:#labels[`LABELS`] and link:#detailed-labels[`DETAILED_LABELS`].
Dave Borowitz88159512013-06-14 14:21:50 -07004885
4886* For a quick summary of the state of labels, use `LABELS`.
4887* For detailed information about labels, including exact numeric votes for all
4888 users and the allowed range of votes for the current user, use `DETAILED_LABELS`.
4889
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004890==== Common fields
David Pursehouseae367192014-11-25 17:24:47 +09004891[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01004892|===========================
4893|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01004894|`optional` |not set if `false`|
4895Whether the label is optional. Optional means the label may be set, but
4896it's neither necessary for submission nor does it block submission if
4897set.
Dave Borowitz88159512013-06-14 14:21:50 -07004898|===========================
4899
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004900==== Fields set by `LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09004901[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07004902|===========================
4903|Field Name ||Description
4904|`approved` |optional|One user who approved this label on the change
4905(voted the maximum value) as an
4906link:rest-api-accounts.html#account-info[AccountInfo] entity.
4907|`rejected` |optional|One user who rejected this label on the change
4908(voted the minimum value) as an
4909link:rest-api-accounts.html#account-info[AccountInfo] entity.
4910|`recommended` |optional|One user who recommended this label on the
4911change (voted positively, but not the maximum value) as an
4912link:rest-api-accounts.html#account-info[AccountInfo] entity.
4913|`disliked` |optional|One user who disliked this label on the change
4914(voted negatively, but not the minimum value) as an
4915link:rest-api-accounts.html#account-info[AccountInfo] entity.
David Ostrovsky5292fd72014-02-27 21:56:35 +01004916|`blocking` |optional|If `true`, the label blocks submit operation.
4917If not set, the default is false.
Dave Borowitz88159512013-06-14 14:21:50 -07004918|`value` |optional|The voting value of the user who
4919recommended/disliked this label on the change if it is not
4920"`+1`"/"`-1`".
Khai Do4c91b002014-04-06 23:27:43 -07004921|`default_value`|optional|The default voting value for the label.
4922This value may be outside the range specified in permitted_labels.
Dave Borowitz88159512013-06-14 14:21:50 -07004923|===========================
4924
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08004925==== Fields set by `DETAILED_LABELS`
David Pursehouseae367192014-11-25 17:24:47 +09004926[options="header",cols="1,^1,5"]
Dave Borowitz88159512013-06-14 14:21:50 -07004927|===========================
4928|Field Name ||Description
Edwin Kempine3446292013-02-19 16:40:14 +01004929|`all` |optional|List of all approvals for this label as a list
Dave Borowitz88159512013-06-14 14:21:50 -07004930of link:#approval-info[ApprovalInfo] entities.
Edwin Kempine3446292013-02-19 16:40:14 +01004931|`values` |optional|A map of all values that are allowed for this
4932label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
Dave Borowitz88159512013-06-14 14:21:50 -07004933to the value descriptions.
Edwin Kempine3446292013-02-19 16:40:14 +01004934|===========================
4935
Saša Živkov499873f2014-05-05 13:34:18 +02004936[[mergeable-info]]
4937=== MergeableInfo
4938The `MergeableInfo` entity contains information about the mergeability of a
4939change.
4940
David Pursehouseae367192014-11-25 17:24:47 +09004941[options="header",cols="1,^1,5"]
Saša Živkov499873f2014-05-05 13:34:18 +02004942|============================
Saša Živkov697cab22014-04-29 16:46:50 +02004943|Field Name ||Description
4944|`submit_type` ||
Saša Živkov499873f2014-05-05 13:34:18 +02004945Submit type used for this change, can be `MERGE_IF_NECESSARY`,
4946`FAST_FORWARD_ONLY`, `REBASE_IF_NECESSARY`, `MERGE_ALWAYS` or
4947`CHERRY_PICK`.
Zhen Chenec13e452016-08-03 23:29:43 -07004948|`strategy` |optional|
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004949The strategy of the merge, can be `recursive`, `resolve`,
4950`simple-two-way-in-core`, `ours` or `theirs`.
Saša Živkov697cab22014-04-29 16:46:50 +02004951|`mergeable` ||
Saša Živkov499873f2014-05-05 13:34:18 +02004952`true` if this change is cleanly mergeable, `false` otherwise
Zhen Chen8f00d552016-07-26 16:54:59 -07004953|`commit_merged` |optional|
4954`true` if this change is already merged, `false` otherwise
4955|`content_merged` |optional|
4956`true` if the content of this change is already merged, `false` otherwise
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004957|`conflicts`|optional|
4958A list of paths with conflicts
Saša Živkov697cab22014-04-29 16:46:50 +02004959|`mergeable_into`|optional|
4960A list of other branch names where this change could merge cleanly
Saša Živkov76bab292014-05-08 14:29:12 +02004961|============================
Dave Borowitz88159512013-06-14 14:21:50 -07004962
Zhen Chenf7d85ea2016-05-02 15:14:43 -07004963[[merge-input]]
4964=== MergeInput
4965The `MergeInput` entity contains information about the merge
4966
4967[options="header",cols="1,^1,5"]
4968|============================
4969|Field Name ||Description
4970|`source` ||
4971The source to merge from, e.g. a complete or abbreviated commit SHA-1,
4972a complete reference name, a short reference name under refs/heads, refs/tags,
4973or refs/remotes namespace, etc.
4974|`strategy` |optional|
4975The strategy of the merge, can be `recursive`, `resolve`,
4976`simple-two-way-in-core`, `ours` or `theirs`, default will use project settings.
4977|============================
4978
Raviteja Sunkara791f3392015-11-03 13:24:50 +05304979[[move-input]]
4980=== MoveInput
4981The `MoveInput` entity contains information for moving a change to a new branch.
4982
4983[options="header",cols="1,^1,5"]
4984|===========================
Michael Zhoud03fe282016-04-25 17:13:17 -04004985|Field Name ||Description
4986|`destination_branch`||Destination branch
4987|`message` |optional|
Raviteja Sunkara791f3392015-11-03 13:24:50 +05304988A message to be posted in this change's comments
4989|===========================
4990
Edwin Kempin521c1242015-01-23 12:44:44 +01004991[[problem-info]]
4992=== ProblemInfo
4993The `ProblemInfo` entity contains a description of a potential consistency problem
4994with a change. These are not related to the code review process, but rather
4995indicate some inconsistency in Gerrit's database or repository metadata related
4996to the enclosing change.
4997
4998[options="header",cols="1,^1,5"]
4999|===========================
5000|Field Name||Description
5001|`message` ||Plaintext message describing the problem with the change.
5002|`status` |optional|
5003The status of fixing the problem (`FIXED`, `FIX_FAILED`). Only set if a
5004fix was attempted.
5005|`outcome` |optional|
5006If `status` is set, an additional plaintext message describing the
5007outcome of the fix.
5008|===========================
5009
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04005010[[push-certificate-info]]
5011=== PushCertificateInfo
5012The `PushCertificateInfo` entity contains information about a push
5013certificate provided when the user pushed for review with `git push
5014--signed HEAD:refs/for/<branch>`. Only used when signed push is
5015link:config-gerrit.html#receive.enableSignedPush[enabled] on the server.
5016
5017[options="header",cols="1,6"]
5018|===========================
5019|Field Name|Description
5020|`certificate`|Signed certificate payload and GPG signature block.
5021|`key` |
5022Information about the key that signed the push, along with any problems
5023found while checking the signature or the key itself, as a
5024link:rest-api-accounts.html#gpg-key-info[GpgKeyInfo] entity.
5025|===========================
5026
Gabor Somossyb72d4c62015-10-20 23:40:07 +01005027[[range-info]]
5028=== RangeInfo
5029The `RangeInfo` entity stores the coordinates of a range.
5030
5031[options="header",cols="1,6"]
5032|===========================
5033|Field Name | Description
5034|`start` | First index.
5035|`end` | Last index.
5036|===========================
5037
Zalan Blenessy874aed72015-01-12 13:26:18 +01005038[[rebase-input]]
5039=== RebaseInput
5040The `RebaseInput` entity contains information for changing parent when rebasing.
5041
5042[options="header",width="50%",cols="1,^1,5"]
5043|===========================
5044|Field Name ||Description
5045|`base` |optional|
5046The new parent revision. This can be a ref or a SHA1 to a concrete patchset. +
5047Alternatively, a change number can be specified, in which case the current
5048patch set is inferred. +
5049Empty string is used for rebasing directly on top of the target branch,
5050which effectively breaks dependency towards a parent change.
5051|===========================
5052
Edwin Kempin521c1242015-01-23 12:44:44 +01005053[[related-change-and-commit-info]]
5054=== RelatedChangeAndCommitInfo
5055
5056The `RelatedChangeAndCommitInfo` entity contains information about
5057a related change and commit.
5058
5059[options="header",cols="1,^1,5"]
5060|===========================
5061|Field Name ||Description
5062|`change_id` |optional|The Change-Id of the change.
Edwin Kempin521c1242015-01-23 12:44:44 +01005063|`commit` ||The commit as a
5064link:#commit-info[CommitInfo] entity.
5065|`_change_number` |optional|The change number.
5066|`_revision_number` |optional|The revision number.
5067|`_current_revision_number`|optional|The current revision number.
Stefan Beller3e8bd6e2015-06-17 09:46:36 -07005068|`status` |optional|The status of the change. The status of
Stefan Beller0d3cab02015-07-10 13:32:57 -07005069the change is one of (`NEW`, `MERGED`, `ABANDONED`, `DRAFT`).
Edwin Kempin521c1242015-01-23 12:44:44 +01005070|===========================
5071
5072[[related-changes-info]]
5073=== RelatedChangesInfo
5074The `RelatedChangesInfo` entity contains information about related
5075changes.
5076
5077[options="header",cols="1,6"]
5078|===========================
5079|Field Name |Description
5080|`changes` |A list of
5081link:#related-change-and-commit-info[RelatedChangeAndCommitInfo] entities
5082describing the related changes. Sorted by git commit order, newest to
5083oldest. Empty if there are no related changes.
5084|===========================
5085
Edwin Kempined5364b2013-02-22 10:39:33 +01005086[[restore-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005087=== RestoreInput
Edwin Kempined5364b2013-02-22 10:39:33 +01005088The `RestoreInput` entity contains information for restoring a change.
5089
David Pursehouseae367192014-11-25 17:24:47 +09005090[options="header",cols="1,^1,5"]
Edwin Kempined5364b2013-02-22 10:39:33 +01005091|===========================
5092|Field Name ||Description
5093|`message` |optional|
5094Message to be added as review comment to the change when restoring the
5095change.
5096|===========================
5097
Edwin Kempind2ec4152013-02-22 12:17:19 +01005098[[revert-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005099=== RevertInput
Edwin Kempind2ec4152013-02-22 12:17:19 +01005100The `RevertInput` entity contains information for reverting a change.
5101
David Pursehouseae367192014-11-25 17:24:47 +09005102[options="header",cols="1,^1,5"]
Edwin Kempind2ec4152013-02-22 12:17:19 +01005103|===========================
5104|Field Name ||Description
5105|`message` |optional|
5106Message to be added as review comment to the change when reverting the
5107change.
5108|===========================
5109
Edwin Kempin67498de2013-02-25 16:15:34 +01005110[[review-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005111=== ReviewInfo
Edwin Kempin67498de2013-02-25 16:15:34 +01005112The `ReviewInfo` entity contains information about a review.
5113
David Pursehouseae367192014-11-25 17:24:47 +09005114[options="header",cols="1,6"]
Edwin Kempin67498de2013-02-25 16:15:34 +01005115|===========================
5116|Field Name |Description
5117|`labels` |
5118The labels of the review as a map that maps the label names to the
5119voting values.
5120|===========================
5121
Viktar Donich316bf7a2016-07-06 11:29:01 -07005122[[review-update-info]]
5123=== ReviewerUpdateInfo
5124The `ReviewerUpdateInfo` entity contains information about updates to
5125change's reviewers set.
5126
5127[options="header",cols="1,6"]
5128|===========================
5129|Field Name |Description
5130|`updated`|
5131Timestamp of the update.
5132|`updated_by`|
5133The account which modified state of the reviewer in question as
5134link:rest-api-accounts.html#account-info[AccountInfo] entity.
5135|`reviewer`|
5136The reviewer account added or removed from the change as an
5137link:rest-api-accounts.html#account-info[AccountInfo] entity.
5138|`state`|
5139The reviewer state, one of `REVIEWER`, `CC` or `REMOVED`.
5140|===========================
5141
Edwin Kempin67498de2013-02-25 16:15:34 +01005142[[review-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005143=== ReviewInput
Edwin Kempin67498de2013-02-25 16:15:34 +01005144The `ReviewInput` entity contains information for adding a review to a
5145revision.
5146
David Pursehouseae367192014-11-25 17:24:47 +09005147[options="header",cols="1,^1,5"]
Edwin Kempin67498de2013-02-25 16:15:34 +01005148|============================
Bill Wendling692b4ec2015-10-19 15:40:57 -07005149|Field Name ||Description
5150|`message` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01005151The message to be added as review comment.
Dariusz Lukszac70e8622016-03-15 14:05:51 +01005152|`tag` |optional|
5153Apply this tag to the review comment message, votes, and inline
5154comments. Tags may be used by CI or other automated systems to
5155distinguish them from human reviews. Comments with specific tag
5156values can be filtered out in the web UI.
Bill Wendling692b4ec2015-10-19 15:40:57 -07005157|`labels` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01005158The votes that should be added to the revision as a map that maps the
5159label names to the voting values.
Bill Wendling692b4ec2015-10-19 15:40:57 -07005160|`comments` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01005161The comments that should be added as a map that maps a file path to a
5162list of link:#comment-input[CommentInput] entities.
Bill Wendling692b4ec2015-10-19 15:40:57 -07005163|`strict_labels` |`true` if not set|
John Spurlockd25fad12013-03-09 11:48:49 -05005164Whether all labels are required to be within the user's permitted ranges
Edwin Kempin67498de2013-02-25 16:15:34 +01005165based on access controls. +
5166If `true`, attempting to use a label not granted to the user will fail
5167the entire modify operation early. +
5168If `false`, the operation will execute anyway, but the proposed labels
5169will be modified to be the "best" value allowed by the access controls.
Bill Wendling692b4ec2015-10-19 15:40:57 -07005170|`drafts` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01005171Draft handling that defines how draft comments are handled that are
5172already in the database but that were not also described in this
5173input. +
David Ostrovsky8a1da032014-07-25 10:57:35 +02005174Allowed values are `DELETE`, `PUBLISH`, `PUBLISH_ALL_REVISIONS` and
5175`KEEP`. All values except `PUBLISH_ALL_REVISIONS` operate only on drafts
5176for a single revision. +
Edwin Kempin67498de2013-02-25 16:15:34 +01005177If not set, the default is `DELETE`.
Bill Wendling692b4ec2015-10-19 15:40:57 -07005178|`notify` |optional|
Edwin Kempin67498de2013-02-25 16:15:34 +01005179Notify handling that defines to whom email notifications should be sent
5180after the review is stored. +
5181Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5182If not set, the default is `ALL`.
Bill Wendling692b4ec2015-10-19 15:40:57 -07005183|`omit_duplicate_comments`|optional|
5184If `true`, comments with the same content at the same place will be omitted.
5185|`on_behalf_of` |optional|
Shawn Pearce9d783122013-06-11 18:18:03 -07005186link:rest-api-accounts.html#account-id[\{account-id\}] the review
5187should be posted on behalf of. To use this option the caller must
5188have been granted `labelAs-NAME` permission for all keys of labels.
Edwin Kempin67498de2013-02-25 16:15:34 +01005189|============================
5190
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01005191[[reviewer-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005192=== ReviewerInfo
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01005193The `ReviewerInfo` entity contains information about a reviewer and its
5194votes on a change.
5195
Edwin Kempin963dfd02013-02-27 12:39:32 +01005196`ReviewerInfo` has the same fields as
5197link:rest-api-accounts.html#account-info[AccountInfo] and includes
5198link:#detailed-accounts[detailed account information].
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01005199In addition `ReviewerInfo` has the following fields:
5200
David Pursehouseae367192014-11-25 17:24:47 +09005201[options="header",cols="1,6"]
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01005202|==========================
5203|Field Name |Description
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01005204|`approvals` |
5205The approvals of the reviewer as a map that maps the label names to the
David Pursehouse778fefc2014-09-01 14:32:52 +09005206approval values ("`-2`", "`-1`", "`0`", "`+1`", "`+2`").
Edwin Kempin1dbe19e2013-02-22 16:18:58 +01005207|==========================
5208
Edwin Kempin392328e2013-02-25 12:50:03 +01005209[[reviewer-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005210=== ReviewerInput
Edwin Kempin392328e2013-02-25 12:50:03 +01005211The `ReviewerInput` entity contains information for adding a reviewer
5212to a change.
5213
David Pursehouseae367192014-11-25 17:24:47 +09005214[options="header",cols="1,^1,5"]
Edwin Kempin392328e2013-02-25 12:50:03 +01005215|===========================
5216|Field Name ||Description
5217|`reviewer` ||
5218The link:rest-api-accounts.html#account-id[ID] of one account that
5219should be added as reviewer or the link:rest-api-groups.html#group-id[
5220ID] of one group for which all members should be added as reviewers. +
5221If an ID identifies both an account and a group, only the account is
5222added as reviewer to the change.
Logan Hanksee0a4182016-07-06 14:39:26 -07005223|`state` |optional|
5224Add reviewer in this state. Possible reviewer states are `REVIEWER`
5225and `CC`. If not given, defaults to `REVIEWER`.
Edwin Kempin392328e2013-02-25 12:50:03 +01005226|`confirmed` |optional|
5227Whether adding the reviewer is confirmed. +
5228The Gerrit server may be configured to
5229link:config-gerrit.html#addreviewer.maxWithoutConfirmation[require a
5230confirmation] when adding a group as reviewer that has many members.
5231|===========================
5232
Edwin Kempine3446292013-02-19 16:40:14 +01005233[[revision-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005234=== RevisionInfo
Edwin Kempine3446292013-02-19 16:40:14 +01005235The `RevisionInfo` entity contains information about a patch set.
Khai Dob3139b7532014-09-19 15:13:04 -07005236Not all fields are returned by default. Additional fields can
5237be obtained by adding `o` parameters as described in
5238link:#list-changes[Query Changes].
Edwin Kempine3446292013-02-19 16:40:14 +01005239
David Pursehouseae367192014-11-25 17:24:47 +09005240[options="header",cols="1,^1,5"]
Edwin Kempine3446292013-02-19 16:40:14 +01005241|===========================
5242|Field Name ||Description
5243|`draft` |not set if `false`|Whether the patch set is a draft.
David Pursehouse4de41112016-06-28 09:24:08 +09005244|`kind` ||The change kind. Valid values are `REWORK`, `TRIVIAL_REBASE`,
5245`MERGE_FIRST_PARENT_UPDATE`, `NO_CODE_CHANGE`, and `NO_CHANGE`.
Edwin Kempine3446292013-02-19 16:40:14 +01005246|`_number` ||The patch set number.
Edwin Kempin04cbd342015-02-19 16:31:22 +01005247|`created` ||
5248The link:rest-api.html#timestamp[timestamp] of when the patch set was
5249created.
5250|`uploader` ||
5251The uploader of the patch set as an
5252link:rest-api-accounts.html#account-info[AccountInfo] entity.
Edwin Kempin4569ced2014-11-25 16:45:05 +01005253|`ref` ||The Git reference for the patch set.
Edwin Kempine3446292013-02-19 16:40:14 +01005254|`fetch` ||
5255Information about how to fetch this patch set. The fetch information is
5256provided as a map that maps the protocol name ("`git`", "`http`",
Khai Dob3139b7532014-09-19 15:13:04 -07005257"`ssh`") to link:#fetch-info[FetchInfo] entities. This information is
5258only included if a plugin implementing the
5259link:intro-project-owner.html#download-commands[download commands]
5260interface is installed.
Shawn Pearce12e51592013-07-13 22:08:40 -07005261|`commit` |optional|The commit of the patch set as
Edwin Kempine3446292013-02-19 16:40:14 +01005262link:#commit-info[CommitInfo] entity.
Shawn Pearce12e51592013-07-13 22:08:40 -07005263|`files` |optional|
Edwin Kempine3446292013-02-19 16:40:14 +01005264The files of the patch set as a map that maps the file names to
Khai Dob3139b7532014-09-19 15:13:04 -07005265link:#file-info[FileInfo] entities. Only set if
5266link:#current-files[CURRENT_FILES] or link:#all-files[ALL_FILES]
5267option is requested.
Shawn Pearce12e51592013-07-13 22:08:40 -07005268|`actions` |optional|
Shawn Pearcedc4a9b22013-07-12 10:54:38 -07005269Actions the caller might be able to perform on this revision. The
5270information is a map of view name to link:#action-info[ActionInfo]
5271entities.
Khai Dob3139b7532014-09-19 15:13:04 -07005272|`reviewed` |optional|
5273Indicates whether the caller is authenticated and has commented on the
5274current revision. Only set if link:#reviewed[REVIEWED] option is requested.
Dave Borowitzd5ebd9b2015-04-23 17:19:34 -07005275|`messageWithFooter` |optional|
5276If the link:#commit-footers[COMMIT_FOOTERS] option is requested and
5277this is the current patch set, contains the full commit message with
5278Gerrit-specific commit footers, as if this revision were submitted
5279using the link:project-configuration.html#cherry_pick[Cherry Pick]
5280submit type.
Dave Borowitz6f58dbe2015-09-14 12:34:31 -04005281|`push_certificate` |optional|
5282If the link:#push-certificates[PUSH_CERTIFICATES] option is requested,
5283contains the push certificate provided by the user when uploading this
5284patch set as a link:#push-certificate-info[PushCertificateInfo] entity.
5285This field is always set if the option is requested; if no push
5286certificate was provided, it is set to an empty object.
Edwin Kempine3446292013-02-19 16:40:14 +01005287|===========================
5288
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005289[[rule-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005290=== RuleInput
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005291The `RuleInput` entity contains information to test a Prolog rule.
5292
David Pursehouseae367192014-11-25 17:24:47 +09005293[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005294|===========================
5295|Field Name ||Description
5296|`rule`||
5297Prolog code to execute instead of the code in `refs/meta/config`.
5298|`filters`|`RUN` if not set|
5299When `RUN` filter rules in the parent projects are called to
5300post-process the results of the project specific rule. This
5301behavior matches how the rule will execute if installed. +
5302If `SKIP` the parent filters are not called, allowing the test
5303to return results from the input rule.
5304|===========================
5305
Edwin Kempin14b58112013-02-26 16:30:19 +01005306[[submit-info]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005307=== SubmitInfo
Edwin Kempin14b58112013-02-26 16:30:19 +01005308The `SubmitInfo` entity contains information about the change status
5309after submitting.
5310
Stefan Bellere4785b42015-06-18 12:31:03 -07005311[options="header",cols="1,^1,5"]
Edwin Kempin14b58112013-02-26 16:30:19 +01005312|==========================
Stefan Bellere4785b42015-06-18 12:31:03 -07005313|Field Name ||Description
5314|`status` ||
Stefan Beller0d3cab02015-07-10 13:32:57 -07005315The status of the change after submitting is `MERGED`.
David Ostrovsky868e3412014-01-30 19:50:57 +01005316|`on_behalf_of`|optional|
5317The link:rest-api-accounts.html#account-id[\{account-id\}] of the user on
5318whose behalf the action should be done. To use this option the caller must
David Pursehouse22bd6f92014-02-20 21:11:01 +09005319have been granted both `Submit` and `Submit (On Behalf Of)` permissions.
5320The user named by `on_behalf_of` does not need to be granted the `Submit`
5321permission. This feature is aimed for CI solutions: the CI account can be
5322granted both permssions, so individual users don't need `Submit` permission
5323themselves. Still the changes can be submited on behalf of real users and
5324not with the identity of the CI account.
Edwin Kempin14b58112013-02-26 16:30:19 +01005325|==========================
5326
Edwin Kempin0eddba02013-02-22 15:30:12 +01005327[[submit-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005328=== SubmitInput
Edwin Kempin0eddba02013-02-22 15:30:12 +01005329The `SubmitInput` entity contains information for submitting a change.
5330
David Pursehouseae367192014-11-25 17:24:47 +09005331[options="header",cols="1,^1,5"]
Edwin Kempin0eddba02013-02-22 15:30:12 +01005332|===========================
5333|Field Name ||Description
Dave Borowitzc6d143d2016-02-24 12:32:23 -05005334|`on_behalf_of`|optional|
5335If set, submit the change on behalf of the given user. The value may take any
5336format link:rest-api-accounts.html#account-id[accepted by the accounts REST
5337API]. Using this option requires
5338link:access-control.html#category_submit_on_behalf_of[Submit (On Behalf Of)]
5339permission on the branch.
Stephen Lia5a5ef02016-03-31 16:55:53 -07005340|`notify`|optional|
5341Notify handling that defines to whom email notifications should be sent after
5342the change is submitted. +
5343Allowed values are `NONE`, `OWNER`, `OWNER_REVIEWERS` and `ALL`. +
5344If not set, the default is `ALL`.
Edwin Kempin0eddba02013-02-22 15:30:12 +01005345|===========================
5346
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005347[[submit-record]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005348=== SubmitRecord
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005349The `SubmitRecord` entity describes results from a submit_rule.
5350
David Pursehouseae367192014-11-25 17:24:47 +09005351[options="header",cols="1,^1,5"]
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005352|===========================
5353|Field Name ||Description
5354|`status`||
5355`OK`, the change can be submitted. +
5356`NOT_READY`, additional labels are required before submit. +
5357`CLOSED`, closed changes cannot be submitted. +
5358`RULE_ERROR`, rule code failed with an error.
5359|`ok`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01005360Map of labels that are approved; an
5361link:rest-api-accounts.html#account-info[AccountInfo] identifies the
5362voter chosen by the rule.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005363|`reject`|optional|
Edwin Kempinfe29b812013-03-05 14:52:54 +01005364Map of labels that are preventing submit;
5365link:rest-api-accounts.html#account-info[AccountInfo] identifies voter.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005366|`need`|optional|
5367Map of labels that need to be given to submit. The value is
5368currently an empty object.
5369|`may`|optional|
5370Map of labels that can be used, but do not affect submit.
Edwin Kempinfe29b812013-03-05 14:52:54 +01005371link:rest-api-accounts.html#account-info[AccountInfo] identifies voter,
5372if the label has been applied.
Shawn Pearceb1f730b2013-03-04 07:54:09 -08005373|`impossible`|optional|
5374Map of labels that should have been in `need` but cannot be
5375used by any user because of access restrictions. The value
5376is currently an empty object.
5377|`error_message`|optional|
5378When status is RULE_ERROR this message provides some text describing
5379the failure of the rule predicate.
5380|===========================
5381
Jonathan Nieder2a629b02016-06-16 15:15:25 -07005382[[submitted-together-info]]
5383=== SubmittedTogetherInfo
5384The `SubmittedTogetherInfo` entity contains information about a
5385collection of changes that would be submitted together.
5386
5387[options="header",cols="1,6"]
5388|===========================
5389|Field Name |Description
5390|`changes` |
5391A list of ChangeInfo entities representing the changes to be submitted together.
5392|`non_visible_changes`|
5393The number of changes to be submitted together that the current user
5394cannot see. (This count includes changes that are visible to the
5395current user when their reason for being submitted together involves
5396changes the user cannot see.)
5397|===========================
5398
Edwin Kempin521c1242015-01-23 12:44:44 +01005399[[suggested-reviewer-info]]
5400=== SuggestedReviewerInfo
5401The `SuggestedReviewerInfo` entity contains information about a reviewer
5402that can be added to a change (an account or a group).
5403
5404`SuggestedReviewerInfo` has either the `account` field that contains
5405the link:rest-api-accounts.html#account-info[AccountInfo] entity, or
5406the `group` field that contains the
5407link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity.
5408
Logan Hanksab3c81e2016-07-20 15:42:52 -07005409[options="header",cols="1,^1,5"]
5410|===========================
5411|Field Name ||Description
5412|`account` |optional|
5413An link:rest-api-accounts.html#account-info[AccountInfo] entity, if the
5414suggestion is an account.
5415|`group` |optional|
5416A link:rest-api-changes.html#group-base-info[GroupBaseInfo] entity, if the
5417suggestion is a group.
5418|`count` ||
5419The total number of accounts in the suggestion. This is `1` if `account` is
5420present. If `group` is present, the total number of accounts that are
5421members of the group is returned (this count includes members of nested
5422groups).
5423|`confirm` |optional|
5424True if `group` is present and `count` is above the threshold where the
5425`confirmed` flag must be passed to add the group as a reviewer.
5426|===========================
5427
Edwin Kempin64006bb2013-02-22 08:17:04 +01005428[[topic-input]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08005429=== TopicInput
Edwin Kempin64006bb2013-02-22 08:17:04 +01005430The `TopicInput` entity contains information for setting a topic.
5431
David Pursehouseae367192014-11-25 17:24:47 +09005432[options="header",cols="1,^1,5"]
Edwin Kempin64006bb2013-02-22 08:17:04 +01005433|===========================
5434|Field Name ||Description
5435|`topic` |optional|The topic. +
5436The topic will be deleted if not set.
Edwin Kempin64006bb2013-02-22 08:17:04 +01005437|===========================
5438
Edwin Kempinbd885ff2014-04-11 16:11:56 +02005439[[web-link-info]]
5440=== WebLinkInfo
5441The `WebLinkInfo` entity describes a link to an external site.
5442
David Pursehouseae367192014-11-25 17:24:47 +09005443[options="header",cols="1,6"]
Edwin Kempinbd885ff2014-04-11 16:11:56 +02005444|======================
5445|Field Name|Description
5446|`name` |The link name.
5447|`url` |The link URL.
Sven Selberg55484202014-06-26 08:48:51 +02005448|`image_url`|URL to the icon of the link.
Edwin Kempinbd885ff2014-04-11 16:11:56 +02005449|======================
5450
Edwin Kempind0a63922013-01-23 16:32:59 +01005451GERRIT
5452------
5453Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -07005454
5455SEARCHBOX
5456---------