User/Group namespaces for projects
Created by: dzaporozhets
Work In progress. Feel free to review
CHANGELOG:
- added username field to user
- rake task to fill usernames based on emails create namespaces for users
- STI Group < Namespace
- project has namespace_id
- Projects with namespaces also namespaced in gitolite
- Moving project to group will move it under group namespace
- Moving repos when username changed
- Ability to move project from namespaces to another
TODO:
- tests
- not only admins but a group owners too can add projects to group
- improve admin area
- add manage group page in group namespace
Details:
- Clone:
git clone git@localhost:dzaporozhets/projectname.git
- Web:
http://localhost/dzaporozhets/projectname
Merge request reports
Activity
Created by: dzaporozhets
@vsizov the first iteration is complete. I'd like to merge this stuff after review and writing few more tests
By Administrator on 2012-11-24T20:47:30 (imported from GitLab project)
By Administrator on 2012-11-24T20:47:30 (imported from GitLab)
Created by: Philzen
Great Stuff... would it make sense to consider #1792 (closed) in context of those changes?
By Administrator on 2012-11-25T10:01:44 (imported from GitLab project)
By Administrator on 2012-11-25T10:01:44 (imported from GitLab)
50 36 render action: "edit" 51 37 end 52 38 end 53 39 54 40 def destroy 55 @admin_project.destroy 41 @project.destroy 56 42 57 redirect_to admin_projects_url, notice: 'Project was successfully deleted.' 43 redirect_to projects_url, notice: 'Project was successfully deleted.' 58 44 end 59 45 60 private 46 protected 47 48 def project 23 delegate :name, to: :owner, allow_nil: true, prefix: true 24 25 def self.search query 26 where("name LIKE :query OR code LIKE :query", query: "%#{query}%") 27 end 28 29 def to_param 30 code 31 end 32 14 class Group < Namespace 33 15 def users 34 16 User.joins(:users_projects).where(users_projects: {project_id: project_ids}).uniq 35 17 end 18 19 def human_name 23 delegate :name, to: :owner, allow_nil: true, prefix: true 24 25 def self.search query 26 where("name LIKE :query OR code LIKE :query", query: "%#{query}%") 27 end 28 29 def to_param 30 code 31 end 32 14 class Group < Namespace 33 15 def users 34 16 User.joins(:users_projects).where(users_projects: {project_id: project_ids}).uniq 35 17 end 18 19 def human_name 50 36 render action: "edit" 51 37 end 52 38 end 53 39 54 40 def destroy 55 @admin_project.destroy 41 @project.destroy 56 42 57 redirect_to admin_projects_url, notice: 'Project was successfully deleted.' 43 redirect_to projects_url, notice: 'Project was successfully deleted.' 58 44 end 59 45 60 private 46 protected 47 48 def project Created by: dzaporozhets
Next command will migrate projects
sudo -u gitlab -H rake gitlab:activate_namespaces RAILS_ENV=production
Old one will be kept in global namespace Group projects will be moved under group dir All new projects will be saved under username dir unless you specify groupBy Administrator on 2012-11-25T16:34:45 (imported from GitLab project)
By Administrator on 2012-11-25T16:34:45 (imported from GitLab)
Created by: jojosch
the http(s) clone does not work after installing latest master commit.
also the url in http(s) clone does not display the user/group "subfolder".
johannes@johannesDellXPS15:~/tmp > git clone https://code.[mydomain].de/jojosch/test.git testing_git Cloning into 'testing_git'... Username for 'https://code.[mydomain].de': [my_gitlab_email] Password for 'https://[my_gitlab_email]@code.[mydomain].de': fatal: Authentication failed
logfile:
Started GET "/jojosch/test.git/info/refs?service=git-upload-pack" for 127.0.0.1 at 2012-11-25 18:03:42 +0100 Started GET "/jojosch/test.git/info/refs?service=git-upload-pack" for 127.0.0.1 at 2012-11-25 18:03:48 +0100 Started GET "/jojosch/test.git/info/refs?service=git-upload-pack" for 127.0.0.1 at 2012-11-25 18:03:48 +0100
By Administrator on 2012-11-25T17:04:02 (imported from GitLab project)
By Administrator on 2012-11-25T17:04:02 (imported from GitLab)
Created by: jameswritescode
Shouldn't admin users be allowed to pick the namespace of various users as well as their own then modifying a project in the admin?
By Administrator on 2012-11-26T16:40:03 (imported from GitLab project)
By Administrator on 2012-11-26T16:40:03 (imported from GitLab)