Changes between Version 23 and Version 24 of RepositoryHookSystemPlugin
- Timestamp:
- Sep 19, 2016, 7:05:48 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RepositoryHookSystemPlugin
v23 v24 5 5 == Description 6 6 7 Th e RepositoryHookSystemPlugin is designed to turn repository hooks, such as SVN's post-commit hook, into extension points so that arbitrary Trac plugins may be built that have full access to the trac framework to act on repository commits.7 This plugin turns repository hooks, such as SVN's post-commit hook, into extension points so that arbitrary Trac plugins may be built that have full access to the Trac framework to act on repository commits. 8 8 9 9 Key features: 10 11 10 * the RepositoryHookSystemPlugin provides an extension point ([source:repositoryhooksystemplugin/0.11/repository_hook_system/interface.py IRepositoryHookSubscriber]) which may be populated with configurable hooks that have access to their trac environment 12 13 11 * the RepositoryHookSystemPlugin is able to enable and disable its presence in the SVN hooks directory without affecting other plugins 14 15 12 * the [http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook trac-post-commit-hook] has been converted to a configurable plugin that does ticket changes (see source:repositoryhooksystemplugin/0.11/repository_hook_system/ticketchanger.py) 16 17 * has a webadmin interface for configuring hooks including figuring out whether or not the plugin has been enabled on a per-project basis 18 13 * has a Webadmin interface for configuring hooks including figuring out whether or not the plugin has been enabled on a per-project basis 19 14 * plugins can be enabled on a per-hook basis 20 21 15 * the listeners are invoked via a command-line call from one of the repository hooks. This is a one-line command that passes whatever details are necessary to identify the changeset. 22 23 * a trac changeset object is used to pass around information. This is good, as it avoids unneccessary information to be sought by the !RepositoryChangeListeners. For the SvnChangeListenerPlugin (at least as it stands living only in the post-commit hook), this is sufficient. It is unknown whether this is a good idea for other hooks and repository systems. A changeset object can be faked if it is not available (like it is at SVN post-commit). 24 16 * a Trac changeset object is used to pass around information. This is good, as it avoids unneccessary information to be sought by the !RepositoryChangeListeners. For the SvnChangeListenerPlugin (at least as it stands living only in the post-commit hook), this is sufficient. It is unknown whether this is a good idea for other hooks and repository systems. A changeset object can be faked if it is not available (like it is at SVN post-commit). 25 17 * the logic of the !RepositoryChangeListeners is agnostic to SCM type and hook used. 26 18 19 This is what the RepositoryHookSystemPlugin webadmin interface looks like for configuration of an SVN post-commit hook: 20 21 [[Image(screenshot.png, border=2)]] 22 23 Example of an SVN post-commit hook file generated by the RepositoryHookSystem that invokes the listener: 24 25 {{{#!sh 26 #!/bin/bash 27 28 # trac repository hook system 29 /home/jhammel/20080519133401/bin/python /home/jhammel/20080519133401/src/RepositoryHookSystem/repository_hook_system/listener.py -p /home/jhammel/20080519133401/projects/fooocracy -p /home/jhammel/20080519133401/projects/newproj --hook post-commit $2 30 }}} 31 32 However, while designed to be generic, this plugin has only been implemented for SVN. 33 27 34 '''Architecture of the RepositoryHookSystemPlugin:''' 28 35 … … 30 37 31 38 This is similar in concept to the SvnChangeListenerPlugin, but the architecture is also designed to support 32 33 * arbitrary version control systems, with an adapter for the version control system used to an implementation capable of hook invocation 34 39 * arbitrary version control systems, with an adaptor for the version control system used to an implementation capable of hook invocation 35 40 * arbitrary hooks, not just post-commit 36 37 However, while architected to be generic, this plugin has only been implemented for SVN.38 41 39 42 == Bugs/Feature Requests … … 61 64 General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page. 62 65 63 == Example64 65 Screenshot of the RepositoryHookSystemPlugin webadmin interface for configuration of an SVN post-commit hook:66 67 [[Image(screenshot.png)]]68 69 Example of an SVN post-commit hook file generated by the RepositoryHookSystem that invokes the listener:70 71 {{{#!sh72 #!/bin/bash73 74 # trac repository hook system75 /home/jhammel/20080519133401/bin/python /home/jhammel/20080519133401/src/RepositoryHookSystem/repository_hook_system/listener.py -p /home/jhammel/20080519133401/projects/fooocracy -p /home/jhammel/20080519133401/projects/newproj --hook post-commit $276 }}}77 78 66 == Recent Changes 79 67