Commit bf233fa2 authored by Adam Hegyi's avatar Adam Hegyi

Eliminate analytics feature flag

This change eliminates the analytics feature flag (not used at all) and
ensures that the analytics workspace routes are accessible when at least
one analytics feature is turned on.
parent 27f7c92d
......@@ -117,7 +117,7 @@ Rails.application.routes.draw do
end
Gitlab.ee do
constraints(::Constraints::FeatureConstrainer.new(:analytics)) do
constraints(-> (*) { Gitlab::Analytics.any_features_enabled? }) do
draw :analytics
end
end
......
---
title: Eliminate analytics feature flag requirement for /analytics routes
merge_request: 16663
author:
type: fixed
......@@ -3,11 +3,11 @@
namespace :analytics do
root to: 'analytics#index'
constraints(::Constraints::FeatureConstrainer.new(:productivity_analytics)) do
constraints(::Constraints::FeatureConstrainer.new(Gitlab::Analytics::PRODUCTIVITY_ANALYTICS_FEATURE_FLAG)) do
resource :productivity_analytics, only: :show
end
constraints(::Constraints::FeatureConstrainer.new(:cycle_analytics)) do
constraints(::Constraints::FeatureConstrainer.new(Gitlab::Analytics::CYCLE_ANALYTICS_FEATURE_FLAG)) do
resource :cycle_analytics, only: :show
end
end
# frozen_string_literal: true
require 'spec_helper'
describe 'accessing the analytics workspace' do
include AnalyticsHelpers
let(:user) { create(:user) }
before do
sign_in(user)
end
it 'renders 404 if analytics features are turned off' do
disable_all_analytics_feature_flags
visit analytics_root_path
expect(page.status_code).to eq(404)
end
it 'renders the productivity analytics landing page' do
stub_licensed_features(Gitlab::Analytics::PRODUCTIVITY_ANALYTICS_FEATURE_FLAG => true)
visit analytics_root_path
expect(page.status_code).to eq(200)
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment