{"action":"closed","number":1,"pull_request":{"url":"https://api.github.com/repos/envato/flip/pulls/1","id":7030526,"html_url":"https://github.com/envato/flip/pull/1","diff_url":"https://github.com/envato/flip/pull/1.diff","patch_url":"https://github.com/envato/flip/pull/1.patch","issue_url":"https://api.github.com/repos/envato/flip/issues/1","number":1,"state":"closed","locked":false,"title":"Envato wip (Don't merge!)","user":{"login":"madlep","id":27223,"avatar_url":"https://avatars.githubusercontent.com/u/27223?v=3","gravatar_id":"","url":"https://api.github.com/users/madlep","html_url":"https://github.com/madlep","followers_url":"https://api.github.com/users/madlep/followers","following_url":"https://api.github.com/users/madlep/following{/other_user}","gists_url":"https://api.github.com/users/madlep/gists{/gist_id}","starred_url":"https://api.github.com/users/madlep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madlep/subscriptions","organizations_url":"https://api.github.com/users/madlep/orgs","repos_url":"https://api.github.com/users/madlep/repos","events_url":"https://api.github.com/users/madlep/events{/privacy}","received_events_url":"https://api.github.com/users/madlep/received_events","type":"User","site_admin":false},"body":"**DON'T MERGE THIS - NOT READY FOR UPSTREAM PR - JUST FOR COMMENT INTERNALLY BY ENVATO PEEPS**\r\n\r\n**NOTE** This is a public PR based on Envato hax to flip - remember all comments here are public :smiley: \r\n\r\nThe flip gem has been severely hacked to bend it to our will. We'll need to tidy the major pieces of functionality up, and send through individual PRs upstream to https://github.com/pda/flip\r\n\r\n# Major changes\r\n- Added abstracted `AbstractStore` (currently just `RedisStore` implementation)\r\n- `RedisStore` connection logic is _\"best effort\"_, consistent with our production usage of Redis - it tries to connect, and get/set data, but if Redis is down, and it fails or times out, then it just silently returns nil. This will cause that feature to fall through to the default value configured for it.\r\n- Use `data_store` to store configuration params for each strategy/definition\r\n- global strategy (similar to `DatabaseStrategy`, but using data store)\r\n- pass options when `Flip.on?` DSL is called in client code. This allows usernames to be specified for feature flag decision logic\r\n- added `DeterministicPercentageStrategy` to allow a feature to be ramped up - is deterministic based on modulus on some ID (probably user.id). This means the same users will always have access to a feature, instead of it being random everytime\r\n- added `HostStrategy` to allow a feature to be turned on/off for a single domain name (e.g. with envato marketplaces http://themeforest.net http://codecanyon.net being served from same codebase, but with different domain names)\r\n- added 'UsernameStrategy` to allow a feature to be turned on for a specified list of users.\r\n\r\n# TODO\r\n\r\n- [ ] split this out into smaller, cleaner PRs to merge upstream\r\n- [ ] provide active record implementation of `AbstractStore`\r\n- [ ] update generators to create app code that makes sense with this set up\r\n- [ ] copy + paste admin views/controllers from envato marketplace (they've been copied there and hacked in the app directly - all the configuration UI lives there)\r\n- [ ] `GlobalStrategy` spec needs updating (Still refers to `RedisStrategy` prior to refactoring into `GlobalStrategy`)\r\n- [x] make `DeterministicPercentageStrategy` do a hash code on the definition + id, so the same poor 1% of users aren't always the guinea pigs for experimental (broken ) new features \r\n- [ ] `FeatureSet` and the way controller filters are done isn't thread safe. Ok for us for now, but would be nice to fix this up if we want to run it under multithreaded jruby.\r\n- [ ] add callbacks to allow new relic etc monitoring of when features are triggered, to allow us to correlate them with increases in errors\r\n","created_at":"2013-07-18T23:57:58Z","updated_at":"2015-04-02T09:53:33Z","closed_at":"2015-04-02T09:53:33Z","merged_at":null,"merge_commit_sha":"222140718c7f0fa82cf8b6900b2e1071b3a28fa5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/envato/flip/pulls/1/commits","review_comments_url":"https://api.github.com/repos/envato/flip/pulls/1/comments","review_comment_url":"https://api.github.com/repos/envato/flip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/envato/flip/issues/1/comments","statuses_url":"https://api.github.com/repos/envato/flip/statuses/a24f565ac75aba4e0acacc92dc4267daf34f4088","head":{"label":"envato:envato_wip","ref":"envato_wip","sha":"a24f565ac75aba4e0acacc92dc4267daf34f4088","user":{"login":"envato","id":14786,"avatar_url":"https://avatars.githubusercontent.com/u/14786?v=3","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"repo":{"id":11437201,"name":"flip","full_name":"envato/flip","owner":{"login":"envato","id":14786,"avatar_url":"https://avatars.githubusercontent.com/u/14786?v=3","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/envato/flip","description":"Flip lets you declare and manage feature flags, backed by cookies (private testing) and database (site-wide).","fork":true,"url":"https://api.github.com/repos/envato/flip","forks_url":"https://api.github.com/repos/envato/flip/forks","keys_url":"https://api.github.com/repos/envato/flip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/envato/flip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/envato/flip/teams","hooks_url":"https://api.github.com/repos/envato/flip/hooks","issue_events_url":"https://api.github.com/repos/envato/flip/issues/events{/number}","events_url":"https://api.github.com/repos/envato/flip/events","assignees_url":"https://api.github.com/repos/envato/flip/assignees{/user}","branches_url":"https://api.github.com/repos/envato/flip/branches{/branch}","tags_url":"https://api.github.com/repos/envato/flip/tags","blobs_url":"https://api.github.com/repos/envato/flip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/envato/flip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/envato/flip/git/refs{/sha}","trees_url":"https://api.github.com/repos/envato/flip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/envato/flip/statuses/{sha}","languages_url":"https://api.github.com/repos/envato/flip/languages","stargazers_url":"https://api.github.com/repos/envato/flip/stargazers","contributors_url":"https://api.github.com/repos/envato/flip/contributors","subscribers_url":"https://api.github.com/repos/envato/flip/subscribers","subscription_url":"https://api.github.com/repos/envato/flip/subscription","commits_url":"https://api.github.com/repos/envato/flip/commits{/sha}","git_commits_url":"https://api.github.com/repos/envato/flip/git/commits{/sha}","comments_url":"https://api.github.com/repos/envato/flip/comments{/number}","issue_comment_url":"https://api.github.com/repos/envato/flip/issues/comments{/number}","contents_url":"https://api.github.com/repos/envato/flip/contents/{+path}","compare_url":"https://api.github.com/repos/envato/flip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/envato/flip/merges","archive_url":"https://api.github.com/repos/envato/flip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/envato/flip/downloads","issues_url":"https://api.github.com/repos/envato/flip/issues{/number}","pulls_url":"https://api.github.com/repos/envato/flip/pulls{/number}","milestones_url":"https://api.github.com/repos/envato/flip/milestones{/number}","notifications_url":"https://api.github.com/repos/envato/flip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/envato/flip/labels{/name}","releases_url":"https://api.github.com/repos/envato/flip/releases{/id}","created_at":"2013-07-16T00:49:53Z","updated_at":"2014-08-16T13:56:39Z","pushed_at":"2014-09-23T06:15:21Z","git_url":"git://github.com/envato/flip.git","ssh_url":"git@github.com:envato/flip.git","clone_url":"https://github.com/envato/flip.git","svn_url":"https://github.com/envato/flip","homepage":null,"size":637,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"envato:master","ref":"master","sha":"23fc1f589438591fd4e3b45354d8a6225e147cbc","user":{"login":"envato","id":14786,"avatar_url":"https://avatars.githubusercontent.com/u/14786?v=3","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"repo":{"id":11437201,"name":"flip","full_name":"envato/flip","owner":{"login":"envato","id":14786,"avatar_url":"https://avatars.githubusercontent.com/u/14786?v=3","gravatar_id":"","url":"https://api.github.com/users/envato","html_url":"https://github.com/envato","followers_url":"https://api.github.com/users/envato/followers","following_url":"https://api.github.com/users/envato/following{/other_user}","gists_url":"https://api.github.com/users/envato/gists{/gist_id}","starred_url":"https://api.github.com/users/envato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/envato/subscriptions","organizations_url":"https://api.github.com/users/envato/orgs","repos_url":"https://api.github.com/users/envato/repos","events_url":"https://api.github.com/users/envato/events{/privacy}","received_events_url":"https://api.github.com/users/envato/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/envato/flip","description":"Flip lets you declare and manage feature flags, backed by cookies (private testing) and database (site-wide).","fork":true,"url":"https://api.github.com/repos/envato/flip","forks_url":"https://api.github.com/repos/envato/flip/forks","keys_url":"https://api.github.com/repos/envato/flip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/envato/flip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/envato/flip/teams","hooks_url":"https://api.github.com/repos/envato/flip/hooks","issue_events_url":"https://api.github.com/repos/envato/flip/issues/events{/number}","events_url":"https://api.github.com/repos/envato/flip/events","assignees_url":"https://api.github.com/repos/envato/flip/assignees{/user}","branches_url":"https://api.github.com/repos/envato/flip/branches{/branch}","tags_url":"https://api.github.com/repos/envato/flip/tags","blobs_url":"https://api.github.com/repos/envato/flip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/envato/flip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/envato/flip/git/refs{/sha}","trees_url":"https://api.github.com/repos/envato/flip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/envato/flip/statuses/{sha}","languages_url":"https://api.github.com/repos/envato/flip/languages","stargazers_url":"https://api.github.com/repos/envato/flip/stargazers","contributors_url":"https://api.github.com/repos/envato/flip/contributors","subscribers_url":"https://api.github.com/repos/envato/flip/subscribers","subscription_url":"https://api.github.com/repos/envato/flip/subscription","commits_url":"https://api.github.com/repos/envato/flip/commits{/sha}","git_commits_url":"https://api.github.com/repos/envato/flip/git/commits{/sha}","comments_url":"https://api.github.com/repos/envato/flip/comments{/number}","issue_comment_url":"https://api.github.com/repos/envato/flip/issues/comments{/number}","contents_url":"https://api.github.com/repos/envato/flip/contents/{+path}","compare_url":"https://api.github.com/repos/envato/flip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/envato/flip/merges","archive_url":"https://api.github.com/repos/envato/flip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/envato/flip/downloads","issues_url":"https://api.github.com/repos/envato/flip/issues{/number}","pulls_url":"https://api.github.com/repos/envato/flip/pulls{/number}","milestones_url":"https://api.github.com/repos/envato/flip/milestones{/number}","notifications_url":"https://api.github.com/repos/envato/flip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/envato/flip/labels{/name}","releases_url":"https://api.github.com/repos/envato/flip/releases{/id}","created_at":"2013-07-16T00:49:53Z","updated_at":"2014-08-16T13:56:39Z","pushed_at":"2014-09-23T06:15:21Z","git_url":"git://github.com/envato/flip.git","ssh_url":"git@github.com:envato/flip.git","clone_url":"https://github.com/envato/flip.git","svn_url":"https://github.com/envato/flip","homepage":null,"size":637,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/envato/flip/pulls/1"},"html":{"href":"https://github.com/envato/flip/pull/1"},"issue":{"href":"https://api.github.com/repos/envato/flip/issues/1"},"comments":{"href":"https://api.github.com/repos/envato/flip/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/envato/flip/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/envato/flip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/envato/flip/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/envato/flip/statuses/a24f565ac75aba4e0acacc92dc4267daf34f4088"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":7,"review_comments":1,"commits":69,"additions":821,"deletions":98,"changed_files":38}}