Feature #1837
openAlternate method for repository creation
Added by paul k about 16 years ago. Updated about 16 years ago.
0%
Description
Hi,
I wanted an easier way to create repositories, so here we go. The basic idea is to delegate all the logic to a program (script) which will return the repository URL and user and password (if applicable). It gets the repository type and project identifier as arguments and can do whatever is needed (just create the repo, create a new apache configuration, etc.)
The current solution http://www.redmine.org/wiki/redmine/Automating_repository_creation seems svn only and uses polling (which I don't like personally).
The patch is just to show the general idea. If there are better ways I welcome suggestions.
Thanks
Paul
Files
autocreate_repo.patch (4.57 KB) autocreate_repo.patch | patch | paul k, 2008-09-01 11:13 |
Related issues
Updated by pietro abate about 16 years ago
I've done a bit of work regarding the automatic project creation.
It's still polling, but not the user can specify different SCMs .
I'm not sure the patch is still clean, but since it seems nobody is
interested, I've lost a it of motivation to update it. If you're
interested I can generate a new diff.
http://www.redmine.org/issues/show/1783
:)
p
Updated by Nicolas Chuche about 16 years ago
For paul k :
I've read quickly your patch : why not but I think the repository creation logic should go in the model more than in the controller. As I'm working on repository creation for the moment, I will try to see what I could propose on this part.
The main problems I see with avoiding polling is you can only create local repository (yes, you can ssh another server but KISS is my motto).
By the way, I've just added an option to allow git repository creation natively and other SCM repository creation with external script :
Revision r1866 and Revision r1814.
For pietro abate, I reply on Issue #1783
Updated by paul k about 16 years ago
Hi guys,
thanks for your comments. It seems there are other patches for creating repositories and there is no clear direction (yet) so we either wait until the dust has settled or push JPL for an API ;)
pietro argentieri: I still don't like polling. If the UI has an option for creating repos it should do so syncronously. The other point is that people (i.e. project managers) might not have the technical knowledge about setting up a repo and they shouldn't need to. So seperating the whole logic seems desirable (and your solution does this too).
Nicolas Gibelin: Frankly, I didn't understand the Repository.factory() stuff ;) I doubt there is any benefit (except sticking to some MVC "rules") in moving the logic down the stack. Redmine itself shouldn't care about the details of repository setup. You would end up with bazillions of options and hacks to make everyone happy. The idea of my patch is simply to delegate repo creation. Redmine says "I want a repo of type X" and it gets back the URI and credentials if needed, thats as KISS as it can get IMHO.
WRT local repos only: As you said, it's not a strict limitation. You could just trigger reposman on your remote server ;) Whatever you do remotely you need to hack around UNIX lack of RPC.
cheers
Paul
Updated by Nicolas Chuche about 16 years ago
thanks for your comments. It seems there are other patches for creating repositories and there is no clear direction (yet) so we either wait until the dust has settled or push JPL for an API ;)
We won't have a clear direction while we don't know real people's needs. Not need like « no polling » but more like « I need to be able to create repository of different kind for each of my project ». Implementation will came after.
For the moment in trunk we can :
- manually add an external repository
- automatically create repository of one kind (svn, git, ...)
- authenticate users on automatically created repositories (through Redmine.pm)
What do you need after that ?
- automatically create repositories only if the manager ask it ?
pietro argentieri: I still don't like polling. If the UI has an option for creating repos it should do so syncronously.
Synchronously is not always a good idea. Look at the fetch changeset script. To avoid very long task in redmine, there's an external script to fetch changeset.
The other point is that people (i.e. project managers) might not have the technical knowledge about setting up a repo and they shouldn't need to. So seperating the whole logic seems desirable (and your solution does this too).
They shouldn't need to and they don't have to.
Nicolas Gibelin: Frankly, I didn't understand the Repository.factory() stuff ;) I doubt there is any benefit (except sticking to some MVC "rules") in moving the logic down the stack.
Yes there is, keeping all the logic out of the controller and in the model is better to implement RESTful interface for example.
Redmine itself shouldn't care about the details of repository setup. You would end up with bazillions of options and hacks to make everyone happy. The idea of my patch is simply to delegate repo creation. Redmine says "I want a repo of type X" and it gets back the URI and credentials if needed, thats as KISS as it can get IMHO.
You need an admin system to write the script that do everything. Instead of this he can configure reposman. No ?
Updated by paul k about 16 years ago
Nicolas Chuche wrote:
me wrote:
Redmine itself shouldn't care about the details of repository setup. You would end up with bazillions of options and hacks to make everyone happy. The idea of my patch is simply to delegate repo creation. Redmine says "I want a repo of type X" and it gets back the URI and credentials if needed, thats as KISS as it can get IMHO.
You need an admin system to write the script that do everything. Instead of this he can configure reposman. No ?
Just to give you an idea, new repo means here:
- create the svn repo
- create a new apache config
- reload apache
- create an svn.authz file to restrict access
(unfortunately redmine doesn't use the users credentials to access the repo)
- tell redmine where the repo is and what user to connect with.
Authentication is LDAP for redmine and apache, no need for Redmine.pm. Sure, I can change reposman.rb to do all this but than it's my solution and it doesn't solve the API question. Currently the UI requires to provide an URL for a new repo, which doesn't make sense if the repository doesn't exist and the project manager shouldn't be concerned about filesystem internals anyway. This is probably just a minor UI issue and a possible solution would be to make it clear that there is a choice using an existing repo (for which the URL must be known) or creating a new one. The choice for creating a new repo is only available if a proper mechanism is in place (and the UI should indicate if thats not the case). This leads us back to the API for repository creation which would ideally include useful repository specific options (like permissions for SVN).
thanks for your time
cheers
Paul