From 35f551c8e0bd7bdb88f1818202239bd31903406a Mon Sep 17 00:00:00 2001 From: Tyson Gach Date: Wed, 31 May 2017 14:19:41 -0400 Subject: [PATCH] Remove Split A/B testing framework We were running an experiment to test the text of the GitHub auth button. The results were very similar and we chose to stick with "Sign In with GitHub." Relevant discussion: https://thoughtbot.slack.com/archives/C02AJF2A0/p1496253165859654 --- .env | 1 - Gemfile | 1 - Gemfile.lock | 6 ----- app/controllers/sessions_controller.rb | 1 - app/views/application/_analytics.haml | 3 +-- app/views/application/_auth_button.haml | 2 +- config/experiments.yml | 5 ---- config/initializers/split.rb | 9 ------- config/routes.rb | 1 - spec/features/public_pages_spec.rb | 4 ++-- spec/requests/split_route_spec.rb | 24 ------------------- spec/support/helpers/authentication_helper.rb | 2 +- 12 files changed, 5 insertions(+), 54 deletions(-) delete mode 100644 config/experiments.yml delete mode 100644 config/initializers/split.rb delete mode 100644 spec/requests/split_route_spec.rb diff --git a/.env b/.env index 272fe3a62..9179f47c2 100644 --- a/.env +++ b/.env @@ -18,6 +18,5 @@ RESQUE_ADMIN_PASSWORD=password RESQUE_JOB_TIMEOUT=120 SECRET_KEY_BASE=some_really_really_long_super_secret_key_base SEGMENT_KEY=segment_key -SPLIT_ADMIN_PASSWORD=split_password STRIPE_API_KEY=sk_test_123 STRIPE_PUBLISHABLE_KEY=pk_test_123 diff --git a/Gemfile b/Gemfile index 821c99df6..e72dde2f3 100644 --- a/Gemfile +++ b/Gemfile @@ -35,7 +35,6 @@ gem "resque-sentry" gem "rest-client", ">= 1.8.0" gem "sass-rails" gem "sinatra", "2.0.0.beta2" -gem "split", require: "split/dashboard" gem "stripe" gem "thor", "0.19.1" gem "uglifier", ">= 2.7.2" diff --git a/Gemfile.lock b/Gemfile.lock index 38a0f5b32..21408f156 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -307,16 +307,11 @@ GEM faraday (>= 0.7.6, < 1.0) shoulda-matchers (2.6.2) activesupport (>= 3.0.0) - simple-random (1.0.3) sinatra (2.0.0.beta2) mustermann (= 1.0.0.beta2) rack (~> 2.0) rack-protection (= 2.0.0.beta2) tilt (~> 2.0) - split (2.2.0) - redis (>= 2.1) - simple-random (>= 0.9.3) - sinatra (>= 1.2.6) sprockets (3.7.1) concurrent-ruby (~> 1.0) rack (> 1, < 3) @@ -400,7 +395,6 @@ DEPENDENCIES sentry-raven (>= 0.12.2) shoulda-matchers sinatra (= 2.0.0.beta2) - split stripe thor (= 0.19.1) uglifier (>= 2.7.2) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 96492fe4d..4bea79f16 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -9,7 +9,6 @@ def create update_scopes end - ab_finished("auth_button") redirect_to repos_path end diff --git a/app/views/application/_analytics.haml b/app/views/application/_analytics.haml index 04572ae0e..29d9c7254 100644 --- a/app/views/application/_analytics.haml +++ b/app/views/application/_analytics.haml @@ -20,8 +20,7 @@ for (var i = 0; i < links.length; i++) { window.analytics.trackLink( links[i], - "Clicked Sign In", - { variation: "#{ab_test("auth_button")}" } + "Clicked Sign In" ); } diff --git a/app/views/application/_auth_button.haml b/app/views/application/_auth_button.haml index f80d338ee..27acfaea4 100644 --- a/app/views/application/_auth_button.haml +++ b/app/views/application/_auth_button.haml @@ -1,3 +1,3 @@ = link_to "/auth/github", class: "auth" do %i.fa.fa-github - %span= ab_test("auth_button") + = t("authenticate") diff --git a/config/experiments.yml b/config/experiments.yml deleted file mode 100644 index fa0641cec..000000000 --- a/config/experiments.yml +++ /dev/null @@ -1,5 +0,0 @@ -auth_button: - alternatives: - - "Sign In with GitHub" - - "Set Up Hound" - resettable: false diff --git a/config/initializers/split.rb b/config/initializers/split.rb deleted file mode 100644 index 1f0aab291..000000000 --- a/config/initializers/split.rb +++ /dev/null @@ -1,9 +0,0 @@ -Split.configure do |config| - config.experiments = YAML.load_file "config/experiments.yml" -end - -Split.redis = ENV.fetch("REDIS_URL") - -Split::Dashboard.use Rack::Auth::Basic do |username, password| - username == "admin" && password == ENV.fetch("SPLIT_ADMIN_PASSWORD") -end diff --git a/config/routes.rb b/config/routes.rb index d2d540a1d..8688e122d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,7 +10,6 @@ mount Resque::Server, at: "/queue" mount JasmineRails::Engine => "/specs" if defined?(JasmineRails) - mount Split::Dashboard, at: "split" get "/auth/github/callback", to: "sessions#create" get "/sign_out", to: "sessions#destroy" diff --git a/spec/features/public_pages_spec.rb b/spec/features/public_pages_spec.rb index ac39477ec..b3d71262f 100644 --- a/spec/features/public_pages_spec.rb +++ b/spec/features/public_pages_spec.rb @@ -3,14 +3,14 @@ feature "Public Pages" do context "When a user is not signed in" do scenario "displays the configuration page" do - visit "/configuration?SPLIT_DISABLE=true" + visit "/configuration" expect(page).to have_content("Configuration") expect(page).to have_content("Sign In with GitHub") end scenario "displays the configuration page with params and missing ?" do - visit "/configuration&utm_source=Intercom&SPLIT_DISABLE=true" + visit "/configuration&utm_source=Intercom" expect(page).to have_content("Configuration") expect(page).to have_content("Sign In with GitHub") diff --git a/spec/requests/split_route_spec.rb b/spec/requests/split_route_spec.rb deleted file mode 100644 index 814dac4ea..000000000 --- a/spec/requests/split_route_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require "rails_helper" - -describe "/split" do - context "without auth" do - it "does not allow access" do - get "/split" - - expect(response.status).to eq(401) - end - end - - context "with auth" do - it "allows access" do - credentials = ActionController::HttpAuthentication::Basic. - encode_credentials( - "admin", - ENV["SPLIT_ADMIN_PASSWORD"] - ) - get "/split", headers: { "HTTP_AUTHORIZATION" => credentials } - - expect(response.status).to eq(200) - end - end -end diff --git a/spec/support/helpers/authentication_helper.rb b/spec/support/helpers/authentication_helper.rb index 9c3cd9a1d..6aaa44029 100644 --- a/spec/support/helpers/authentication_helper.rb +++ b/spec/support/helpers/authentication_helper.rb @@ -6,7 +6,7 @@ def stub_sign_in(user) def sign_in_as(user, token = "letmein") stub_oauth(username: user.username, email: user.email, token: token) - visit root_path(SPLIT_DISABLE: "true") + visit root_path click_link(I18n.t('authenticate'), match: :first) end end