7

I need Gitlab integration in Upsource, something similar to available Github integration. As there is no feature for this yet, I've tried to write simple proxy which 'translates' request to Github API for Gitlab API. Similarly it translates response. The main idea is to configure project as Github project but in fact hide Gitlab behind my proxy. It started to work, e.g. in obtaining oauth token process. It works for obtaining commits and comments as well. However I have a problem with retrieving pull requests. In upsource-frontend logs I found following warning:

Head not found for pull request

I filled fields for head object in response (according to Github API docs) but it still doesn't work. Maybe you could tell me what is needed by Upsource in response to getting pull requests?

lukjar
  • 73
  • 2
  • 5

1 Answers1

1

Upsource developer here. You've done great work!

Head not found for pull request

This means that Upsource doesn't see this pull request in Git. What repository is Upsource looking at?

By the way, GitLab integration is one of our main priorities now, though GitLab API is not as rich as GitHub, so we won't be able to implement full sync link for GitHub.

Update: GitLab integration, which includes comments syncronization and merge action, is released in Upsource 2017.3.

Maxim
  • 52,561
  • 27
  • 155
  • 209
  • _What repository is Upsource looking at?_ From the Upsource point of view it is a Github project (but in fact it is Gitlab behind my proxy). – lukjar Sep 21 '17 at 08:19
  • @lukjar Got it. The problem is that pull requests are stored differently in GitHub (`refs/pull`) and GitLab (`refs/merge-requests`) and Upsource is trying to find it there accordingly. – Maxim Sep 21 '17 at 08:23
  • I suppose you mean `refs` directory inside Git repository? I understand that you create directories `refs/pull` and `refs/merge-requests` internally in Upsource? – lukjar Sep 21 '17 at 08:43
  • 1
    Right, inside Git repo, but it's created by the host, not Upsource. This is GitHub spec: https://help.github.com/articles/checking-out-pull-requests-locally/ and GitLab is here: https://docs.gitlab.com/ee/user/project/merge_requests/ – Maxim Sep 21 '17 at 08:50
  • Thank you. I'll try use this information to fix my problem. – lukjar Sep 21 '17 at 08:55