drone/drone — pull request #237 by fudanchii (2014-04-03 22:22:17+00:00)
Title: Gitlab integration support

This is the preliminary version of GitLab integration

Current features:
- Drone may use either gitlab.com or self-hosted repo with custom domain
- Paste GitLab user's private_key to link drone's user with gitlab's.
- User may change this private_key later (re-link account)
- Add private or public repository
- Add deploy key on private repository, use ssh to clone at build.
- Add post commit hook, and merge_request hook
- Build on post-commit and merge-request

Known glitch (wip/open for contribution):
- Re-registering repository may adds duplicated hooks and deploy key
This may be fixed at go-gitlab-client ( Currently there's no function similar to go-github's `CreateUpdate`)

- Building branch with `/` on its name may be broken,
Need to encode `/` to `%2F` when calling GitLab API

- merge_request build from forked repository doesn't work, it works if merge request came from the same repository.
Unlike GitHub, GitLab doesn't provide MR/PR refs at parent repository,
This should be fetched and merged manually at build which require Drone to also save source repository url from which the MR/PR came from, and this may bump into another problem when the source repository is marked as private. Possible fix is to propose a patch to GitLab to add refs at parent repository for each PR/MR, similar to how GitHub PR works. (I just noticed that we don't have this feature too for bitbucket, so nvm I guess?)

- Build still trying to trigger notification to GitHub, this should get decoupled.

- Some other unknown glitches, etc...

@bradrydzewski
I'd like to propose to vendorize go-gitlab-client for now and push back to upstream when things get stable here, or maybe a fork? What do you think?

Any inputs will be much appreciated,
Thanks!