Gerrit REST API 和 Web GUI 具有不同的结果
Gerrit REST API and web GUI with different results
似乎 Gerrit 的 Web 界面和 REST API 显示的评论投票结果不同。
例如,Android Gerrit 审查实例中的 Change I78c787fd5dd09fc7700f3093341532fe23f20eb8 显示 Dima Zavin 投票 +2 (LGTM, approved)
。
Android 实例的默认值为
-2: Do not submit
-1: I would prefer that you didn't submit this
0: No score
+1: Looks good to me, but someone else must approve
+2: Looks good to me, approved
然而,REST API returns 根本没有 +2
,只有 +1
:
curl "https://android-review.googlesource.com/changes/?q=change:I78c787fd5dd09fc7700f3093341532fe23f20eb8&o=DETAILED_LABELS"
有趣的是,这个 URL 似乎有效:
curl "https://android-review.googlesource.com/changes/I78c787fd5dd09fc7700f3093341532fe23f20eb8/detail"
怎么了?
你的curl需要加引号URL:
curl "https://android-review.googlesource.com/changes/?q=change:I78c787fd5dd09fc7700f3093341532fe23f20eb8&o=DETAILED_LABELS"
原来是bug in the Gerrit后端。
似乎 Gerrit 的 Web 界面和 REST API 显示的评论投票结果不同。
例如,Android Gerrit 审查实例中的 Change I78c787fd5dd09fc7700f3093341532fe23f20eb8 显示 Dima Zavin 投票 +2 (LGTM, approved)
。
Android 实例的默认值为
-2: Do not submit
-1: I would prefer that you didn't submit this
0: No score
+1: Looks good to me, but someone else must approve
+2: Looks good to me, approved
然而,REST API returns 根本没有 +2
,只有 +1
:
curl "https://android-review.googlesource.com/changes/?q=change:I78c787fd5dd09fc7700f3093341532fe23f20eb8&o=DETAILED_LABELS"
有趣的是,这个 URL 似乎有效:
curl "https://android-review.googlesource.com/changes/I78c787fd5dd09fc7700f3093341532fe23f20eb8/detail"
怎么了?
你的curl需要加引号URL:
curl "https://android-review.googlesource.com/changes/?q=change:I78c787fd5dd09fc7700f3093341532fe23f20eb8&o=DETAILED_LABELS"
原来是bug in the Gerrit后端。