Feature #4273

SCM command availability automatic check in administration panel

Added by Anton Andriyevskyy almost 8 years ago. Updated over 6 years ago.

Status:ClosedStart date:2009-11-23
Priority:NormalDue date:
Assignee:Toshi MARUYAMA% Done:

0%

Category:SCM
Target version:1.2.0
Resolution:Fixed

Description

This feature request is based on forum's topic:
http://www.redmine.org/boards/2/topics/8609#message-8637

When running redmine as windows service, it's not guaranteed that users will have "svn" command available, especially on windows, and setting up access to repository ends with this error message:
http://i49.tinypic.com/v3o9c3.png

In order to simplicify administration process, I propose to check if "svn" command if available when they save settings:
http://i49.tinypic.com/x5cj08.png

If it's not, we have 2 options to ask user to make "svn" command available

1. Either by installing svn client on *nix

2. Or by installing svn client / server on windows and putting path to executable into PATH folder.

2.1. Maybe it's also good option to simply ask them path to svn executable on windows.

Also it's good point to note on this settings page that not all windows clients has svn.exe executable itself (for example, tortoisesvn client has no svn executable), so you must recommend to install SVN server with standard svn.exe available and which supports standard SVN commands (like tortoise svn does not) - as for me it will be just good tip for users that are not so familiar with servers, services and clients terminology, and so you will improve gui considerably and make settings more easy to understand and more user-friendly (while implementation is so simple).

p.s. I thinked about this issue because I lost 2 hours myself by setting up integration with svn over https and under windows server 2003.

Home makes sense,
Anton Andriyevskyy

info.png (54.8 KB) Toshi MARUYAMA, 2011-02-09 13:40

settings.png (29.5 KB) Toshi MARUYAMA, 2011-02-09 13:40

info-20110218.png (59.4 KB) Toshi MARUYAMA, 2011-02-18 14:03

scm-info-view.diff Magnifier (2.1 KB) Toshi MARUYAMA, 2011-02-18 14:03

scm-info-view-select.diff Magnifier (981 Bytes) Toshi MARUYAMA, 2011-02-18 14:55

hg.png (11.5 KB) Toshi MARUYAMA, 2011-05-04 09:54

bzr.png (9.96 KB) Toshi MARUYAMA, 2011-05-04 09:54

scm_checkboxes_admin.PNG (3.08 KB) Etienne Massip, 2011-05-19 16:04

admin-repo.png (31 KB) Toshi MARUYAMA, 2011-05-29 09:44


Related issues

Related to Redmine - Feature #7517: Configurable path of executable for scm adapters Closed 2011-02-02
Related to Redmine - Defect #1604: Provide a more meaningful error when running an earlier v... Closed 2008-07-08
Related to Redmine - Feature #2799: Support for Bazaar's shared reposetories (created with in... New 2009-02-21

Associated revisions

Revision 4821
Added by Toshi MARUYAMA over 6 years ago

