Giter Site home page Giter Site logo

jgadling / pennant Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 930 KB

Pennant is a powerful feature flag service designed for maximum flexibility and performance

License: Apache License 2.0

Go 93.63% Python 5.48% Dockerfile 0.89%
feature-flags feature-toggles dark-launch grpc-service rest-server cli golang golang-application

pennant's Introduction

Build Status GoDoc

Pennant Feature Flags

Pennant is a powerful dark-launch utility designed for maximum flexibility and performance.

Getting Started

Building and running pennant:

% brew install consul
% consul agent -dev -advertise 127.0.0.1
% git clone pennant.git
% go build && ./pennant server

Example flag

{
  "name": "red_button",
  "description": "Makes the button on the home page red",
  "default": false,
  "policies": [
     {
      "comment": "Everybody whose username starts with 'foo'",
      "rules": "user_username =~ '^foo'"
     },
     {
      "comment": "and some volunteers",
      "rules": "user_id in (10, 11, 13)"
     },
     {
      "comment": "Also 10% of rando users",
      "rules": "pct(user_username) <= 10"
     }
  ]
}

Test a flag without a server

pennant test -f tests/data/flag1.json -d tests/data/data1.json

CLI

Create or update a flag

$ pennant update -f tests/data/flag1.json
- or -
$ pennant update '{"name":"red_button","description":....}'
- or -
$ cat tests/data/flag1.json | pennant update -

Name        Description                            DefaultValue
----------  -------------------------------------  ------------
red_button  Makes the button on the home page red  false

Rule                      Comment
------------------------  ------------------------------------------
user_username =~ '^foo'   Everybody whose username starts with 'foo'
user_id in (10, 11, 13)   and some volunteers
pct(user_username) <= 10  Also 10% of rando users

List flags

% pennant list
Name
----------
red_button

Get flag details

$ pennant show red_button
Name        Description                            DefaultValue
----------  -------------------------------------  ------------
red_button  Makes the button on the home page red  false

Rule                      Comment
------------------------  ------------------------------------------
user_username =~ '^foo'   Everybody whose username starts with 'foo'
user_id in (10, 11, 13)   and some volunteers
pct(user_username) <= 10  Also 10% of rando users

Check whether a flag is enabled

$ pennant value red_button '{"user_id": 10}'
- or -
$ pennant value red_button -f document.json
- or -
$ cat document.json | pennant value red_button -
Flag        Status
----------  -------
red_button  enabled

Delete a flag

$ pennant delete red_button
red_button deleted

API

Method Path Description
GET /flags List flags
GET /flags/{name} Get a flag's definition
DELETE /flags/{name} Delete a flag
POST /flags Create or update a flag
GET /flagValue/{name} Fetch en/disabled state of a flag, given a document

Roadmap

V1 milestones:

  • ✓ Pluggable storage backends, ships with consul and in-memory support
  • ✓ GRPC and REST query interfaces
  • ✓ REST flag management interfaces
  • ✓ Watches for consul value changes
  • ✓ Bundled percentage calculator
  • ✓ Supports arbitrary expressions for en/disabling flags
  • ✓ Client and server in single binary
  • Ships metrics to StatsD
  • FlagGroup - evaluate multiple flags in a single query

V2:

  • More drivers - redis, etcd, filesystem
  • Authentication
  • Prometheus compatible stats
  • Query results caching, perf improvements
  • GRPC flag management interface

Further reading on feature flags

pennant's People

Contributors

codeboten avatar jgadling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.