Unable to accept merge through API with state_event "merge"
Created by: blackeyedboy
Summary : when a merge request is accepted through the API, that merge request is NOT merged, and its page will then always trigger a 500 error. This MR is kind of lost in space, you have to open another one. Consequently, current API do NOT allow to merge.
Steps to reproduce : open a legitimate merge request, read with some diff in it and that will be in "merge_status":"can_be_merged"
.
Call the API
PUT /projects/:id/merge_request/:merge_request_id
with the parameter state_event
to merge
, and you are on : 500 error, and not merged.
Expected behavior : just merge silently and don't throw 500 error on the merge request page.
Relevant logs : Nothing in githost.log
, application.log
neither sidekiq.log
. Here are corresponding lines in production.log
:
Started PUT "/api/v3/projects/1/merge_request/94" for 127.0.0.1 at 2014-04-16 11:18:55 +0200
Started GET "/xxx/testing-purpose/merge_requests/94" for 127.0.0.1 at 2014-04-16 11:18:55 +0200
Processing by Projects::MergeRequestsController#show as HTML
Parameters: {"project_id"=>"xxx/testing-purpose", "id"=>"94"}
Rendered votes/_votes_block.html.haml (2.9ms)
Rendered projects/merge_requests/show/_mr_title.html.haml (9.2ms)
Rendered projects/merge_requests/show/_how_to_merge.html.haml (8.1ms)
Rendered projects/merge_requests/show/_context.html.haml (8.5ms)
Rendered projects/merge_requests/show/_mr_box.html.haml (21.0ms)
Rendered projects/merge_requests/_show.html.haml (44.9ms)
Rendered projects/merge_requests/show.html.haml within layouts/projects (46.9ms)
Completed 500 Internal Server Error in 124ms
Checks : GitLab 6.7.3 f88d30fa with tests full ok, see below.
System information
System:
Current User: git
Using RVM: no
Ruby Version: 1.9.3p194
Gem Version: 1.8.23
Bundler Version:1.6.1
Rake Version: 10.1.1
Checking Environment ...
Git configured for git user? ... yes
Checking Environment ... Finished
Checking GitLab Shell ...
GitLab Shell version >= 1.9.1 ? ... OK (1.9.1)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
update hook up-to-date? ... yes
update hooks in repos are links: ...
XXX / Testing Purpose ... ok
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
/home/git/repositories: OK
/home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.4.14
Send ping to redis server: PONG
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned UsersGroups? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
projects have namespace: ...
XXX / Testing Purpose ... yes
Projects have satellites? ...
XXX / Testing Purpose ... yes
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.7.10)
Checking GitLab ... Finished