Project

General

Profile

Feature #4253

Updated by Tom Clegg about 9 years ago

Summary: Similar Repository creation is currently limited to github. Each user gets one username, and owns the {git}/username/* namespace. 

 h2. Assigning usernames 

 Add "username" attribute to users table. 
 * Can admins.    It should be null. 
 * Unique. 
 * Starts with alpha. Contains only alphanum. 
 * Only admin can change. (Could change in future, but simplifies possible for now.) 
 * Migration: for active users, copy repository name if there is one, otherwise assign one based on email address. For inactive users, leave null. ordinary users to create new repositories as well. 

 Future: <pre> 
   def permission_to_create 
     current_user and current_user.is_admin 
   end 
 * Add "username" to user profile setup page. Allow user to change own username from null to non-null. Stay on profile page until a unique username is successfully saved. 
 * Unique across all federated sites. </pre> 

 h2. Repositories 

 Repository names 
 * Repository with name=bar, owned by user with username=foo, (Note: one of the reasons this is "{base}/foo/bar.git" 
 * name cannot be null. 
 * {owner_uuid, name} currently restricted is unique. 
 * name starts with alpha, contains only alphanum. 
 * Migrate existing repositories to owner_uuid=system_user_uuid. These will continue to be available at "{base}/foo.git". 

 Repository permissions 
 * User can create a repository with owner_uuid==current_user.uuid but not with any other owner_uuid (unless current_user.is_admin) 
 * owner_uuid must refer to a user, not a group (even if current_user.is_admin) 
 * Permission summary provided to gitolite grants repository owner RW+ permission 
 * Export repository names as "username/reponame" (assuming this is convenient for gitolite permission-sync script). 
 * Update gitolite permission-sync script. 

 UI for managing repos 
 * On manage account page (at least for now) 
 * Add new repository -> dialog box (or inline, if easier)  
 ** Show note that repositories cannot be renamed 
 ** Show note that it will take a minute or two before "git clone" will work (aside/future: can Workbench get feedback prevent users from abusing the git system somehow so it can say "pending" on new repos?) 
 * (Probably) future: Delete repository -> confirm with alert box (cannot be undone). Depends on gitolite moving the old repo out of the way in case a new one is created with the same name. 

 Gitolite changes 
 * Can we store namespace.    We should consider organizing repositories themselves by uuid instead into namespaces (username/repo_name) or (groupname/repo_name) as familiar to users of name? Perhaps symlink names to uuids. This could help with "rename" and "delete" (e.g., delete any symlinks that aren't mentioned in the current permission list; never delete actual git repos). 

 h2. Other stuff to test 

 * Submit jobs & pipelines using repository="username/reponame" 

 h2. Open questions 

 * Any difficult bits on the gitolite/git-daemon side? 
 github.

Back