Project

rollout-ui

0.05
There's a lot of open issues
A long-lived project that still receives updates
Rack-mountable app to use and configure feature flags via the rollout gem
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0
~> 0.14
~> 3.13
>= 1.17
>= 0
>= 0
>= 0

Runtime

~> 2.6
>= 2.0, < 5.0
>= 2.0, < 5.0
>= 3.0, < 6.0
 Project Readme

Rollout::UI

Minimalist UI for the rollout gem that you can just mount as a Rack app and it will just work.

Index Page

Usage with Rails

Add it to your application's Gemfile:

gem 'rollout-ui'

Mount it

Rails.application.routes.draw do
  mount Rollout::UI::Web.new => '/admin/rollout'

  # ...
end

And to configure it with your Rollout instance, you can put your configuration in routes.rb or in a standalone initializer.

Rollout::UI.configure do
  instance { $rollout }
end

Authentication

If you are using Rails, you can put constraints on your mount.

So in case of usafe with Devise, your constraints might look like:

module Constraint::Admin
  def self.matches?(request)
    id = request.session["warden.user.user.key"].try(:[], 0).try(:[], 0)
    return false if id.blank?

    user = User.find_by(id: id)
    user&.admin?
  end
end

Rails.application.routes.draw do
  mount Rollout::UI::Web.new => '/admin/rollout', constraints: Constraints::Admin

  # ...
end

API Endpoints

The index and show routes can also respond with JSON data instead of HTML when the request's Accept header is application/json

The index route also accepts query parameters to filter by user or group: /admin/rollout?user=someone /admin/rollout?group=developers

Logging

To get the most out of rollout-ui, we recommend you to turn on logging on your rollout instance to see history of changes in the UI.

$rollout = Rollout.new(Redis.current, logging: { history_length: 100, global: true })

To also see who updated states of your rollouts, you can configure actor and actor_url. So if you are using Rails with Devise, your configuration might look like:

Rollout::UI.configure do
  instance { $rollout }
  actor { current_user&.username }
  actor_url { |actor| "/#{actor}" }
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/fetlife/rollout-ui.

Development

To run this project for development in isolation:

bundle install
bundle exec rerun rackup

And visit http://localhost:9292/.

Alternatively you can also configure which Redis with:

REDIS_HOST=localhost REDIS_PORT=6379 REDIS_DB=10 bundle exec rerun rackup

Releasing

  1. Bump version: rake version:patch (or minor/major)
  2. Commit and tag: git commit -am "Bump version" && git tag v0.7.3
  3. Push: git push origin master --tags

The GitHub Actions workflow will automatically publish to RubyGems when tags are pushed.

License

The gem is available as open source under the terms of the MIT License.