mdsb100 / cli-gitlab

GitLab CLI library
101 stars 11 forks source link

Updating the state of a merge request doesn't work #13

Closed Tzrlk closed 7 years ago

Tzrlk commented 7 years ago

Running gitlab updateMergeRequest --state_event close :projectId :mergeRequestId should close the merge request, and a subsequent call to gitlab showMergeRequest :projectId :mergeRequestId should reflect that change.

Unfortunately, when running that, absolutely nothing happens, and the subsequent query shows that no changes have been made.

mdsb100 commented 7 years ago

I test it , it is success. Use this cmd to get right project_id

gitlab projects --filter 'item.path == "P2RKAndroid"'
369

Use this cmd to get right merge_request_id

 gitlab mergeRequests 369 --filter 'item.state == "opened" '
4655

Use this cmd to close merge request

gitlab updateMergeRequest --state_event close 369 4655

Use this to check state, I see it be closed

gitlab showMergeRequest 369 4655
{
  "assignee": {
    "avatar_url": "http://www.gravatar.com/avatar/60e2b12adcd3766d77e2bb62ab9e88e1?s=80&d=identicon",
    "id": 165,
    "name": "fc",
    "state": "active",
    "username": "fc",
    "web_url": "http://gitlab.yintech.net/fc"
  },
  "author": {
    "avatar_url": "http://www.gravatar.com/avatar/60e2b12adcd3766d77e2bb62ab9e88e1?s=80&d=identicon",
    "id": 165,
    "name": "fc",
    "state": "active",
    "username": "fc",
    "web_url": "http://gitlab.yintech.net/fc"
  },
  "created_at": "2017-05-24T06:03:50.955Z",
  "description": null,
  "downvotes": 0,
  "force_remove_source_branch": null,
  "id": 4655,
  "iid": 67,
  "labels": [
  ],
  "merge_commit_sha": null,
  "merge_status": "can_be_merged",
  "merge_when_build_succeeds": false,
  "milestone": null,
  "project_id": 369,
  "sha": "2c7f775dacc91b83f5962109144b5c7517e5bc64",
  "should_remove_source_branch": null,
  "source_branch": "develop_leiiiooo_mb_20170524_140331",
  "source_project_id": 369,
  "state": "closed",
  "subscribed": true,
  "target_branch": "develop",
  "target_project_id": 369,
  "title": "更改间距",
  "updated_at": "2017-05-25T07:06:03.838Z",
  "upvotes": 0,
  "user_notes_count": 0,
  "web_url": "http://gitlab.yintech.net/ytx-paprika/P2RKAndroid/merge_requests/67",
  "work_in_progress": false
}