A comprehensive code review plugin for Redmine that enables collaborative source code annotation and review within the repository browser. This plugin integrates deeply with Redmine's issue tracking, permission system, and project management features.
- In-browser Code Review: Annotate and review source code directly in Redmine's repository browser
- Issue Integration: Link code reviews to Redmine issues for comprehensive project tracking
- Reviewer Assignment: Automatic and manual reviewer assignment with notification support
- Project Configuration: Per-project settings for trackers and auto-assignment rules
- Permission Control: Granular permissions integrated with Redmine's role-based access control
- Multi-repository Support: Works with various repository types (Git, Subversion, etc.)
- Attachment Reviews: Review code changes from attached patches and files
- Email Notifications: Automatic notifications for review assignments and updates
- Redmine: Version 5.1.0 or higher
- Ruby: Compatible with Redmine-supported Ruby versions
- Database: Any database supported by Redmine (MySQL, PostgreSQL, SQLite)
- Repository: Git, Subversion, or other VCS supported by Redmine
cd /path/to/redmine/plugins
git clone https://github.com/haru/redmine_code_review.gitOr download and extract the plugin archive to plugins/redmine_code_review.
cd /path/to/redmine
bundle install# For production environment
rake redmine:plugins:migrate RAILS_ENV=productionRestart your Redmine application server (Apache, Nginx, Passenger, etc.).
- Go to your project's Settings tab
- Click on the Modules tab
- Check Code Review to enable the module for this project
- Go to Administration → Roles and permissions
- For each role that should use code reviews, grant appropriate permissions:
- View code review: View existing code reviews
- Add code review: Create new code reviews and comments
- Edit code review: Modify existing code reviews
- Delete code review: Remove code reviews
- Assign code review: Assign reviewers to code reviews
- Code review setting: Configure project-specific code review settings
- In your project, go to Settings → Code Review
- Select which tracker should be used for code review issues
- Configure auto-assignment rules if desired
-
From Repository Browser:
- Navigate to a file in your project's repository
- Click on a line number to add a review comment
- Select the appropriate issue or create a new one
-
From Changesets:
- View a changeset in the repository
- Click "Review" to create a review for the entire changeset
- Add comments to specific lines or files
-
From Attachments:
- Attach a patch file to an issue
- Navigate to the attachment and click "Review"
- Review the patch contents line by line
- Assign Reviewers: Use the assignment interface to designate specific reviewers
- Track Progress: Reviews are linked to issues, allowing full lifecycle tracking
- Auto-assignment: Configure rules for automatic reviewer assignment based on file paths or authors
The plugin sends email notifications for:
- New review assignments
- Review comments and replies
- Review status changes
- Assignment changes
# Clone the repository
git clone https://github.com/haru/redmine_code_review.git
cd redmine_code_review
# Install dependencies
bundle install
# Set up test environment
cp config/database.yml.example config/database.yml
# Edit database.yml with your test database settings
# Run migrations
rake db:migrate RAILS_ENV=test
rake redmine:plugins:migrate RAILS_ENV=test# Run all plugin tests
bundle exec rake redmine:plugins:test NAME=redmine_code_review
# Run with coverage reporting
ruby test/test_runner.rb
# Use build script (includes coverage and cleanup)
./build-scripts/build.shThe build-scripts/ directory contains useful development tools:
install.sh- Set up development environmentbuild.sh- Run tests with coverage reportingcleanup.sh- Clean up after test runsenv.sh- Environment configuration
The plugin includes comprehensive test coverage with:
- Unit Tests: Model and helper testing
- Functional Tests: Controller and integration testing
- Coverage Reporting: SimpleCov with Cobertura format
- Fixtures: Object Daddy for test data generation
Current test coverage reports are available in the coverage/ directory.
- CodeReview: Central model linking reviews to issues, changes, and attachments
- CodeReviewAssignment: Handles reviewer assignment and auto-assignment logic
- CodeReviewProjectSetting: Project-specific configuration
- CodeReviewUserSetting: User preferences and settings
The plugin extends Redmine through:
- Model Patches: Extends core Redmine models (Change, Changeset, Issue, etc.)
- View Hooks: Injects UI elements into Redmine's interface
- Permission System: Integrates with Redmine's role-based permissions
- Email Notifications: Uses Redmine's mailer system
- Project Modules: Registers as a standard Redmine project module
The plugin creates several database tables:
code_reviews- Main review datacode_review_assignments- Reviewer assignmentscode_review_project_settings- Project configurationcode_review_user_settings- User preferences
Migration files are located in db/migrate/ with both numbered and timestamped formats.
- Fork the repository
- Create a feature branch from
develop(git checkout -b feature/amazing-feature develop) - Make your changes with tests
- Run the test suite (
bundle exec rake redmine:plugins:test NAME=redmine_code_review) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request against the
developbranch (notmain)
- Write all commit messages in English
- Follow Ruby and Rails conventions
- Include tests for new functionality
- Update documentation as needed
- Maintain backwards compatibility when possible
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
See GPL.txt for the full license text.
- Issues: Report bugs and feature requests on GitHub Issues
- Wiki: Additional documentation at R-Labs Wiki
- Plugin Directory: Redmine.org Plugin Directory
- Haruyuki Iida (@haru_iida) - Original author and maintainer
- Current stable release
- Requires Redmine 5.1.0 or higher
- Various bug fixes and improvements
For detailed changelog, see the commit history on GitHub.