Skip to content
Snippets Groups Projects
Commit 7d1b9f91 authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

Remove usage of `default_enabled:` from `Feature.` invocation

This removes all `default_enabled: :yaml | true | false`
parent 594af34a
No related branches found
No related tags found
No related merge requests found
Showing
with 28 additions and 29 deletions
Loading
Loading
@@ -5,7 +5,7 @@ class Admin::RunnersController < Admin::ApplicationController
 
before_action :runner, except: [:index, :tag_list, :runner_setup_scripts]
before_action only: [:index] do
push_frontend_feature_flag(:admin_runners_bulk_delete, default_enabled: :yaml)
push_frontend_feature_flag(:admin_runners_bulk_delete)
end
 
feature_category :runner
Loading
Loading
Loading
Loading
@@ -372,7 +372,7 @@ def check_impersonation_availability
end
 
def check_ban_user_feature_flag
access_denied! unless Feature.enabled?(:ban_user_feature_flag, default_enabled: :yaml)
access_denied! unless Feature.enabled?(:ban_user_feature_flag)
end
 
def log_impersonation_event
Loading
Loading
Loading
Loading
@@ -23,9 +23,9 @@ def prompt_for_two_factor(user)
 
session[:otp_user_id] = user.id
session[:user_password_hash] = Digest::SHA256.hexdigest(user.encrypted_password)
push_frontend_feature_flag(:webauthn, default_enabled: :yaml)
push_frontend_feature_flag(:webauthn)
 
if Feature.enabled?(:webauthn, default_enabled: :yaml)
if Feature.enabled?(:webauthn)
setup_webauthn_authentication(user)
else
setup_u2f_authentication(user)
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ def admin_mode_prompt_for_two_factor(user)
return handle_locked_user(user) unless user.can?(:log_in)
 
session[:otp_user_id] = user.id
push_frontend_feature_flag(:webauthn, default_enabled: :yaml)
push_frontend_feature_flag(:webauthn)
 
if user.two_factor_webauthn_enabled?
setup_webauthn_authentication(user)
Loading
Loading
Loading
Loading
@@ -184,7 +184,7 @@ def discussions
 
def paginated_discussions
return if params[:per_page].blank?
return unless issuable.instance_of?(Issue) && Feature.enabled?(:paginated_issue_discussions, project, default_enabled: :yaml)
return unless issuable.instance_of?(Issue) && Feature.enabled?(:paginated_issue_discussions, project)
 
