Gitlab CE Intergration

I am currently setting up YouTrack on a local server which is also hosting Gitlab CE.

 

When adding a 'New VCS Integration' which user's private token should I be using for a shared project? Does choosing an administrative account over a general user who has access to the repo make any difference? Is it a read only system or does YouTrack ever write back to Gitlab?

 

Can YouTrack pull in/interact with existing issues within Gitlab or do these need to be moved over to YouTrack manually?

0
16 comments
Official comment

Hello,

 

Please try to set group "foo" as owner of the repo, it should help.

Regarding your safety concerns: when you're creating a private token, you can select the hooks, so you can make it read-only and it will work fine. 

There shouldn't be any difference between owner of the repository and the general user. 

This article might be helpful: https://confluence.jetbrains.com/display/YTD65/Integration+with+GitLab .

0

Hello, I know this is kinda old post, but after struggling with many google results, I'm still unsure how to connect YouTrack to the my own GitLab CE server.

I have entered my private access token properly, but when trying to bind YouTrack project with GitLab repository I have access only to the repositories of my group, i.e. projects stricly created by me and hosted in my GitLab's username namespace.

For example, if my username is foobar, and thus namespace for my projects is /foobar/, the only projects I can connect to YouTrack using my Personal Access Token from GitLab are: /foobar/*.

Is this a desired behaviour?

 

And is access by Personal Access Token the only way you plan to grant an access to the GitLab repositories? This method involves some security issue regarding 3rd party people access to all repositories I have access to ( = my private token allows), even in read-only mode. Wouldn't it be possible to use for example GitLab's Deploy Keys feature in per-project relation?

0

Hello Maciej, I'm sorry for the delay. 

1) Please instead of foobar use the namespace that you need. You should see the repositories in that namespace after that.

2) Deploy Keys can not be used for this matter since YouTrack needs some write access to the repository, namely it needs to be able to create a web hook so that GitLab pushes changes into YouTrack.

0

Hi Liubov, nice to meet you!

1) This works! Thank you very much!

2) I see. Thank you for the explanation!

:-)

 

0

I am having a similar problem.

When I type in my private token, I use my gitlab username as the repository owner. The repository however is in a subgroup, all of which I am the owner of. I can connect to the VCS but no matter what I try i cannot change the repository path to group/subgroup/repository, and only one project which is in the name space myuser/project is shown.

0

Same issue as Kmhusseini. Cannot access repos that are in a subgroup. This capability seems to be missing.

 

Main group

  1. repo (works)

 

Main group

  • Subgroup
  1. Repo (does not work)
0

Hello,

Please, check if this is your case: https://youtrack.jetbrains.com/issue/JT-46369. This bug has been fixed in the latest YouTrack release. Do you use standalone YouTrack? 

0

Sorry, this is cloud-based YT and GitLab. Please see attached screenshots:



0

Does the error still persist?

0

Hello back again.

When trying to integrate self-hosted YouTrack 2018.2 with self-hosted GitLab 11.1.4 (63daf37) I can not add a VCS integration when repository is under a subgroup (i.e. "foo/bar/repo", or - otherwise - "maingroup/subgroup/repository").

Error says: "No repositories found for current owner".

I'm trying to integrate YouTrack with GitLab using dedicated GitLab user for whom I grant "maintainer" access for particular (i.e. chosen) repositories.

0

Thank you Lüba Melnikova for the hint, it helps a little but does not solve the problem completely.

When I set group "foo" as owner of the repo I must ensure that the dedicated GitLab user (called "YouTrack" for simplicity) has access to whole subgroup "bar". Otherwise repositories located under "foo/bar/*" are unavailable.

And by doing it this way I grant access for GitLab's user "YouTrack" to ALL repositories from the subgroup, which is undesired - I'd like to have control of what I share with certain YouTrack instance.

To recreate an issue:

1. create nested GitLab repositories:
    - foo/repo1.git
    - foo/repo2.git
    - foo/bar/repo3.git
    - foo/bar/repo4.git

2. create new GitLab user (called "Integration") that will be used only for GitLab ↔ YouTrack integration (and I've set this user as "External"

3. impersonate to this user and create "Personal Access Token" with "api" as single scope

4. Go to YouTrack. Using "New VCS Integration" feature under project setting try to connect YouTrack to GitLab (using previously generated Personal Access Token and having "foo" as owner of the repo) in following different situations:
    a) when "Integration" user is a member of "foo/repo1.git": the "repo1.git" should be available in the YouTrack
    b) when "Integration" user is a member of "foo" group: the "repo1.git" and "repo2.git" should be available in the YouTrack (but none of the "bar" subgroup repositories)
    c) when "Integration" user is a member of "foo/bar/repo3.git": the "repo3.git" IS NOT available in YouTrack
    d) when "Integration" user is a member of "foo/bar" subgroup: the "repo3.git" and "repo4.git" ARE NOT available in YouTrack

Problematic scenario are: 4c and 4d (and eventually 4b, but this could be desired behaviour).

So there is still no way to access GitLab's subgroup's repositories from YouTrack :(

0

Hello,

 

Could you please try for c and d cases to set the owner as foo/bar?

0

Naturally.

For both scenarios error "No repositories found for current owner" occurs.

0

I've created a bug report for you: https://youtrack.jetbrains.com/issue/JT-48896 . Please vote/comment on it on tracker to follow the progress.

0

Please sign in to leave a comment.