2014-11-06 16 views
0

我試圖用這個「設置審查」 API添加審查意見: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-review格里特設置審覈API不起作用

我可以從這個接口的JSON響應,但沒有改變。 我看不到Gerrit網頁上的任何新評論。

這裏是我的客戶端代碼的例子:

url = '/changes/16148/revisions/1/review' 
data = json.dumps({ 
    'message': 'test', 
    'labels': {}, 
    'comments': { 
     'tools/docpreview.py': [{ 
       'line': 20, 
       'message': 'hehe', 
       }], 
     }, 
    'notify': 'NONE' 
    }) 
pprint(rest.post(url, data=data)) 

和響應例子(私人信息已被刪除)。

這種反應看起來像GET審查API的結果說明如下: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#get-review

{u'_number': 16148, 
... 
u'insertions': 20, 
u'kind': u'gerritcodereview#change', 
u'created': u'2014-11-05 16:23:08.849000000', 
... 
u'status': u'NEW', 
u'subject': u'Add markdown preview.', 
u'updated': u'2014-11-05 22:02:32.978000000'} 

回答

0

您需要進行身份驗證,不應該嗎?因此,您的請求將不得不去/a/changes/

+0

我得到與經過驗證的請求相同的結果。 – Sarrus 2017-04-04 09:45:40