mdsb100 / cli-gitlab

GitLab CLI library
101 stars 11 forks source link

showIssue doesn't work #2

Closed meonkeys closed 9 years ago

meonkeys commented 9 years ago

...or I'm just using it incorrectly.

gitlab showIssue meteor-iron-router-function-trace 1

should display this issue, right? That doesn't print out anything.

mdsb100 commented 9 years ago

I`ll check it.

mdsb100 commented 9 years ago

@meonkeys Usage is not enough helpful, I will modify it clearly. Now, please look to this. You should check the command 'showIssue'. And I will move the command`s map to individual coffee.

gitlab issues
[
{
    "assignee": {
      "avatar_url": "http://gitlab.baidao.com//uploads/user/avatar/9/764b89699bcc946e4239b04f28002ce9.jpeg",
      "id": 9,
      "name": "Cao Jun",
      "state": "active",
      "username": "mdsb100"
    },
    "author": {
      "avatar_url": "http://gitlab.baidao.com//uploads/user/avatar/9/764b89699bcc946e4239b04f28002ce9.jpeg",
      "id": 9,
      "name": "Cao Jun",
      "state": "active",
      "username": "mdsb100"
    },
    "created_at": "2014-08-14T06:28:20.398Z",
    "description": "测试一下",
    "id": 2,
    "iid": 1,
    "labels": [
    ],
    "milestone": null,
    "project_id": 10,
    "state": "closed",
    "title": "Test Issue",
    "updated_at": "2014-08-15T10:25:31.588Z"
  }
]
gitlab showIssue 10 9

Inside code

"showIssue":
    param: [
      "<projectId>"
      "<issueId>"
    ]
    desc: "Get retrive issue fo a given project and a given issue."
    nameSpaces: "issues.show"
    callback: stringifyFormat
{
  "assignee": {
    "avatar_url": "http://www.gravatar.com/avatar/bc0d0584055d3ab3a671a12f1a329921?s=40&d=identicon",
    "id": 12,
    "name": "Bob",
    "state": "active",
    "username": "Bob"
  },
  "author": {
    "avatar_url": "http://www.gravatar.com/avatar/bc0d0584055d3ab3a671a12f1a329921?s=40&d=identicon",
    "id": 12,
    "name": "Bob",
    "state": "active",
    "username": "Bob"
  },
  "created_at": "2014-08-25T07:47:03.860Z",
  "description": "resume时偶尔崩溃\r\n\r\n退出登录时偶尔崩溃\r\n\r\n均无法每次重现。\r\n\r\n![1](http://gitlab.baidao.com/uploads/mobilerd/ytxmobile/f84bcf959e/1.png)\r\n",
  "id": 9,
  "iid": 6,
  "labels": [
    "bug"
  ],
  "milestone": null,
  "project_id": 10,
  "state": "closed",
  "title": "iOS莫名其妙crash",
  "updated_at": "2014-09-26T07:00:26.916Z"
}

By the way, it works work me.

meonkeys commented 9 years ago

Thank you, @mdsb100. I made two mistakes:

  1. I was using iid (nonunique issue "id") instead of id.
  2. I used the wrong projectId.

This works:

gitlab showIssue meonkeys/meteor-iron-router-function-trace 107956