Need clarification on Gerrit Get Review REST api

54 views
Skip to first unread message

Khai Do

unread,
Jun 27, 2014, 1:52:43 AM6/27/14
to repo-d...@googlegroups.com
Hello.  I'm running on master.  The get review REST api is confusing me.  I was wondering if someone can help me understand how it should work.  There seems to be two types of patchsets, the current_revision patchset and older patchsets.  The description and example of this api makes me think that I can get info specific to any patchset on a change (even the older ones).   I am wondering wether my expectations are incorrect or is the documentation a little misleading?   

Lets assume I have a change that contains 3 patchsets, each one had been voted and commented on.   Now I run the following scenarios..

1. When I use the api and pass it revision 3 (the latest patchset) the response contains info on the current_revision, which seems correct: 
-- snippet --
  "labels": {
    "Code-Review": {
      "all": [
        {
          "value": 1,
          "_account_id": 1000002,
          "name": "Russell Westbrook",
          "email": "rwest...@gmail.com",
          "username": "rwestbrook"
        },
..
  "current_revision": "1136ab3d3c580f5cbaef9f1be6567aca46b682e0",
  "revisions": {
    "1136ab3d3c580f5cbaef9f1be6567aca46b682e0": {
      "_number": 3,
      "fetch": {}
    }
  }

2. When I use this api and pass it revision 1 or 2 the response always contains votes for the latest revision and the revision field is always empty:
-- snippet --
  "labels": {
    "Code-Review": {
      "all": [
        {
          "value": 1,
          "_account_id": 1000002,
          "name": "Russell Westbrook",
          "email": "rwest...@gmail.com",
          "username": "rwestbrook"
        },
..
  "revisions": {}

 
I would expect to get the votes from revision 2 (notice value should be -1) and the revision field should contain info about revision 2.
-- snippet --
  "labels": {
    "Code-Review": {
      "all": [
        {
          "value": -1,
          "_account_id": 1000002,
          "name": "Russell Westbrook",
          "email": "rwest...@gmail.com",
          "username": "rwestbrook"
        },
..
  "revisions": {
    "5aedab3d3c580f5cbacf9f1be6567aca46b6d4c3": {
      "_number": 2,
      "fetch": {}
    }


Reply all
Reply to author
Forward
0 new messages