2011年4月14日 星期四

Integration Redmine with VisualSVN server for Windows - Part2

This article shows you how to integrate from SVN side to Redmine side so that developers commit their source code into SVN, and the mean time, SVN will check the log comments whether fulfill Redmine's log rule to make the log message into Redmine system.
It will check
* comments format fulfill Redmine's rule ?
* comments is too short ?
* issue number is exist ?
* owner of issue is equal to checkin user ?
* issue number is open state ?
* issue number is belong to project associated with committed repository ?

Preconditions: required knowledge
1. subversion hook and subversion commands
2. script language programming: ruby, dos shell
3. regular expression
4. SQL programming

To complete above requirements, It is enough that we focus on hook : pre-commit

Algorithm
1. pre-commit.cmd: to launch pre-commit.rb
2. pre-commit.rb:
    - get the svn log comment
    - check log format and size of log
    - retrieve issue#
    - check issue's owner is equal to checkin user
    - check issue# is open state
    - check issue number is belong to project associated with committed repository


above checks are implemented by sql statement


Also it can be applied to that SVN server and Redmine are installed on different machine.

沒有留言:

張貼留言