Build status image of CI Integration is not displayed on merge_request of forked projects
Created by: jderusse
There is a bug on merged reqquest when the target project is different to the source project.
GitLab 6.0 GitLabCi 3.0
regarding https://github.com/gitlabhq/gitlabhq/commit/ca936d2784773652530e7b02af40b925ca45a4d6#L2R106
- project refers to the actual project (probably the target of the merge_request)
- last_comit refers to a commit from the source project
With this request, GitLabCi is looking for a build concerning the target project and a commit from the source project. And because de sha does not belong to the project, it return NULL
To fix the issue, I change in app/controllers/merge_requests_controller.rb
def ci_status
status = merge_request.source_project.gitlab_ci_service.commit_status(merge_request.last_commit.sha)
...