strong_memoize(:paginated_discussions) do
issuable
Loading
Loading
Loading
Loading
@@ -20,7 +20,7 @@ def track_event(*controller_actions, name:, conditions: nil, destinations: [:red
def route_events_to(destinations, name, &block)
track_unique_redis_hll_event(name, &block) if destinations.include?(:redis_hll)
 
if destinations.include?(:snowplow) && Feature.enabled?(:route_hll_to_snowplow, tracking_namespace_source, default_enabled: :yaml)
if destinations.include?(:snowplow) && Feature.enabled?(:route_hll_to_snowplow, tracking_namespace_source)
Gitlab::Tracking.event(self.class.to_s, name, namespace: tracking_namespace_source, user: current_user)
end
end
Loading
Loading
Loading
Loading
@@ -71,6 +71,6 @@ def valid_image_scaling_width?
end
 
def scaling_allowed_by_feature_flags?(file_upload)
Feature.enabled?(:dynamic_image_resizing, default_enabled: true, type: :ops)
Feature.enabled?(:dynamic_image_resizing, type: :ops)
end
end
Loading
Loading
@@ -143,7 +143,7 @@ def embeddable?
end
 
def bypass_auth_checks_on_uploads?
if ::Feature.enabled?(:enforce_auth_checks_on_uploads, target_project, default_enabled: :yaml)
if ::Feature.enabled?(:enforce_auth_checks_on_uploads, target_project)
if target_project && !target_project.public? && target_project.enforce_auth_checks_on_uploads?
return false
end
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ module WikiActions
before_action :set_content_class
 
before_action do
push_frontend_feature_flag(:preserve_unchanged_markdown, @group, default_enabled: :yaml)
push_frontend_feature_flag(:preserve_unchanged_markdown, @group)
end
 
before_action only: [:show, :edit, :update] do
Loading
Loading
Loading
Loading
@@ -7,8 +7,8 @@ class Groups::BoardsController < Groups::ApplicationController
 
before_action :assign_endpoint_vars
before_action do
push_frontend_feature_flag(:board_multi_select, group, default_enabled: :yaml)
push_frontend_feature_flag(:realtime_labels, group, default_enabled: :yaml)
push_frontend_feature_flag(:board_multi_select, group)
push_frontend_feature_flag(:realtime_labels, group)
experiment(:prominent_create_board_btn, subject: current_user) do |e|
e.control { }
e.candidate { }
Loading
Loading
Loading
Loading
@@ -37,7 +37,7 @@ def authenticate_user_from_jwt_token!
private
 
def dependency_proxy_for_private_groups?
Feature.enabled?(:dependency_proxy_for_private_groups, default_enabled: true)
Feature.enabled?(:dependency_proxy_for_private_groups)
end
 
def request_bearer_token!
Loading
Loading
Loading
Loading
@@ -31,7 +31,7 @@ class GroupsController < Groups::ApplicationController
before_action :user_actions, only: [:show]
 
before_action do
push_frontend_feature_flag(:vue_issues_list, @group, default_enabled: :yaml)
push_frontend_feature_flag(:vue_issues_list, @group)
end
 
before_action :check_export_rate_limit!, only: [:export, :download_export]
Loading
Loading
@@ -211,7 +211,7 @@ def unfoldered_environment_names
end
 
def issues
return super if !html_request? || Feature.disabled?(:vue_issues_list, group, default_enabled: :yaml)
return super if !html_request? || Feature.disabled?(:vue_issues_list, group)
 
@has_issues = IssuesFinder.new(current_user, group_id: group.id, include_subgroups: true).execute
.non_archived
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ class IdeController < ApplicationController
before_action do
push_frontend_feature_flag(:build_service_proxy)
push_frontend_feature_flag(:schema_linting)
push_frontend_feature_flag(:reject_unsigned_commits_by_gitlab, default_enabled: :yaml)
push_frontend_feature_flag(:reject_unsigned_commits_by_gitlab)
define_index_vars
end
 
Loading
Loading
Loading
Loading
@@ -99,7 +99,7 @@ def bulk_import_params
end
 
def ensure_group_import_enabled
render_404 unless Feature.enabled?(:bulk_import, default_enabled: :yaml)
render_404 unless Feature.enabled?(:bulk_import)
end
 
def access_token_key
Loading
Loading
Loading
Loading
@@ -19,8 +19,8 @@ class JiraConnect::SubscriptionsController < JiraConnect::ApplicationController
end
 
before_action do
push_frontend_feature_flag(:jira_connect_oauth, @user, default_enabled: :yaml)
push_frontend_feature_flag(:jira_connect_oauth_self_managed, @user, default_enabled: :yaml)
push_frontend_feature_flag(:jira_connect_oauth, @user)
push_frontend_feature_flag(:jira_connect_oauth_self_managed, @user)
end
 
before_action :allow_rendering_in_iframe, only: :index
Loading
Loading
Loading
Loading
@@ -37,8 +37,7 @@ def pre_auth_params
 
# limit scopes when signing in with GitLab
def downgrade_scopes!
return unless Feature.enabled?(:omniauth_login_minimal_scopes, current_user,
default_enabled: :yaml)
return unless Feature.enabled?(:omniauth_login_minimal_scopes, current_user)
 
auth_type = params.delete('gl_auth_type')
return unless auth_type == 'login'
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
helper_method :current_password_required?
 
before_action do
push_frontend_feature_flag(:webauthn, default_enabled: :yaml)
push_frontend_feature_flag(:webauthn)
end
 
feature_category :authentication_and_authorization
Loading
Loading
@@ -35,7 +35,7 @@ def show
@qr_code = build_qr_code
@account_string = account_string
 
if Feature.enabled?(:webauthn, default_enabled: :yaml)
if Feature.enabled?(:webauthn)
setup_webauthn_registration
else
setup_u2f_registration
Loading
Loading
@@ -61,7 +61,7 @@ def create
@qr_code = build_qr_code
@account_string = account_string
 
if Feature.enabled?(:webauthn, default_enabled: :yaml)
if Feature.enabled?(:webauthn)
setup_webauthn_registration
else
setup_u2f_registration
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ class ProfilesController < Profiles::ApplicationController
end
skip_before_action :require_email, only: [:show, :update]
before_action do
push_frontend_feature_flag(:webauthn, default_enabled: :yaml)
push_frontend_feature_flag(:webauthn)
end
 
feature_category :users
Loading
Loading
Loading
Loading
@@ -42,8 +42,8 @@ class Projects::BlobController < Projects::ApplicationController
urgency :low, [:create, :show, :edit, :update, :diff]
 
before_action do
push_frontend_feature_flag(:refactor_blob_viewer, @project, default_enabled: :yaml)
push_frontend_feature_flag(:highlight_js, @project, default_enabled: :yaml)
push_frontend_feature_flag(:refactor_blob_viewer, @project)
push_frontend_feature_flag(:highlight_js, @project)
push_licensed_feature(:file_locks) if @project.licensed_feature_available?(:file_locks)
end
 
Loading
Loading
Loading
Loading
@@ -7,8 +7,8 @@ class Projects::BoardsController < Projects::ApplicationController
before_action :check_issues_available!
before_action :assign_endpoint_vars
before_action do
push_frontend_feature_flag(:board_multi_select, project, default_enabled: :yaml)
push_frontend_feature_flag(:realtime_labels, project&.group, default_enabled: :yaml)
push_frontend_feature_flag(:board_multi_select, project)
push_frontend_feature_flag(:realtime_labels, project&.group)
experiment(:prominent_create_board_btn, subject: current_user) do |e|
e.control { }
e.candidate { }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment