Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gitlab connector #142

Closed
ltoussaint opened this issue Aug 31, 2014 · 12 comments
Closed

Add gitlab connector #142

ltoussaint opened this issue Aug 31, 2014 · 12 comments

Comments

@ltoussaint
Copy link
Member

Add gitlab connector

@ltoussaint
Copy link
Member Author

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.

@kmarques
Copy link
Contributor

kmarques commented Sep 3, 2014

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

@ltoussaint
Copy link
Member Author

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

@kmarques
Copy link
Contributor

kmarques commented Sep 3, 2014

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

@ltoussaint
Copy link
Member Author

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?

@ltoussaint
Copy link
Member Author

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

@geoffroy-aubry
Copy link
Member

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

@ltoussaint
Copy link
Member Author

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?

@geoffroy-aubry
Copy link
Member

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…

@ltoussaint
Copy link
Member Author

Yes it's a good solution.

@ltoussaint
Copy link
Member Author

@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.

@ltoussaint
Copy link
Member Author

Done by pull request #145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants