Project

General

Profile

Feature #4253

Updated by Tom Clegg about 9 years ago

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

 h2. Assigning usernames 

 Add "username" attribute to users table. 
 * Can be null. 
 * Unique. 
 * Starts with alpha. Contains only alphanum. 
 * Only admin can change. (Could change in future, but simplifies for now.) 
 * Migration: for active users, copy VM login name if there is one, otherwise assign one based on email address. For inactive users, leave null. 

 Future: 
 * 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. 

 h2. Repositories 

 Repository names 
 * Repository with name=bar, owned by user with username=foo, is "{base}/foo/bar.git" 
 * name cannot be null. 
 * {owner_uuid, name} 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 table "name" column has "foo/bar" (model needs to ensure the "foo" part stays synchronized with owner_uuid->username) 

 Repository permissions 
 * -User 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 can be set/changed to any user writable by current_user, which is only current_user itself for a non-admin in a typical setup. This part is the same as standard permission behavior. 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 from 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 repositories themselves by uuid instead 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? 

Back