Hi guys,
Can someone explain to me the magic behind AccountInfoCache map [1] returned as part of ChangeDetail [2]? Why there are cases when the map doesn't contain all reviewers for a given change?
For instance, when calling changeDetail method from RCP API for
https://git.eclipse.org/r/#/c/4718/ I get (preferredEmail fields removed):
{
"jsonrpc" : "2.0",
"id" : 1,
"result" : {
"accounts" : {
"accounts" : [{
"id" : 1
}, {
"id" : {
"id" : 1
},
"fullName" : "Shawn Pearce",
}, {
"id" : 118
}, {
"id" : {
"id" : 118
},
"fullName" : "Tomasz Zarna",
}, {
}, {
"id" : 8
"id" : {
"id" : 8
},
"fullName" : "Robin Rosenberg",
}, {
"id" : 107
}, {
"id" : {
"id" : 107
},
"fullName" : "Hudson CI",
}
]
},
...
But when listing reviewers with REST API (GET /changes/4718/reviewers/), I get them all, including Chris:
[
{
"kind": "gerritcodereview#reviewer",
"approvals": {
"IP-Clean": " 0"
},
"_account_id": 1,
"name": "Shawn Pearce",
},
{
"kind": "gerritcodereview#reviewer",
"approvals": {
"IP-Clean": " 0"
},
"_account_id": 2,
"name": "Chris Aniszczyk",
},
{
"kind": "gerritcodereview#reviewer",
"approvals": {
"Verified": " 0",
"Code-Review": "+2",
"IP-Clean": "+1"
},
"_account_id": 8,
"name": "Robin Rosenberg",
},
{
"kind": "gerritcodereview#reviewer",
"approvals": {
"Code-Review": " 0"
},
"_account_id": 107,
"name": "Hudson CI",
}
]
The interesting thing is that we have started noticing it after switching to Gerrit 2.6. But even in previous versions I was able to find some quirks like the cache (the accounts field) containing users not mentioned on the change.
Cheers,
Tomek
[1]
https://gerrit.googlesource.com/gerrit/+/master/gerrit-common/src/main/java/com/google/gerrit/common/data/AccountInfoCache.java[2]
https://gerrit.googlesource.com/gerrit/+/master/gerrit-common/src/main/java/com/google/gerrit/common/data/ChangeDetail.java