Twenga/twgit

Add gitlab connector

Closed this issue · 12 comments

Add gitlab connector

It's done on the feature

Also, I move wget and curl (I just added) detection on compatibility.inc.sh.
The goal was to be able to "mock" if wget and/or curl exist because the test was buggy without wget installed.

Hi!

I tried your feature but i had some issues.

  • According to redmine/jira/github connectors, the default scheme is https or it's http.
  • Secondly when I tried to catch the issue title, it returned an empty string (examples on the screenshot).
  • Moreover there are some mistakes on the Gitlab API documention
    • when it refers to GET projects/:id/issues/:id_issue, :id_issue is the unique id of the issue for all the platform but this unique identifier isn't showed on the administration panel (modifying the source code, this id is shown on my screenshot as API#).
    • when it is written that we can access a project by its namespace/path thanks to %2F, it's wrong since a long time referring gitlabhq/gitlabhq#4921

image

I tried to create a gitlab connector here

Hi kmarques

  • For the defaut scheme, we can always define https.
    If the gitlab installation doesn't support it, we just have to write http:// in configuration

For other problems, what is your version of gitlab. Mine is GitLab 7.2.1 ff1633f, so :

  • I get the title using only a call for /projects/:id/issues/:id_issues (I test it with twgit feature list)
  • I'm able to access project using namespace/path (and %2F). Maybe there is a problem with some characters?

For :id_issue, you're right.
I tried with a new gitlab installation with only one project so I didn't see this problem.
You already found the solution in your feature by calling the list of issues and getting the one having the good iid

Hi

Indeed my version of Gitlab wasn't the last one 7.1.1, so I upgraded it to the last one:

$ sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
System information
System:         Debian 7.5
Current User:   git
Using RVM:      no
Ruby Version:   2.1.2p95
Gem Version:    2.2.2
Bundler Version:1.7.1.
Rake Version:   10.3.2
Sidekiq Version:2.17.0

GitLab information
Version:        7.2.1
Revision:       ff1633f
Directory:      /home/git/gitlab
DB Adapter:     postgresql
URL:            http://xxxxxxx
HTTP Clone URL: http://xxxxxx/some-project.git
SSH Clone URL:  git@xxxxxx:some-project.git
Using LDAP:     no
Using Omniauth: no

GitLab Shell
Version:        1.9.7
Repositories:   /home/git/repositories/
Hooks:          /home/git/gitlab-shell/hooks/
Git:            /usr/bin/git

and I tried but it failed again tying to search the project by the namespace/name.
I took a screenshot:
image

It's really strange.
For me, it works on Debian 7.5 stable (Wheezy) (64bits) and OSX V10.9.4

Did you try on your browser?
When I look at the gitlabhq code, I see it manages projects api call with group/project.

Maybe there is a problem with %2F character on some OS. Can you check there is the %2F string in your access logs?

Or maybe it's a problem with the server configuration where your gitlab is...

OK, we have two gitlab connectors :-)
If Karl's connector works in Laurent's env, maybe keep the former (with curl addon)?

Yes, I will test it asap.

And maybe, to prevent calling the /projects api url for each new feature, we could store the :id_project in a local file and then only call projects/:id_project/issues url.

What do you think?

Currently twgit feature list could make one only call to retrieve :id_project regardless of the number of features, by simple use of suited variable :-) Acceptable (O(1)), very easy, and no file cache to handle…

Yes it's a good solution.

@kmarques : your feature works on my debian system.
But your feature is a fork of Hi-Media/twgit, maybe you should fork from Twenga/twgit and then create a pull request with a new release (I will create) as target.

Then I will create a new issue to add curl.

Done by pull request #145