How to share group repository in GitLab 6.0.0 - gitlab

I just installed GitLab 6.0.0 and I am now trying to create a group in order to share a common repository with other users. So I created the group and then added the users I want as owners of this group.
The problem is that the group members don't seem to be able to choose the corresponding namespace when they creating a new project.
Is this a bug? or am I missing something?
Any help is welcomed, thanks.
Best regards,
Michael Pinheiro

It looks like this bug: issue 4900
workarounds:
I should also mention that if User B now creates a Group Y, he is now able to create projects for Group X and Y. (which is a simple workaround)
The other work-around is to have the user create the project in their personal namespace first, then when the repo is created go to settings -> dangerous settings -> change namespace option.
A patch should be proposed soon to fix that bug, which seems to be related to app/models/user.rb (lines 293-295 and lines 331-333)

Related

GitLab: Option to create branch from the issue is missing

I am trying to create a branch linked from an issue on GitLab. The option to create a branch from the issue however is missing on this particular project. I have an access level of Maintainer on this project.
The current project I'm working on:
I have checked the other project I made a few months back on which I have exactly the same access level, the option that I'm looking for is there.
My previous project (This is a different project btw, not the source of the fork)
The difference being is that the current project I am working on is a forked version of the old repo so I could keep historical branches from the previous version of the project. I also imported the issues from the previous repo to the new one. I tried to create a new test issue but I still can't see the menu.
It seems like I configured something wrong, could you please help me identify why I cannot access this menu? Any help would be appreciated.
Thanks!
After some digging, I found that this may be a current known issue on GitLab. It only happens on forked projects similar to #VonC's answer. However it doesn't show how to resolve the issue.
To resolve the issue you have to remove the project's fork relationship found on the Settings > General > Advance. If you forked the repo from another project, you should see the Remove fork relationship button there. This essentially removes the fork relationship of the project from the original repository. Once done, the Create merge request should pop-up immediately upon refreshing the page. Do note you need an Owner access to see the Remove fork relationship option.
For more details, please refer to this issue and this solution was from here.
Check first if this is similar to issue 39778 which refers to issue
I disable the button for projects which are forked.
The context in when it references (from a fork) issue from the original project.
No "Create merge request" in that case.

how to export all projects inside a group in gitlab

we are migrating from self hosted gitlab to gitlab.com subscription. We have parent 28 group and under these groups there are multiple subgroups and projects.
I know I can export one group and it will export all the subgroups under it and then I can import it.
but documentation says to export/import single project at a time. I have almost 3000+ Projects and doing this things 3000+ time is not possible.
Can you please suggest me How can I export/import all the projects under a group regardless it is in a group or under someother subgroup in hierarchy ?
or is there any other way ?
You will need to write scripts that interact with the GitLab API to perform the migration of groups/orgs, projects, branches, and merge requests. See the following post on GitLab's forum for guidance.

how to get top level group name in project pipeline?

Currently, I'm working on Gitlab. As part of my task I need to display group id, projectid, runas, job id and job name etc.. in gitlab ci pipeline. I was able to display all required values except group id. searched in google to identify default variables for parent ( top-level-groups) but no luck. Can anyone help me with this?
Please don't mind that I'm not posting my pipeline link.
looking for suggestions .. please help me.
Note: Not looking API based suggestions
Thanks in Advance
$CI_PROJECT_NAMESPACE should be either the group, or the user name if it is a private project. GitLab uses the name namespace for this both in the variables and through the API, but it makes it a bit harder to find if you are looking for group.
Here are all pre-defined variables in GitLab:
https://docs.gitlab.com/ee/ci/variables/predefined_variables.html

How to prevent project maintainer add new members in GitLab?

I want to disallow project maintainer to add new member only, and keep all other maintainer roles. How do I config this rule?
I have local Gitlab 11.9.x version.
I am Owner who create a private project and add new members to team.
You cannot. As the project maintainer, a user can always add new members. Check https://docs.gitlab.com/ee/user/permissions.html for a detailed list of permissions.
Could prevent maintainers from being able to add members to projects in a group
https://docs.gitlab.com/ee/user/group/access_and_permissions.html#prevent-members-from-being-added-to-projects-in-a-group

How to search multiple Projects in GitLab

I am trying to find a way to search multiple project's code in gitlab CE.
Has anyone encountered this before, or have a recommended approach?
(I realize that if this is even possible, then I would likely need to create a script that mimics the current call from the GUI multiple times and combine the results. )
Recently came into a similar need. My particular use case is a self-hosted instance of GitLab CE. Seems like it's possible to use GitLab's API where the scope is limited to snippet, then loop through your groups and projects.
Example code:
https:// (instance_server) /search?utf8=%E2%9C%93&snippets=&scope=&search= (key words) &group_id=22&project_id=81
Other links:
GitLab's paid version.
https://docs.gitlab.com/ee/user/search/advanced_search_syntax.html#syntax-search-filters
Mention of original request (closed)
https://gitlab.com/gitlab-org/gitlab-ce/issues/14597
https://forum.gitlab.com/t/search-code-across-all-projects/2263 (SourceGraph)
You can create a Group, migrate or move all of the projects you want to search to that group, and then search just that group.

Resources