Rails Tracker is a mountable Rails engine that enables your users with a web UI to track development progress through Github Issues.
Rails Tracker is a valuable tool for services/products that see value in providing transparency with their bug/issue progress directly to the end user.
Rails Tracker currently requires Active Record and will only work on applications which use Devise as their user authentication system. Rails Tracker utilizes various Devise helpers to faciliate the interactions for your users to track development tickets & issues.
Add Rails Tracker as a Ruby Gem.
gem 'rails_tracker'
After you install Rails Tracker and add it to your Gemfile, you need to run the generator:
rails generate rails_tracker:install
The generator will install an initializer which describes ALL Active Progress’s configuration options and you MUST take a look at it.
Copy the migrations which will create tables to store issue/user associations. Make sure to run your migrations after.
rake rails_tracker:install:migrations
You will need to mount the engine and set the namespace you want to your routes.rb.
mount ActiveProgress::Engine => "/rails_tracker"
“/rails_tracker” can be anything you like. This is where you can now direct users to track your Github issues.
You will need to extend Rails Tracker in your particular User Model. You need to do this by including the module directly in your User Model class.
class User < ActiveRecord::Base include RailsTracker # The rest of your User Model end
These next steps will help incorporate your repo hooks and configure the hook to trigger on issues. Rails Tracker has mailers built in that will alert your users when issues have been closed.
Github webhooks for a URL by default only fire on repo pushes. There is currently no way in the web UI to set up webhooks for other events. You must set your repo to the issue event via the API directly. Follow this example to create a new hook and set the event support with issues
Make sure to pass this URL when you are creating the hook. By default Rails Tracker uses the listen namespace to respond to post updates sent from github. Be sure to name the new hook “web”.
curl -u 'username' -v -H "Content-Type: application/json" \ -X POST -d '{"name": "web", "active": true, "events": ["issues"], \ "config": {"url": "example.com/tracker/listen", "content_type": "json"}}' \ https://api.github.com/repos/:username/:repo/hooks example.com/rails_tracker/listen
You can confirm the hook was created correctly by either viewing directly in the admin section of the repo or with a get request
curl -u 'username' https://api.github.com/repos/:username/:repo/hooks
Rails Tracker utitlizes delayed job to help process your alert emails. When a callback from Github is sent to the listener that a issue has been closed, Rails Tracker marks the issue as closed for your user and also sends an email to update the user of the status. Since you could potentially have thousands of users to send a status update we move this into a background process.
If you already have delayed job working jobs you won’t need to follow this setup. Otherwise make sure to run the installation with
rails generate delayed_job:active_record
Delayed job is a dependency of Rails Tracker so it is already made available for your project. Next run your migrations
rake db:migrate
You can familiarize yourself with delayed job and insuring your workers are running by reading more at
https://github.com/collectiveidea/delayed_job
This project rocks and uses MIT-LICENSE.