[[PageOutline(2-5,Contents,pullout)]] = Lightweight code review of changesets = == Description == This plugin adds a lightweight means to review changesets directly on existing changeset pages. [[Image(review1.png)]] This plugin comes with its own {{{CommitTicketReferenceMacro}}} which can be optionally used instead of the built-in one to display the current status within the ticket: [[Image(ticket1.png)]] When a review summary is provided, it gets added as a comment to all tickets referenced in the changeset (also shown above). There are other good code review tools out there that I've used (e.g., [http://code.google.com/p/gerrit/ gerrit]) but I wanted something very lightweight that fits well into our existing Trac ticket workflow. The few existing Trac-based code review plugins (below) appear to be unmaintained. And so this plugin was born. See also: CodeReviewPlugin, PeerReviewPlugin, ExoWebCodeReviewPlugin == Configuration == 1. Install the plugin (after downloading and unzipping): {{{ cd codereviewerplugin/0.12 sudo python setup.py bdist_egg sudo cp dist/TracCodeReviewer*.egg /your/trac/location/plugins/ }}} See [http://trac.edgewall.org/wiki/TracPlugins TracPlugins] for more installation details and options. You'll likely need to restart Trac's web server after installation. 2. Enable the plugin ''and'' if using the built-in {{{commit-updater}}}, disable {{{CommitTicketReferenceMacro}}}: {{{ [components] tracopt.ticket.commit_updater.committicketupdater = enabled tracopt.ticket.commit_updater.committicketreferencemacro = disabled coderev.* = enabled }}} You can alternatively use the Trac Web Admin GUI to enable or disable components. 3. (''optional'') Customize the names for the three statuses (make sure there are always exactly three): {{{ [codereviewer] status_choices = REJECTED,PENDING,PASSED status_default = PENDING }}} 4. After the above, run: {{{ sudo trac-admin /path/to/projenv upgrade }}} See the examples section [wiki:CodeReviewerPlugin#Examples below] for more configuration options. == Bugs/Feature Requests == Existing bugs and feature requests for CodeReviewerPlugin are [report:9?COMPONENT=CodeReviewerPlugin here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=CodeReviewerPlugin&owner=robguttman new ticket]. == Download == Download the zipped source from [download:codereviewerplugin here]. == Source == You can check out CodeReviewerPlugin from [http://trac-hacks.org/svn/codereviewerplugin here] using Subversion, or [source:codereviewerplugin browse the source] with Trac. == Examples == The screenshots in the examples above show basic examples. There are some additional extensions: === Workflow === There are many ways to integrate code reviews into your Trac ticket workflow. As just one example, you may have a {{{phase}}} custom field that includes different phases: 1. implementation 1. codereview 1. verifying If you wanted to prevent the {{{phase}}} from moving beyond "codereview" until all pending code reviews were completed and the last changeset passed review, then if using this plugin's commit ticket reference macro you can add the following [wiki:DynamicFieldsPlugin DynamicFields plugin] rules: {{{ [ticket-custom] phase.invalid_if.1 = verifying phase.invalid_when.1 = .codereviewstatus .pending (msg:Pending code reviews.) phase.invalid_if.2 = verifying phase.invalid_when.2 = .codereviewstatus:last .rejected (msg:The last code review did not pass.) }}} === Jenkins === tbd == Recent Changes == [[ChangeLog(codereviewerplugin, 3)]] == Author/Contributors == '''Author:''' [wiki:robguttman] [[BR]] '''Maintainer:''' [wiki:robguttman] [[BR]] '''Contributors:'''