scm: use shell quote for scm command at adapter level (#7517, #4273).

"C:\Program Files\TortoiseHg\hg.exe" can be used in config/configuration.yml.

In Ruby 1.9 IO.popen, if cmd is an Array of String,
it will be used as the subprocess‘s argv bypassing a shell.

See http://www.ruby-doc.org/core/classes/IO.html

Revision 4822
Added by Toshi MARUYAMA over 6 years ago

scm: add scm command and version methods at repository models (#4273).

Revision 4825
Added by Toshi MARUYAMA over 6 years ago

scm: subversion: refactor getting svn version and add lib test (#4273).

Revision 4829
Added by Toshi MARUYAMA over 6 years ago

scm: git: add methods of getting git version and add unit lib test (#4273).

Revision 4831
Added by Toshi MARUYAMA over 6 years ago

scm: bazaar: add methods of getting bazaar version and add unit lib test (#4273).

Revision 4832
Added by Toshi MARUYAMA over 6 years ago

scm: cvs: add methods of getting cvs version and add unit lib test (#4273).

Revision 4881
Added by Toshi MARUYAMA over 6 years ago

scm: darcs: override client_available method (#4273).

I forgot it.

Revision 4882
Added by Toshi MARUYAMA over 6 years ago

scm: catch exception of getting command and version in model (#4273).

If command does not exist, Windows raises exception in shellout().
Linux does not raise exception.

Revision 4920
Added by Toshi MARUYAMA over 6 years ago

scm: Ruby 1.9 compatibility in getting scm version (#4273).

Revision 5360
Added by Toshi MARUYAMA over 6 years ago

scm: git: add client command tests at unit adapter test (#4273).

Revision 5361
Added by Toshi MARUYAMA over 6 years ago

scm: mercurial: add client command tests at unit adapter test (#4273).

Revision 5362
Added by Toshi MARUYAMA over 6 years ago

scm: git: add scm command tests at unit model test (#4273).

Revision 5363
Added by Toshi MARUYAMA over 6 years ago

scm: mercurial: add scm command tests at unit model test (#4273).

Revision 5364
Added by Toshi MARUYAMA over 6 years ago

scm: add filesystem available test at unit repository test (#4273).

Revision 5632
Added by Toshi MARUYAMA over 6 years ago

scm: add the feature of SCM command availability automatic check in administration panel (#4273).

Revision 5633
Added by Toshi MARUYAMA over 6 years ago

scm: add Japanese translation of the feature of SCM command availability automatic check in administration panel (#4273).

Revision 5634
Added by Toshi MARUYAMA over 6 years ago

scm: update locales of the feature of SCM command availability automatic check in administration panel (#4273).

Revision 5636
Added by Toshi MARUYAMA over 6 years ago

scm: subversion: set available version above 1.3 (#4273, #1604).

"--xml" options are introduced in 1.3.
http://subversion.apache.org/docs/release-notes/1.3.html

Revision 5726
Added by Toshi MARUYAMA over 6 years ago

scm: change i18n key name 'text_scm_version' to 'text_scm_command_version' in setting (#4273).

Revision 5727
Added by Toshi MARUYAMA over 6 years ago

scm: change separator between command and version ',' to '|' in setting (#4273).

Revision 5952
Added by Toshi MARUYAMA over 6 years ago

scm: show scm commands and versions on administration panel (#4273).

Revision 5953
Added by Toshi MARUYAMA over 6 years ago

scm: add Japanese i18n text of scm commands of config/configuration.yml in administrator panel (#4273).

Revision 5954
Added by Toshi MARUYAMA over 6 years ago

scm: update i18n text of scm commands of config/configuration.yml in administrator panel (#4273).

Revision 5955
Added by Toshi MARUYAMA over 6 years ago

scm: remove scm command and version on project setting (#4273).

show a message only if scm command is not available.

Revision 5956
Added by Toshi MARUYAMA over 6 years ago

scm: add Japanese i18n text that scm command is not available in project setting (#4273).

Revision 5957
Added by Toshi MARUYAMA over 6 years ago

scm: update i18n text that scm command is not available in project setting (#4273).

Revision 5960
Added by Jean-Philippe Lang over 6 years ago

Slight UI changes (#4273).

Revision 6007
Added by Toshi MARUYAMA over 6 years ago

scm: add log message of config/configuration.yml if scm command raise Errno::ENOENT exception (#7517, #4273).

History

#1 Updated by Jean-Philippe Lang almost 8 years ago

  • Priority changed from Low to Normal
  • Target version set to 1.0.0 (RC)

That would help indeed.

#2 Updated by Asher Baker over 7 years ago

(for example, tortoisesvn client has no svn executable), so you must recommend to install SVN server with standard svn.exe available and which supports standard SVN commands (like tortoise svn does not)

Actually it is included, since TortoisSVN is only an interface for the command line client, and afaik also added to the path.
Other than that note, it's a great idea.

#3 Updated by Eric Davis over 7 years ago

  • Subject changed from "svn" availability automatic check in administration panel to SCM binary availability automatic check in administration panel
  • Estimated time deleted (3.00)

#4 Updated by Eric Davis over 7 years ago

  • Target version deleted (1.0.0 (RC))

No patch uploaded and we are already well past the feature freeze for 1.0. Maybe in 1.1.

#5 Updated by Toshi MARUYAMA over 6 years ago

  • Category changed from Administration to SCM

#6 Updated by Toshi MARUYAMA over 6 years ago

  • Subject changed from SCM binary availability automatic check in administration panel to SCM command availability automatic check in administration panel
  • Assignee set to Toshi MARUYAMA

I change subject "binary" to "command".
Because Mercurial /usr/bin/hg is python script.

$ file /usr/bin/hg
/usr/bin/hg: a /usr/bin/python script text executable
$ file /usr/bin/bzr
/usr/bin/bzr: a /usr/bin/python script text executable

#7 Updated by Toshi MARUYAMA over 6 years ago

I start to implement this feature.

#8 Updated by Toshi MARUYAMA over 6 years ago

This is showing SCM info patch.
Please review.

#9 Updated by Etienne Massip over 6 years ago

Patch is based on "a" and "b" project paths, could you make it based on project root ?

At first glance, I'd say that code is neat and that "SCM" title should not be the same size than "Information".

Just a thought : SCM information could also be located in / linked to the Administration/Settings/Repositories/activated SCM list if you plan to change its behavior so that the administrator immediately understand the reason he can't activate such scm.

I'll test it later.

#10 Updated by Toshi MARUYAMA over 6 years ago

Thank you for reviewing.

This is select list patch.

#11 Updated by Etienne Massip over 6 years ago

Got a HTTP 500 rendering admin/info :

SCM command failed, make sure that your SCM binary (eg. svn) is in PATH (...): "darcs" --version
  with: No such file or directory - "darcs" --version

Redmine::Scm::Adapters::CommandFailed (No such file or directory - "darcs" --version):
  lib/redmine/scm/adapters/abstract_adapter.rb:211:in `shellout'
  lib/redmine/scm/adapters/darcs_adapter.rb:49:in `darcs_binary_version_from_command_line'
  lib/redmine/scm/adapters/darcs_adapter.rb:42:in `darcs_binary_version'
  lib/redmine/scm/adapters/darcs_adapter.rb:38:in `client_version'
  lib/redmine/scm/adapters/abstract_adapter.rb:41:in `client_version_string'
  app/models/repository.rb:225:in `scm_version_string'
  app/controllers/admin_controller.rb:90:in `info'
  app/controllers/admin_controller.rb:86:in `each'
  app/controllers/admin_controller.rb:86:in `info'

The only SCM installed is Subversion (and FS, of course).

#12 Updated by Etienne Massip over 6 years ago

Toshi MARUYAMA wrote:

Thank you for reviewing.

This is select list patch.

Can't you just disable the checkboxes ?

#13 Updated by Toshi MARUYAMA over 6 years ago

Etienne Massip wrote:

Toshi MARUYAMA wrote:

Thank you for reviewing.

This is select list patch.

Can't you just disable the checkboxes ?

I am not good at HTML coding. Could you try?

#14 Updated by Toshi MARUYAMA over 6 years ago

Etienne Massip wrote:

Got a HTTP 500 rendering admin/info :

[...]

The only SCM installed is Subversion (and FS, of course).

Japan is midnight.
I will fix tomorrow.

#15 Updated by Etienne Massip over 6 years ago

Good night then =)

Sorry, I was mistaken : I thought the 2nd patch was for the Administration/Settings/Repositories/activated SCM checkboxes list.

Handling checkboxes state in this list would require some changes in setting_multiselect() in source:trunk/app/helpers/settings_helper.rb (like adding a yield block returning a map of additional options ?) and probably also a bit in source:trunk/app/views/settings/_repositories.rhtml.

About the select list patch, going in the project Settings tab throws a HTTP 500 error too, still in the shellout() method this time called by hg adapter.

#16 Updated by Toshi MARUYAMA over 6 years ago

I fixed in r4882.

#17 Updated by Etienne Massip over 6 years ago

Both works fine now.

My remarks :

Concerning info panel :
  • "SCM" title should be in lower size than section title "Information"
  • column titles and column values are not well justified

You should handle checkboxes state in screen "Administration/Settings/Repositories/activated SCM" depending upon SCM availability, as stated in my previous notes.

#18 Updated by Toshi MARUYAMA over 6 years ago

  • File hg.png added
  • File bzr.png added
  • Status changed from New to Closed
  • Target version set to 1.2.0
  • % Done changed from 40 to 0
  • Resolution set to Fixed

I finished implementing in r5634.


#19 Updated by Etienne Massip over 6 years ago

Why not do this control in SCM availability selection in Administration/Settings instead of Project settings, since the SCM list in Project settings is already filtered depending upon this selection in Administration/Settings ?

#20 Updated by Toshi MARUYAMA over 6 years ago

Etienne Massip wrote:

Why not do this control in SCM availability selection in Administration/Settings instead of Project settings, since the SCM list in Project settings is already filtered depending upon this selection in Administration/Settings ?

Default list (exclude filesystem) is default setting.
There is no chance to check whether SCM commands are available or not.

And, it is difficult in case of machine replacing or recovering from database.

#21 Updated by Asher Baker over 6 years ago

Toshi MARUYAMA wrote:

Default list (exclude filesystem) is default setting.
There is no chance to check whether SCM commands are available or not.

But the whole point of a feature request is to add a feature.
Denying it because it's not the current functionality is counter-intuitive.

#22 Updated by Etienne Massip over 6 years ago

Moreover, actually, project managers who are not admins will see the command path, this is odd.

#23 Updated by Etienne Massip over 6 years ago

  • Status changed from Closed to Reopened

Please discuss the actual behavior.

#24 Updated by Toshi MARUYAMA over 6 years ago

  • Target version deleted (1.2.0)

#25 Updated by Etienne Massip over 6 years ago

But you did commit some changes to trunk / 1.2, didn't you ?

#26 Updated by Toshi MARUYAMA over 6 years ago

The followings are FAQ.

  • TortoiseSVN does not have svn.exe
  • /usr/local/bin/git is not PATH for web server
  • hg.cmd and bzr.bat can not be used.

So, I think this feature is beneficial to administrators and project managers.

#27 Updated by Etienne Massip over 6 years ago

Don't get me wrong, I'd like this feature very much, but not the way it is implemented as for now :

I think that as it is the administrator's job to configure the Redmine instance, only him and no project manager should be aware of technical details such as the path of SCM executable or the SCM command called behind the scenes.

That's the main reason why I think the SCM info you added in project settings under the SCM combo :
should be moved to admin settings active SCM list :

#28 Updated by Etienne Massip over 6 years ago

  • Target version set to 1.2.0

Just to get JPL's mind about already committed changes.

#29 Updated by Toshi MARUYAMA over 6 years ago

I start implementing.

#30 Updated by Jean-Philippe Lang over 6 years ago

It really makes more sense on the administration panel. Toshi, please update this ticket as soon as it is done, 1.2 is about to be released.

#31 Updated by Toshi MARUYAMA over 6 years ago

Jean-Philippe Lang wrote:

It really makes more sense on the administration panel. Toshi, please update this ticket as soon as it is done, 1.2 is about to be released.

I see.

#32 Updated by Toshi MARUYAMA over 6 years ago

  • Resolution deleted (Fixed)

#33 Updated by Toshi MARUYAMA over 6 years ago

I have committed in trunk.
Please review it.

#34 Updated by Jean-Philippe Lang over 6 years ago

  • Status changed from Reopened to Closed
  • Resolution set to Fixed

Looks much better, thanks :-) I've just made a few UI changes in r5960.
I think we can close it now.

#35 Updated by Toshi MARUYAMA over 6 years ago

Jean-Philippe Lang wrote:

Looks much better, thanks :-) I've just made a few UI changes in r5960.
I think we can close it now.

Thanks, I will merge to 1.2-stable.

#36 Updated by Jean-Philippe Lang over 6 years ago

Merged in 1.2-stable in r5961.

#37 Updated by Toshi MARUYAMA over 6 years ago

Jean-Philippe Lang wrote:

Merged in 1.2-stable in r5961.

Thanks!!

Also available in: Atom PDF