diff options
Diffstat (limited to 'app')
143 files changed, 423 insertions, 294 deletions
diff --git a/app/assets/javascripts/vue_shared/components/usage_quotas/usage_banner.vue b/app/assets/javascripts/vue_shared/components/usage_quotas/usage_banner.vue new file mode 100644 index 00000000000..bc5e0cf10dd --- /dev/null +++ b/app/assets/javascripts/vue_shared/components/usage_quotas/usage_banner.vue @@ -0,0 +1,68 @@ +<script> +import { GlSkeletonLoader } from '@gitlab/ui'; +import { helpPagePath } from '~/helpers/help_page_helper'; +import { s__ } from '~/locale'; + +export default { + name: 'UsageBanner', + components: { + GlSkeletonLoader, + }, + props: { + loading: { + type: Boolean, + required: false, + default: false, + }, + }, + i18n: { + dependencyProxy: s__('UsageQuota|Dependency proxy'), + storageUsed: s__('UsageQuota|Storage used'), + dependencyProxyMessage: s__( + 'UsageQuota|Local proxy used for frequently-accessed upstream Docker images. %{linkStart}More information%{linkEnd}', + ), + }, + storageUsageQuotaHelpPage: helpPagePath('user/usage_quotas'), +}; +</script> +<template> + <div class="gl-display-flex gl-flex-direction-column"> + <div class="gl-display-flex gl-align-items-center gl-py-3"> + <div + class="gl-display-flex gl-xs-flex-direction-column gl-justify-content-space-between gl-align-items-stretch gl-flex-grow-1" + > + <div class="gl-display-flex gl-flex-direction-column gl-xs-mb-3 gl-min-w-0 gl-flex-grow-1"> + <div + v-if="$slots['left-primary-text']" + class="gl-display-flex gl-align-items-center gl-text-body gl-font-weight-bold gl-min-h-6 gl-min-w-0 gl-mb-4" + > + <slot name="left-primary-text"></slot> + </div> + <div + v-if="$slots['left-secondary-text']" + class="gl-display-flex gl-align-items-center gl-text-gray-500 gl-min-h-6 gl-min-w-0 gl-flex-grow-1 gl-w-70p gl-md-max-w-70p" + > + <slot name="left-secondary-text"></slot> + </div> + </div> + <div + class="gl-display-flex gl-flex-direction-column gl-sm-align-items-flex-end gl-justify-content-space-between gl-text-gray-500 gl-flex-shrink-0" + > + <div + v-if="$slots['right-primary-text']" + class="gl-display-flex gl-align-items-center gl-sm-text-body gl-sm-font-weight-bold gl-min-h-6" + > + <slot name="right-primary-text"></slot> + </div> + <div + v-if="$slots['right-secondary-text']" + class="gl-display-flex gl-align-items-center gl-min-h-6" + > + <slot v-if="!loading" name="right-secondary-text"></slot> + <gl-skeleton-loader v-else :width="60" :lines="1" /> + </div> + </div> + </div> + </div> + </div> +</template> diff --git a/app/controllers/admin/runners_controller.rb b/app/controllers/admin/runners_controller.rb index 4a3139066f1..02e33baaf07 100644 --- a/app/controllers/admin/runners_controller.rb +++ b/app/controllers/admin/runners_controller.rb @@ -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 diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index f19333d5d57..6b11b8eda5c 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -372,7 +372,7 @@ class Admin::UsersController < Admin::ApplicationController 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 diff --git a/app/controllers/concerns/authenticates_with_two_factor.rb b/app/controllers/concerns/authenticates_with_two_factor.rb index 14dcec33545..4228a93d310 100644 --- a/app/controllers/concerns/authenticates_with_two_factor.rb +++ b/app/controllers/concerns/authenticates_with_two_factor.rb @@ -23,9 +23,9 @@ module AuthenticatesWithTwoFactor 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) diff --git a/app/controllers/concerns/authenticates_with_two_factor_for_admin_mode.rb b/app/controllers/concerns/authenticates_with_two_factor_for_admin_mode.rb index 05be04059fd..574fc6c0f37 100644 --- a/app/controllers/concerns/authenticates_with_two_factor_for_admin_mode.rb +++ b/app/controllers/concerns/authenticates_with_two_factor_for_admin_mode.rb @@ -11,7 +11,7 @@ module AuthenticatesWithTwoFactorForAdminMode 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) diff --git a/app/controllers/concerns/issuable_actions.rb b/app/controllers/concerns/issuable_actions.rb index ae90bd59d01..4d3eb9cd183 100644 --- a/app/controllers/concerns/issuable_actions.rb +++ b/app/controllers/concerns/issuable_actions.rb @@ -184,7 +184,7 @@ module IssuableActions 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 diff --git a/app/controllers/concerns/product_analytics_tracking.rb b/app/controllers/concerns/product_analytics_tracking.rb index 03296d6b233..4021ff83578 100644 --- a/app/controllers/concerns/product_analytics_tracking.rb +++ b/app/controllers/concerns/product_analytics_tracking.rb @@ -20,7 +20,7 @@ module ProductAnalyticsTracking 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 diff --git a/app/controllers/concerns/send_file_upload.rb b/app/controllers/concerns/send_file_upload.rb index 8b053ef7c59..c8369c465b8 100644 --- a/app/controllers/concerns/send_file_upload.rb +++ b/app/controllers/concerns/send_file_upload.rb @@ -71,6 +71,6 @@ module SendFileUpload 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 diff --git a/app/controllers/concerns/uploads_actions.rb b/app/controllers/concerns/uploads_actions.rb index eaa945b0312..f914e804e18 100644 --- a/app/controllers/concerns/uploads_actions.rb +++ b/app/controllers/concerns/uploads_actions.rb @@ -143,7 +143,7 @@ module UploadsActions 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 diff --git a/app/controllers/concerns/wiki_actions.rb b/app/controllers/concerns/wiki_actions.rb index 5fd1b47da1b..9fc8886aaee 100644 --- a/app/controllers/concerns/wiki_actions.rb +++ b/app/controllers/concerns/wiki_actions.rb @@ -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 diff --git a/app/controllers/graphql_controller.rb b/app/controllers/graphql_controller.rb index b00d85b6b0f..a58cae0ec11 100644 --- a/app/controllers/graphql_controller.rb +++ b/app/controllers/graphql_controller.rb @@ -64,7 +64,7 @@ class GraphqlController < ApplicationController log_exception(exception) if Rails.env.test? || Rails.env.development? - render_error("Internal server error: #{exception.message}") + render_error("Internal server error: #{exception.message}", raised_at: exception.backtrace.first) else render_error("Internal server error") end @@ -207,8 +207,9 @@ class GraphqlController < ApplicationController render_error("Not found!", status: :not_found) end - def render_error(message, status: 500) + def render_error(message, status: 500, raised_at: nil) error = { errors: [message: message] } + error[:errors].first['raisedAt'] = raised_at if raised_at render json: error, status: status end diff --git a/app/controllers/groups/boards_controller.rb b/app/controllers/groups/boards_controller.rb index c65232c0fea..39edf672252 100644 --- a/app/controllers/groups/boards_controller.rb +++ b/app/controllers/groups/boards_controller.rb @@ -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 { } diff --git a/app/controllers/groups/dependency_proxy/application_controller.rb b/app/controllers/groups/dependency_proxy/application_controller.rb index 18a6ff93e15..841e637e4c4 100644 --- a/app/controllers/groups/dependency_proxy/application_controller.rb +++ b/app/controllers/groups/dependency_proxy/application_controller.rb @@ -37,7 +37,7 @@ module Groups 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! diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index c5a7b88437c..bc2dcec625b 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -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] @@ -211,7 +211,7 @@ class GroupsController < Groups::ApplicationController 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 diff --git a/app/controllers/ide_controller.rb b/app/controllers/ide_controller.rb index 9494a686467..2bcbf88039b 100644 --- a/app/controllers/ide_controller.rb +++ b/app/controllers/ide_controller.rb @@ -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 diff --git a/app/controllers/import/bulk_imports_controller.rb b/app/controllers/import/bulk_imports_controller.rb index 1df549fecf2..34f12aebb91 100644 --- a/app/controllers/import/bulk_imports_controller.rb +++ b/app/controllers/import/bulk_imports_controller.rb @@ -99,7 +99,7 @@ class Import::BulkImportsController < ApplicationController 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 diff --git a/app/controllers/jira_connect/subscriptions_controller.rb b/app/controllers/jira_connect/subscriptions_controller.rb index 4e83e0c44ec..2ba9f8264e1 100644 --- a/app/controllers/jira_connect/subscriptions_controller.rb +++ b/app/controllers/jira_connect/subscriptions_controller.rb @@ -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 diff --git a/app/controllers/oauth/authorizations_controller.rb b/app/controllers/oauth/authorizations_controller.rb index d1c409d071e..e714cbb5b70 100644 --- a/app/controllers/oauth/authorizations_controller.rb +++ b/app/controllers/oauth/authorizations_controller.rb @@ -37,8 +37,7 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController # 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' diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb index 48b0d313d3c..b1fa0502193 100644 --- a/app/controllers/profiles/two_factor_auths_controller.rb +++ b/app/controllers/profiles/two_factor_auths_controller.rb @@ -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 @@ -35,7 +35,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController @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 @@ -61,7 +61,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController @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 diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index 9c01aba6631..d5e7195a157 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -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 diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 26a7b5662be..a9561fb9312 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -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 diff --git a/app/controllers/projects/boards_controller.rb b/app/controllers/projects/boards_controller.rb index 7a30e68d9a2..1ed18401bc5 100644 --- a/app/controllers/projects/boards_controller.rb +++ b/app/controllers/projects/boards_controller.rb @@ -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 { } diff --git a/app/controllers/projects/ci/pipeline_editor_controller.rb b/app/controllers/projects/ci/pipeline_editor_controller.rb index fdcae23a440..dbf3b2051fb 100644 --- a/app/controllers/projects/ci/pipeline_editor_controller.rb +++ b/app/controllers/projects/ci/pipeline_editor_controller.rb @@ -3,8 +3,8 @@ class Projects::Ci::PipelineEditorController < Projects::ApplicationController before_action :check_can_collaborate! before_action do - push_frontend_feature_flag(:schema_linting, @project, default_enabled: :yaml) - push_frontend_feature_flag(:pipeline_editor_file_tree, @project, default_enabled: :yaml) + push_frontend_feature_flag(:schema_linting, @project) + push_frontend_feature_flag(:pipeline_editor_file_tree, @project) end feature_category :pipeline_authoring diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb index 440375bf3c9..30d001d0ac5 100644 --- a/app/controllers/projects/clusters_controller.rb +++ b/app/controllers/projects/clusters_controller.rb @@ -6,7 +6,7 @@ class Projects::ClustersController < Clusters::ClustersController before_action do push_frontend_feature_flag(:prometheus_computed_alerts) - push_frontend_feature_flag(:show_gitlab_agent_feedback, type: :ops, default_enabled: :yaml) + push_frontend_feature_flag(:show_gitlab_agent_feedback, type: :ops) end layout 'project' diff --git a/app/controllers/projects/incidents_controller.rb b/app/controllers/projects/incidents_controller.rb index cce1317d220..fd7ba7b5460 100644 --- a/app/controllers/projects/incidents_controller.rb +++ b/app/controllers/projects/incidents_controller.rb @@ -7,8 +7,8 @@ class Projects::IncidentsController < Projects::ApplicationController before_action :authorize_read_issue! before_action :load_incident, only: [:show] before_action do - push_frontend_feature_flag(:incident_escalations, @project, default_enabled: :yaml) - push_frontend_feature_flag(:incident_timeline, @project, default_enabled: :yaml) + push_frontend_feature_flag(:incident_escalations, @project) + push_frontend_feature_flag(:incident_timeline, @project) end feature_category :incident_management diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 7084c91c6cb..4e1a45db697 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -39,16 +39,16 @@ class Projects::IssuesController < Projects::ApplicationController before_action :authorize_download_code!, only: [:related_branches] before_action do - push_frontend_feature_flag(:vue_issues_list, project&.group, default_enabled: :yaml) - push_frontend_feature_flag(:contacts_autocomplete, project&.group, default_enabled: :yaml) - push_frontend_feature_flag(:incident_timeline, project, default_enabled: :yaml) + push_frontend_feature_flag(:vue_issues_list, project&.group) + push_frontend_feature_flag(:contacts_autocomplete, project&.group) + push_frontend_feature_flag(:incident_timeline, project) end before_action only: :show do - push_frontend_feature_flag(:confidential_notes, project&.group, default_enabled: :yaml) - push_frontend_feature_flag(:issue_assignees_widget, project, default_enabled: :yaml) - push_frontend_feature_flag(:paginated_issue_discussions, project, default_enabled: :yaml) - push_frontend_feature_flag(:realtime_labels, project, default_enabled: :yaml) + push_frontend_feature_flag(:confidential_notes, project&.group) + push_frontend_feature_flag(:issue_assignees_widget, project) + push_frontend_feature_flag(:paginated_issue_discussions, project) + push_frontend_feature_flag(:realtime_labels, project) push_force_frontend_feature_flag(:work_items, project&.work_items_feature_flag_enabled?) end @@ -253,7 +253,7 @@ class Projects::IssuesController < Projects::ApplicationController def vue_issues_list? action_name.to_sym == :index && html_request? && - Feature.enabled?(:vue_issues_list, project&.group, default_enabled: :yaml) + Feature.enabled?(:vue_issues_list, project&.group) end def sorting_field diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb index c61a7be860c..8ea3d2d697d 100644 --- a/app/controllers/projects/jobs_controller.rb +++ b/app/controllers/projects/jobs_controller.rb @@ -21,8 +21,8 @@ class Projects::JobsController < Projects::ApplicationController before_action :push_jobs_table_vue_search, only: [:index] before_action do - push_frontend_feature_flag(:infinitely_collapsible_sections, @project, default_enabled: :yaml) - push_frontend_feature_flag(:trigger_job_retry_action, @project, default_enabled: :yaml) + push_frontend_feature_flag(:infinitely_collapsible_sections, @project) + push_frontend_feature_flag(:trigger_job_retry_action, @project) end layout 'project' @@ -262,10 +262,10 @@ class Projects::JobsController < Projects::ApplicationController end def push_jobs_table_vue - push_frontend_feature_flag(:jobs_table_vue, @project, default_enabled: :yaml) + push_frontend_feature_flag(:jobs_table_vue, @project) end def push_jobs_table_vue_search - push_frontend_feature_flag(:jobs_table_vue_search, @project, default_enabled: :yaml) + push_frontend_feature_flag(:jobs_table_vue_search, @project) end end diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index 6e46135dd8f..9323f820ba5 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -33,22 +33,22 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo before_action only: [:show] do push_frontend_feature_flag(:file_identifier_hash) - push_frontend_feature_flag(:merge_request_widget_graphql, project, default_enabled: :yaml) + push_frontend_feature_flag(:merge_request_widget_graphql, project) push_frontend_feature_flag(:core_security_mr_widget_counts, project) - push_frontend_feature_flag(:paginated_notes, project, default_enabled: :yaml) - push_frontend_feature_flag(:confidential_notes, project, default_enabled: :yaml) - push_frontend_feature_flag(:restructured_mr_widget, project, default_enabled: :yaml) - push_frontend_feature_flag(:refactor_mr_widgets_extensions, project, default_enabled: :yaml) - push_frontend_feature_flag(:refactor_mr_widget_test_summary, project, default_enabled: :yaml) - push_frontend_feature_flag(:rebase_without_ci_ui, project, default_enabled: :yaml) - push_frontend_feature_flag(:issue_assignees_widget, @project, default_enabled: :yaml) - push_frontend_feature_flag(:realtime_labels, project, default_enabled: :yaml) - push_frontend_feature_flag(:updated_diff_expansion_buttons, project, default_enabled: :yaml) - push_frontend_feature_flag(:mr_attention_requests, current_user, default_enabled: :yaml) + push_frontend_feature_flag(:paginated_notes, project) + push_frontend_feature_flag(:confidential_notes, project) + push_frontend_feature_flag(:restructured_mr_widget, project) + push_frontend_feature_flag(:refactor_mr_widgets_extensions, project) + push_frontend_feature_flag(:refactor_mr_widget_test_summary, project) + push_frontend_feature_flag(:rebase_without_ci_ui, project) + push_frontend_feature_flag(:issue_assignees_widget, @project) + push_frontend_feature_flag(:realtime_labels, project) + push_frontend_feature_flag(:updated_diff_expansion_buttons, project) + push_frontend_feature_flag(:mr_attention_requests, current_user) end before_action do - push_frontend_feature_flag(:permit_all_shared_groups_for_approval, @project, default_enabled: :yaml) + push_frontend_feature_flag(:permit_all_shared_groups_for_approval, @project) end around_action :allow_gitaly_ref_name_caching, only: [:index, :show, :discussions] diff --git a/app/controllers/projects/pipelines/tests_controller.rb b/app/controllers/projects/pipelines/tests_controller.rb index 4daf700a8bd..8f0e20290fe 100644 --- a/app/controllers/projects/pipelines/tests_controller.rb +++ b/app/controllers/projects/pipelines/tests_controller.rb @@ -23,7 +23,7 @@ module Projects def show respond_to do |format| format.json do - if Feature.enabled?(:ci_test_report_artifacts_expired, project, default_enabled: :yaml) && pipeline.has_expired_test_reports? + if Feature.enabled?(:ci_test_report_artifacts_expired, project) && pipeline.has_expired_test_reports? render json: { errors: 'Test report artifacts have expired' }, status: :not_found else render json: TestSuiteSerializer diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index a958f10e778..94865024688 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -21,9 +21,9 @@ class Projects::PipelinesController < Projects::ApplicationController before_action :ensure_pipeline, only: [:show, :downloadable_artifacts] before_action do - push_frontend_feature_flag(:pipeline_tabs_vue, @project, default_enabled: :yaml) - push_frontend_feature_flag(:downstream_retry_action, @project, default_enabled: :yaml) - push_frontend_feature_flag(:failed_jobs_tab_vue, @project, default_enabled: :yaml) + push_frontend_feature_flag(:pipeline_tabs_vue, @project) + push_frontend_feature_flag(:downstream_retry_action, @project) + push_frontend_feature_flag(:failed_jobs_tab_vue, @project) end # Will be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/225596 @@ -149,7 +149,7 @@ class Projects::PipelinesController < Projects::ApplicationController end def builds - if Feature.enabled?(:pipeline_tabs_vue, project, default_enabled: :yaml) + if Feature.enabled?(:pipeline_tabs_vue, project) redirect_to pipeline_path(@pipeline, tab: 'builds') else render_show @@ -159,7 +159,7 @@ class Projects::PipelinesController < Projects::ApplicationController def dag respond_to do |format| format.html do - if Feature.enabled?(:pipeline_tabs_vue, project, default_enabled: :yaml) + if Feature.enabled?(:pipeline_tabs_vue, project) redirect_to pipeline_path(@pipeline, tab: 'dag') else render_show @@ -174,7 +174,7 @@ class Projects::PipelinesController < Projects::ApplicationController end def failures - if Feature.enabled?(:pipeline_tabs_vue, project, default_enabled: :yaml) + if Feature.enabled?(:pipeline_tabs_vue, project) redirect_to pipeline_path(@pipeline, tab: 'failures') elsif @pipeline.failed_builds.present? render_show @@ -231,7 +231,7 @@ class Projects::PipelinesController < Projects::ApplicationController def test_report respond_to do |format| format.html do - if Feature.enabled?(:pipeline_tabs_vue, project, default_enabled: :yaml) + if Feature.enabled?(:pipeline_tabs_vue, project) redirect_to pipeline_path(@pipeline, tab: 'test_report') else render_show diff --git a/app/controllers/projects/product_analytics_controller.rb b/app/controllers/projects/product_analytics_controller.rb index 5db7585d8e0..c89cd52530a 100644 --- a/app/controllers/projects/product_analytics_controller.rb +++ b/app/controllers/projects/product_analytics_controller.rb @@ -54,6 +54,6 @@ class Projects::ProductAnalyticsController < Projects::ApplicationController end def feature_enabled! - render_404 unless Feature.enabled?(:product_analytics, @project, default_enabled: false) + render_404 unless Feature.enabled?(:product_analytics, @project) end end diff --git a/app/controllers/projects/security/configuration_controller.rb b/app/controllers/projects/security/configuration_controller.rb index cdb02047215..00a2a5d1193 100644 --- a/app/controllers/projects/security/configuration_controller.rb +++ b/app/controllers/projects/security/configuration_controller.rb @@ -42,7 +42,7 @@ module Projects end def unify_configuration_enabled? - Feature.enabled?(:unify_security_configuration, project, default_enabled: :yaml) + Feature.enabled?(:unify_security_configuration, project) end end end diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index a70795f2065..ed14f66847c 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -17,9 +17,9 @@ class Projects::TreeController < Projects::ApplicationController before_action :authorize_edit_tree!, only: [:create_dir] before_action do - push_frontend_feature_flag(:lazy_load_commits, @project, default_enabled: :yaml) - 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(:lazy_load_commits, @project) + 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 diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index cce02d493f0..dfb9ef54f7c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -35,10 +35,10 @@ class ProjectsController < Projects::ApplicationController before_action :check_export_rate_limit!, only: [:export, :download_export, :generate_new_export] before_action do - push_frontend_feature_flag(:lazy_load_commits, @project, default_enabled: :yaml) - 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(:increase_page_size_exponentially, @project, default_enabled: :yaml) + push_frontend_feature_flag(:lazy_load_commits, @project) + push_frontend_feature_flag(:refactor_blob_viewer, @project) + push_frontend_feature_flag(:highlight_js, @project) + push_frontend_feature_flag(:increase_page_size_exponentially, @project) push_licensed_feature(:file_locks) if @project.present? && @project.licensed_feature_available?(:file_locks) push_licensed_feature(:security_orchestration_policies) if @project.present? && @project.licensed_feature_available?(:security_orchestration_policies) push_force_frontend_feature_flag(:work_items, @project&.work_items_feature_flag_enabled?) diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index e938902852d..aab901c1008 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -168,17 +168,17 @@ class SearchController < ApplicationController search_allowed = case params[:scope] when 'blobs' - Feature.enabled?(:global_search_code_tab, current_user, type: :ops, default_enabled: :yaml) + Feature.enabled?(:global_search_code_tab, current_user, type: :ops) when 'commits' - Feature.enabled?(:global_search_commits_tab, current_user, type: :ops, default_enabled: :yaml) + Feature.enabled?(:global_search_commits_tab, current_user, type: :ops) when 'issues' - Feature.enabled?(:global_search_issues_tab, current_user, type: :ops, default_enabled: :yaml) + Feature.enabled?(:global_search_issues_tab, current_user, type: :ops) when 'merge_requests' - Feature.enabled?(:global_search_merge_requests_tab, current_user, type: :ops, default_enabled: :yaml) + Feature.enabled?(:global_search_merge_requests_tab, current_user, type: :ops) when 'wiki_blobs' - Feature.enabled?(:global_search_wiki_tab, current_user, type: :ops, default_enabled: :yaml) + Feature.enabled?(:global_search_wiki_tab, current_user, type: :ops) when 'users' - Feature.enabled?(:global_search_users_tab, current_user, type: :ops, default_enabled: :yaml) + Feature.enabled?(:global_search_users_tab, current_user, type: :ops) else true end diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 51c23e5a000..57444bf9890 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -33,7 +33,7 @@ class SessionsController < Devise::SessionsController before_action :load_recaptcha before_action :set_invite_params, only: [:new] before_action do - push_frontend_feature_flag(:webauthn, default_enabled: :yaml) + push_frontend_feature_flag(:webauthn) end after_action :log_failed_login, if: :action_new_and_failed_login? @@ -307,9 +307,9 @@ class SessionsController < Devise::SessionsController def authentication_method if user_params[:otp_attempt] AuthenticationEvent::TWO_FACTOR - elsif user_params[:device_response] && Feature.enabled?(:webauthn, default_enabled: :yaml) + elsif user_params[:device_response] && Feature.enabled?(:webauthn) AuthenticationEvent::TWO_FACTOR_WEBAUTHN - elsif user_params[:device_response] && !Feature.enabled?(:webauthn, default_enabled: :yaml) + elsif user_params[:device_response] && !Feature.enabled?(:webauthn) AuthenticationEvent::TWO_FACTOR_U2F else AuthenticationEvent::STANDARD diff --git a/app/finders/group_descendants_finder.rb b/app/finders/group_descendants_finder.rb index 40d6be03a17..42cd06c8066 100644 --- a/app/finders/group_descendants_finder.rb +++ b/app/finders/group_descendants_finder.rb @@ -112,7 +112,7 @@ class GroupDescendantsFinder group_ids = base_for_ancestors.except(:select, :sort).select(:id) groups = Group.where(id: group_ids) - if Feature.enabled?(:linear_group_descendants_finder_upto, current_user, default_enabled: :yaml) + if Feature.enabled?(:linear_group_descendants_finder_upto, current_user) groups.self_and_ancestors(upto: parent_group.id) else Gitlab::ObjectHierarchy.new(groups).base_and_ancestors(upto: parent_group.id) diff --git a/app/finders/groups_finder.rb b/app/finders/groups_finder.rb index 7cb3e7a5d7f..9a8bc74f435 100644 --- a/app/finders/groups_finder.rb +++ b/app/finders/groups_finder.rb @@ -54,7 +54,7 @@ class GroupsFinder < UnionFinder groups = [] if current_user - if Feature.enabled?(:use_traversal_ids_groups_finder, current_user, default_enabled: :yaml) + if Feature.enabled?(:use_traversal_ids_groups_finder, current_user) groups << current_user.authorized_groups.self_and_ancestors groups << current_user.groups.self_and_descendants else @@ -81,7 +81,7 @@ class GroupsFinder < UnionFinder .groups .where('members.access_level >= ?', params[:min_access_level]) - if Feature.enabled?(:use_traversal_ids_groups_finder, current_user, default_enabled: :yaml) + if Feature.enabled?(:use_traversal_ids_groups_finder, current_user) groups.self_and_descendants else Gitlab::ObjectHierarchy diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index bf7b2265ded..fe07a52cbf0 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -348,7 +348,7 @@ class IssuableFinder params[:in].blank? && klass.try(:pg_full_text_searchable_columns).present? && params[:search] =~ FULL_TEXT_SEARCH_TERM_REGEX && - Feature.enabled?(:issues_full_text_search, params.project || params.group, default_enabled: :yaml) + Feature.enabled?(:issues_full_text_search, params.project || params.group) end # rubocop: disable CodeReuse/ActiveRecord @@ -489,7 +489,7 @@ class IssuableFinder def or_filters_enabled? strong_memoize(:or_filters_enabled) do - Feature.enabled?(:or_issuable_queries, feature_flag_scope, default_enabled: :yaml) + Feature.enabled?(:or_issuable_queries, feature_flag_scope) end end diff --git a/app/finders/user_recent_events_finder.rb b/app/finders/user_recent_events_finder.rb index 2cdf7819d23..64903c67573 100644 --- a/app/finders/user_recent_events_finder.rb +++ b/app/finders/user_recent_events_finder.rb @@ -73,7 +73,7 @@ class UserRecentEventsFinder return Event.none if users.empty? - if Feature.enabled?(:optimized_followed_users_queries, current_user, default_enabled: :yaml) + if Feature.enabled?(:optimized_followed_users_queries, current_user) query_builder_params = event_filter.in_operator_query_builder_params(users) Gitlab::Pagination::Keyset::InOperatorOptimization::QueryBuilder diff --git a/app/graphql/mutations/issues/set_crm_contacts.rb b/app/graphql/mutations/issues/set_crm_contacts.rb index 62990fc67f1..4df65e4769c 100644 --- a/app/graphql/mutations/issues/set_crm_contacts.rb +++ b/app/graphql/mutations/issues/set_crm_contacts.rb @@ -48,7 +48,7 @@ module Mutations private def feature_enabled?(project) - Feature.enabled?(:customer_relations, project.group, default_enabled: :yaml) && project.group&.crm_enabled? + Feature.enabled?(:customer_relations, project.group) && project.group&.crm_enabled? end end end diff --git a/app/graphql/mutations/saved_replies/base.rb b/app/graphql/mutations/saved_replies/base.rb index 59871df687f..d7256119d2b 100644 --- a/app/graphql/mutations/saved_replies/base.rb +++ b/app/graphql/mutations/saved_replies/base.rb @@ -24,7 +24,7 @@ module Mutations end def feature_enabled? - Feature.enabled?(:saved_replies, current_user, default_enabled: :yaml) + Feature.enabled?(:saved_replies, current_user) end def find_object(id) diff --git a/app/graphql/mutations/user_preferences/update.rb b/app/graphql/mutations/user_preferences/update.rb index eface536a87..b71c952b0f2 100644 --- a/app/graphql/mutations/user_preferences/update.rb +++ b/app/graphql/mutations/user_preferences/update.rb @@ -38,7 +38,7 @@ module Mutations def disabled_sort_value?(args) return false unless [:escalation_status_asc, :escalation_status_desc].include?(args[:issues_sort]) - Feature.disabled?(:incident_escalations, default_enabled: :yaml) + Feature.disabled?(:incident_escalations) end end end diff --git a/app/graphql/resolvers/base_issues_resolver.rb b/app/graphql/resolvers/base_issues_resolver.rb index 4cae7866a49..a1fda976876 100644 --- a/app/graphql/resolvers/base_issues_resolver.rb +++ b/app/graphql/resolvers/base_issues_resolver.rb @@ -35,7 +35,7 @@ module Resolvers def prepare_params(args, parent) return unless [:escalation_status_asc, :escalation_status_desc].include?(args[:sort]) - return if Feature.enabled?(:incident_escalations, parent, default_enabled: :yaml) + return if Feature.enabled?(:incident_escalations, parent) args[:sort] = :created_desc # default for sort argument end diff --git a/app/graphql/resolvers/package_pipelines_resolver.rb b/app/graphql/resolvers/package_pipelines_resolver.rb index e087ce735a1..55e8d1b3d36 100644 --- a/app/graphql/resolvers/package_pipelines_resolver.rb +++ b/app/graphql/resolvers/package_pipelines_resolver.rb @@ -40,7 +40,7 @@ module Resolvers # TODO remove when cleaning up packages_graphql_pipelines_resolver # https://gitlab.com/gitlab-org/gitlab/-/issues/358432 def detect_mode - return :new_finder if Feature.enabled?(:packages_graphql_pipelines_resolver, default_enabled: :yaml) + return :new_finder if Feature.enabled?(:packages_graphql_pipelines_resolver) return :object_field if context[:packages_access_level] == :group || context[:packages_access_level] == :project :old_finder diff --git a/app/graphql/types/base_field.rb b/app/graphql/types/base_field.rb index 75909592c6c..b4cd54b1332 100644 --- a/app/graphql/types/base_field.rb +++ b/app/graphql/types/base_field.rb @@ -68,7 +68,7 @@ module Types end def visible?(context) - return false if feature_flag.present? && !Feature.enabled?(feature_flag, default_enabled: :yaml) + return false if feature_flag.present? && !Feature.enabled?(feature_flag) super end diff --git a/app/graphql/types/issue_type.rb b/app/graphql/types/issue_type.rb index 07450c38616..c83200bd614 100644 --- a/app/graphql/types/issue_type.rb +++ b/app/graphql/types/issue_type.rb @@ -170,7 +170,7 @@ module Types end def hidden? - object.hidden? if Feature.enabled?(:ban_user_feature_flag, default_enabled: :yaml) + object.hidden? if Feature.enabled?(:ban_user_feature_flag) end def escalation_status diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index feeedb0a501..8cdfc267693 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -21,7 +21,7 @@ module ApplicationHelper def dispensable_render(...) render(...) rescue StandardError => error - if Feature.enabled?(:dispensable_render, default_enabled: :yaml) + if Feature.enabled?(:dispensable_render) Gitlab::ErrorTracking.track_and_raise_for_dev_exception(error) nil else @@ -32,7 +32,7 @@ module ApplicationHelper def dispensable_render_if_exists(...) render_if_exists(...) rescue StandardError => error - if Feature.enabled?(:dispensable_render, default_enabled: :yaml) + if Feature.enabled?(:dispensable_render) Gitlab::ErrorTracking.track_and_raise_for_dev_exception(error) nil else diff --git a/app/helpers/broadcast_messages_helper.rb b/app/helpers/broadcast_messages_helper.rb index b138e9aeb0c..10cfa97030d 100644 --- a/app/helpers/broadcast_messages_helper.rb +++ b/app/helpers/broadcast_messages_helper.rb @@ -73,7 +73,7 @@ module BroadcastMessagesHelper private def current_user_access_level_for_project_or_group - return if Feature.disabled?(:role_targeted_broadcast_messages, default_enabled: :yaml) + return if Feature.disabled?(:role_targeted_broadcast_messages) return unless current_user.present? strong_memoize(:current_user_access_level_for_project_or_group) do diff --git a/app/helpers/groups/group_members_helper.rb b/app/helpers/groups/group_members_helper.rb index 80ab303357b..ca61c4da41c 100644 --- a/app/helpers/groups/group_members_helper.rb +++ b/app/helpers/groups/group_members_helper.rb @@ -53,7 +53,7 @@ module Groups::GroupMembersHelper end def group_group_links_list_data(group, include_relations, search) - if ::Feature.enabled?(:group_member_inherited_group, group, default_enabled: :yaml) + if ::Feature.enabled?(:group_member_inherited_group, group) group_links = group_group_links(group, include_relations) group_links = group_links.search(search) if search else diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index c8c9ea32184..6d17c8b5b42 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -63,7 +63,7 @@ module IssuesHelper end def issue_hidden?(issue) - Feature.enabled?(:ban_user_feature_flag, default_enabled: :yaml) && issue.hidden? + Feature.enabled?(:ban_user_feature_flag) && issue.hidden? end def hidden_issue_icon(issue) diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb index 576b85fdeb1..f70afcc5791 100644 --- a/app/helpers/merge_requests_helper.rb +++ b/app/helpers/merge_requests_helper.rb @@ -211,6 +211,7 @@ module MergeRequestsHelper is_fork: merge_request.for_fork?.to_s, can_merge: merge_request.can_be_merged_by?(current_user).to_s, source_branch: merge_request.source_branch, + source_project_path: merge_request.source_project&.path, source_project_full_path: merge_request.source_project&.full_path, source_project_default_url: merge_request.source_project && default_url_to_repo(merge_request.source_project), target_branch: merge_request.target_branch, diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 64254956e49..c3f22dc7693 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -379,7 +379,7 @@ module ProjectsHelper end def show_terraform_banner?(project) - Feature.enabled?(:show_terraform_banner, type: :ops, default_enabled: true) && project.repository_languages.with_programming_language('HCL').exists? && project.terraform_states.empty? + Feature.enabled?(:show_terraform_banner, type: :ops) && project.repository_languages.with_programming_language('HCL').exists? && project.terraform_states.empty? end def project_permissions_panel_data(project) diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index bed74b938bd..0bbaca85ca8 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -443,7 +443,7 @@ module SearchHelper return false unless can?(current_user, :read_users_list) return true if @group - Feature.enabled?(:global_search_users_tab, current_user, type: :ops, default_enabled: :yaml) + Feature.enabled?(:global_search_users_tab, current_user, type: :ops) end def issuable_state_to_badge_class(issuable) diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 1247f9ae260..fd460d71867 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -125,7 +125,7 @@ module UsersHelper end def ban_feature_available? - Feature.enabled?(:ban_user_feature_flag, default_enabled: :yaml) + Feature.enabled?(:ban_user_feature_flag) end def confirm_user_data(user) diff --git a/app/models/broadcast_message.rb b/app/models/broadcast_message.rb index b255c774347..1f921c71984 100644 --- a/app/models/broadcast_message.rb +++ b/app/models/broadcast_message.rb @@ -131,7 +131,7 @@ class BroadcastMessage < ApplicationRecord end def matches_current_user_access_level?(user_access_level) - return false if target_access_levels.present? && Feature.disabled?(:role_targeted_broadcast_messages, default_enabled: :yaml) + return false if target_access_levels.present? && Feature.disabled?(:role_targeted_broadcast_messages) return true unless target_access_levels.present? target_access_levels.include? user_access_level diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb index 42f3311d86d..a06b920342c 100644 --- a/app/models/ci/bridge.rb +++ b/app/models/ci/bridge.rb @@ -58,7 +58,7 @@ module Ci end def retryable? - return false unless Feature.enabled?(:ci_recreate_downstream_pipeline, project, default_enabled: :yaml) + return false unless Feature.enabled?(:ci_recreate_downstream_pipeline, project) return false if failed? && (pipeline_loop_detected? || reached_max_descendant_pipelines_depth?) @@ -215,7 +215,7 @@ module Ci end def downstream_variables - if ::Feature.enabled?(:ci_trigger_forward_variables, project, default_enabled: :yaml) + if ::Feature.enabled?(:ci_trigger_forward_variables, project) calculate_downstream_variables .reverse # variables priority .uniq { |var| var[:key] } # only one variable key to pass diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 5cf367354ed..5622f228d83 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -326,7 +326,7 @@ module Ci after_transition pending: :running do |build| build.run_after_commit do - if ::Feature.enabled?(:ci_reduce_persistent_ref_writes, build.project, default_enabled: :yaml) + if ::Feature.enabled?(:ci_reduce_persistent_ref_writes, build.project) build.ensure_persistent_ref else build.pipeline.persistent_ref.create @@ -340,7 +340,7 @@ module Ci build.run_after_commit do build.run_status_commit_hooks! - if Feature.enabled?(:ci_build_finished_worker_namespace_changed, build.project, default_enabled: :yaml) + if Feature.enabled?(:ci_build_finished_worker_namespace_changed, build.project) Ci::BuildFinishedWorker.perform_async(id) else ::BuildFinishedWorker.perform_async(id) @@ -509,7 +509,7 @@ module Ci if metadata&.expanded_environment_name.present? metadata.expanded_environment_name else - if ::Feature.enabled?(:ci_expand_environment_name_and_url, project, default_enabled: :yaml) + if ::Feature.enabled?(:ci_expand_environment_name_and_url, project) ExpandVariables.expand(environment, -> { simple_variables.sort_and_expand_all }) else ExpandVariables.expand(environment, -> { simple_variables }) @@ -1225,7 +1225,7 @@ module Ci def job_jwt_variables Gitlab::Ci::Variables::Collection.new.tap do |variables| - break variables unless Feature.enabled?(:ci_job_jwt, project, default_enabled: true) + break variables unless Feature.enabled?(:ci_job_jwt, project) jwt = Gitlab::Ci::Jwt.for_build(self) jwt_v2 = Gitlab::Ci::JwtV2.for_build(self) diff --git a/app/models/ci/pending_build.rb b/app/models/ci/pending_build.rb index 41dc74ef050..d900a056242 100644 --- a/app/models/ci/pending_build.rb +++ b/app/models/ci/pending_build.rb @@ -31,7 +31,7 @@ module Ci end def maintain_denormalized_data? - ::Feature.enabled?(:ci_pending_builds_maintain_denormalized_data, default_enabled: :yaml) + ::Feature.enabled?(:ci_pending_builds_maintain_denormalized_data) end private diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 154f95d3692..dbf094229fe 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -253,7 +253,7 @@ module Ci after_transition any => ::Ci::Pipeline.completed_statuses do |pipeline| pipeline.run_after_commit do - if ::Feature.disabled?(:ci_reduce_persistent_ref_writes, pipeline.project, default_enabled: :yaml) + if ::Feature.disabled?(:ci_reduce_persistent_ref_writes, pipeline.project) pipeline.persistent_ref.delete end @@ -292,7 +292,7 @@ module Ci after_transition any => ::Ci::Pipeline.stopped_statuses do |pipeline| pipeline.run_after_commit do - if ::Feature.enabled?(:ci_reduce_persistent_ref_writes, pipeline.project, default_enabled: :yaml) + if ::Feature.enabled?(:ci_reduce_persistent_ref_writes, pipeline.project) pipeline.persistent_ref.delete end end diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index 328b0ee2e14..5f59dbba6b2 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -465,7 +465,7 @@ module Ci end def self.token_expiration_enforced? - Feature.enabled?(:enforce_runner_token_expires_at, default_enabled: :yaml) + Feature.enabled?(:enforce_runner_token_expires_at) end private diff --git a/app/models/clusters/instance.rb b/app/models/clusters/instance.rb index ef120384adf..b5acc6a68f9 100644 --- a/app/models/clusters/instance.rb +++ b/app/models/clusters/instance.rb @@ -12,7 +12,7 @@ module Clusters def certificate_based_clusters_enabled? ::Gitlab::SafeRequestStore.fetch("certificate_based_clusters:") do - Feature.enabled?(:certificate_based_clusters, default_enabled: :yaml, type: :ops) + Feature.enabled?(:certificate_based_clusters, type: :ops) end end end diff --git a/app/models/concerns/cross_database_modification.rb b/app/models/concerns/cross_database_modification.rb index 85645e482f6..dea62f03f91 100644 --- a/app/models/concerns/cross_database_modification.rb +++ b/app/models/concerns/cross_database_modification.rb @@ -103,7 +103,7 @@ module CrossDatabaseModification def track_gitlab_schema_in_current_transaction? return false unless Feature::FlipperFeature.table_exists? - Feature.enabled?(:track_gitlab_schema_in_current_transaction, default_enabled: :yaml) + Feature.enabled?(:track_gitlab_schema_in_current_transaction) rescue ActiveRecord::NoDatabaseError, PG::ConnectionBad false end diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index 8e029b8e5fb..713a4386fee 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -195,7 +195,7 @@ module Issuable end def supports_escalation? - return false unless ::Feature.enabled?(:incident_escalations, project, default_enabled: :yaml) + return false unless ::Feature.enabled?(:incident_escalations, project) incident? end diff --git a/app/models/concerns/limitable.rb b/app/models/concerns/limitable.rb index fab1aa21634..6ff540b7866 100644 --- a/app/models/concerns/limitable.rb +++ b/app/models/concerns/limitable.rb @@ -28,8 +28,8 @@ module Limitable def validate_scoped_plan_limit_not_exceeded scope_relation = self.public_send(limit_scope) # rubocop:disable GitlabSecurity/PublicSend return unless scope_relation - return if limit_feature_flag && ::Feature.disabled?(limit_feature_flag, scope_relation, default_enabled: :yaml) - return if limit_feature_flag_for_override && ::Feature.enabled?(limit_feature_flag_for_override, scope_relation, default_enabled: :yaml) + return if limit_feature_flag && ::Feature.disabled?(limit_feature_flag, scope_relation) + return if limit_feature_flag_for_override && ::Feature.enabled?(limit_feature_flag_for_override, scope_relation) relation = limit_relation ? self.public_send(limit_relation) : self.class.where(limit_scope => scope_relation) # rubocop:disable GitlabSecurity/PublicSend limits = scope_relation.actual_limits diff --git a/app/models/concerns/routable.rb b/app/models/concerns/routable.rb index 2cf95ac0dae..5b759dedb26 100644 --- a/app/models/concerns/routable.rb +++ b/app/models/concerns/routable.rb @@ -97,7 +97,7 @@ module Routable def full_name # We have to test for persistence as the cache key uses #updated_at - return (route&.name || build_full_name) unless persisted? && Feature.enabled?(:cached_route_lookups, self, type: :ops, default_enabled: :yaml) + return (route&.name || build_full_name) unless persisted? && Feature.enabled?(:cached_route_lookups, self, type: :ops) # Return the name as-is if the parent is missing return name if route.nil? && parent.nil? && name.present? @@ -115,7 +115,7 @@ module Routable def full_path # We have to test for persistence as the cache key uses #updated_at - return (route&.path || build_full_path) unless persisted? && Feature.enabled?(:cached_route_lookups, self, type: :ops, default_enabled: :yaml) + return (route&.path || build_full_path) unless persisted? && Feature.enabled?(:cached_route_lookups, self, type: :ops) # Return the path as-is if the parent is missing return path if route.nil? && parent.nil? && path.present? diff --git a/app/models/environment.rb b/app/models/environment.rb index fea661ff119..9913438df1d 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -314,7 +314,7 @@ class Environment < ApplicationRecord def stop_actions strong_memoize(:stop_actions) do - if ::Feature.enabled?(:environment_multiple_stop_actions, project, default_enabled: :yaml) + if ::Feature.enabled?(:environment_multiple_stop_actions, project) # Fix N+1 queries it brings to the serializer. # Tracked in https://gitlab.com/gitlab-org/gitlab/-/issues/358780 last_deployment_group.map(&:stop_action).compact diff --git a/app/models/group.rb b/app/models/group.rb index 990c06fdc41..86f4b14cb6c 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -146,7 +146,7 @@ class Group < Namespace validates :group_feature, presence: true add_authentication_token_field :runners_token, - encrypted: -> { Feature.enabled?(:groups_tokens_optional_encryption, default_enabled: true) ? :optional : :required }, + encrypted: -> { Feature.enabled?(:groups_tokens_optional_encryption) ? :optional : :required }, prefix: RunnersTokenPrefixable::RUNNERS_TOKEN_PREFIX after_create :post_create_hook @@ -870,7 +870,7 @@ class Group < Namespace actors << self if root_ancestor != self actors.any? do |actor| - ::Feature.enabled?(feature_flag, actor, default_enabled: :yaml) + ::Feature.enabled?(feature_flag, actor) end end diff --git a/app/models/integration.rb b/app/models/integration.rb index c905788ac8b..b5064cfae2d 100644 --- a/app/models/integration.rb +++ b/app/models/integration.rb @@ -279,7 +279,7 @@ class Integration < ApplicationRecord end def self.dev_integration_names - return [] unless Rails.env.development? + return [] unless Gitlab.dev_or_test_env? DEV_INTEGRATION_NAMES end diff --git a/app/models/issue.rb b/app/models/issue.rb index afdf5c38939..a1b4e733db3 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -147,7 +147,7 @@ class Issue < ApplicationRecord scope :confidential_only, -> { where(confidential: true) } scope :without_hidden, -> { - if Feature.enabled?(:ban_user_feature_flag, default_enabled: :yaml) + if Feature.enabled?(:ban_user_feature_flag) where('NOT EXISTS (?)', Users::BannedUser.select(1).where('issues.author_id = banned_users.user_id')) else all diff --git a/app/models/loose_foreign_keys/deleted_record.rb b/app/models/loose_foreign_keys/deleted_record.rb index ebda5872f1c..6dfd6ea2aae 100644 --- a/app/models/loose_foreign_keys/deleted_record.rb +++ b/app/models/loose_foreign_keys/deleted_record.rb @@ -10,7 +10,7 @@ class LooseForeignKeys::DeletedRecord < Gitlab::Database::SharedModel partitioned_by :partition, strategy: :sliding_list, next_partition_if: -> (active_partition) do - return false if Feature.disabled?(:lfk_automatic_partition_creation, default_enabled: :yaml) + return false if Feature.disabled?(:lfk_automatic_partition_creation) oldest_record_in_partition = LooseForeignKeys::DeletedRecord .select(:id, :created_at) @@ -22,7 +22,7 @@ class LooseForeignKeys::DeletedRecord < Gitlab::Database::SharedModel oldest_record_in_partition.present? && oldest_record_in_partition.created_at < PARTITION_DURATION.ago end, detach_partition_if: -> (partition) do - return false if Feature.disabled?(:lfk_automatic_partition_dropping, default_enabled: :yaml) + return false if Feature.disabled?(:lfk_automatic_partition_dropping) !LooseForeignKeys::DeletedRecord .for_partition(partition) diff --git a/app/models/member.rb b/app/models/member.rb index 14ba5b39d6f..a5084c8a60c 100644 --- a/app/models/member.rb +++ b/app/models/member.rb @@ -521,7 +521,7 @@ class Member < ApplicationRecord end def blocking_refresh - return true unless Feature.enabled?(:allow_non_blocking_member_refresh, default_enabled: :yaml) + return true unless Feature.enabled?(:allow_non_blocking_member_refresh) return true if @blocking_refresh.nil? @blocking_refresh diff --git a/app/models/members_preloader.rb b/app/models/members_preloader.rb index 8b8eca54550..ba7e4b39989 100644 --- a/app/models/members_preloader.rb +++ b/app/models/members_preloader.rb @@ -13,7 +13,7 @@ class MembersPreloader ActiveRecord::Associations::Preloader.new.preload(members, :created_by) ActiveRecord::Associations::Preloader.new.preload(members, user: :status) ActiveRecord::Associations::Preloader.new.preload(members, user: :u2f_registrations) - ActiveRecord::Associations::Preloader.new.preload(members, user: :webauthn_registrations) if Feature.enabled?(:webauthn, default_enabled: :yaml) + ActiveRecord::Associations::Preloader.new.preload(members, user: :webauthn_registrations) if Feature.enabled?(:webauthn) end end diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 74095fad5e4..5adc5a656c8 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -1152,7 +1152,7 @@ class MergeRequest < ApplicationRecord # rubocop: disable CodeReuse/ServiceClass def mergeable_state?(skip_ci_check: false, skip_discussions_check: false) - if Feature.enabled?(:improved_mergeability_checks, self.project, default_enabled: :yaml) + if Feature.enabled?(:improved_mergeability_checks, self.project) additional_checks = MergeRequests::Mergeability::RunChecksService.new( merge_request: self, params: { @@ -1457,7 +1457,7 @@ class MergeRequest < ApplicationRecord end def environments_in_head_pipeline(deployment_status: nil) - if ::Feature.enabled?(:fix_related_environments_for_merge_requests, target_project, default_enabled: :yaml) + if ::Feature.enabled?(:fix_related_environments_for_merge_requests, target_project) actual_head_pipeline&.environments_in_self_and_descendants(deployment_status: deployment_status) || Environment.none else legacy_environments diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 32f44c6cfcc..e8b6cf00d17 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -126,7 +126,7 @@ class Namespace < ApplicationRecord before_destroy(prepend: true) { prepare_for_destroy } after_destroy :rm_dir after_commit :expire_child_caches, on: :update, if: -> { - Feature.enabled?(:cached_route_lookups, self, type: :ops, default_enabled: :yaml) && + Feature.enabled?(:cached_route_lookups, self, type: :ops) && saved_change_to_name? || saved_change_to_path? || saved_change_to_parent_id? } @@ -351,7 +351,7 @@ class Namespace < ApplicationRecord # Includes projects from this namespace and projects from all subgroups # that belongs to this namespace def all_projects - if Feature.enabled?(:recursive_approach_for_all_projects, default_enabled: :yaml) + if Feature.enabled?(:recursive_approach_for_all_projects) namespace = user_namespace? ? self : self_and_descendant_ids Project.where(namespace: namespace) else @@ -516,7 +516,7 @@ class Namespace < ApplicationRecord end def issue_repositioning_disabled? - Feature.enabled?(:block_issue_repositioning, self, type: :ops, default_enabled: :yaml) + Feature.enabled?(:block_issue_repositioning, self, type: :ops) end def storage_enforcement_date @@ -527,7 +527,7 @@ class Namespace < ApplicationRecord def certificate_based_clusters_enabled? ::Gitlab::SafeRequestStore.fetch("certificate_based_clusters:ns:#{self.id}") do - Feature.enabled?(:certificate_based_clusters, self, default_enabled: :yaml, type: :ops) + Feature.enabled?(:certificate_based_clusters, self, type: :ops) end end @@ -644,7 +644,7 @@ class Namespace < ApplicationRecord end def cache_first_auto_devops_config? - ::Feature.enabled?(:namespaces_cache_first_auto_devops_config, default_enabled: :yaml) + ::Feature.enabled?(:namespaces_cache_first_auto_devops_config) end def write_projects_repository_config diff --git a/app/models/namespaces/traversal/linear.rb b/app/models/namespaces/traversal/linear.rb index 6320e0bc39d..b0350b0288f 100644 --- a/app/models/namespaces/traversal/linear.rb +++ b/app/models/namespaces/traversal/linear.rb @@ -77,38 +77,38 @@ module Namespaces end def sync_traversal_ids? - Feature.enabled?(:sync_traversal_ids, root_ancestor, default_enabled: :yaml) + Feature.enabled?(:sync_traversal_ids, root_ancestor) end def use_traversal_ids? - return false unless Feature.enabled?(:use_traversal_ids, default_enabled: :yaml) + return false unless Feature.enabled?(:use_traversal_ids) traversal_ids.present? end def use_traversal_ids_for_self_and_hierarchy? return false unless use_traversal_ids? - return false unless Feature.enabled?(:use_traversal_ids_for_self_and_hierarchy, root_ancestor, default_enabled: :yaml) + return false unless Feature.enabled?(:use_traversal_ids_for_self_and_hierarchy, root_ancestor) traversal_ids.present? end def use_traversal_ids_for_ancestors? return false unless use_traversal_ids? - return false unless Feature.enabled?(:use_traversal_ids_for_ancestors, root_ancestor, default_enabled: :yaml) + return false unless Feature.enabled?(:use_traversal_ids_for_ancestors, root_ancestor) traversal_ids.present? end def use_traversal_ids_for_ancestors_upto? return false unless use_traversal_ids? - return false unless Feature.enabled?(:use_traversal_ids_for_ancestors_upto, root_ancestor, default_enabled: :yaml) + return false unless Feature.enabled?(:use_traversal_ids_for_ancestors_upto, root_ancestor) traversal_ids.present? end def use_traversal_ids_for_root_ancestor? - return false unless Feature.enabled?(:use_traversal_ids_for_root_ancestor, default_enabled: :yaml) + return false unless Feature.enabled?(:use_traversal_ids_for_root_ancestor) traversal_ids.present? end diff --git a/app/models/namespaces/traversal/linear_scopes.rb b/app/models/namespaces/traversal/linear_scopes.rb index 0cac4c9143a..f0e9a8feeb2 100644 --- a/app/models/namespaces/traversal/linear_scopes.rb +++ b/app/models/namespaces/traversal/linear_scopes.rb @@ -55,7 +55,7 @@ module Namespaces def self_and_descendants(include_self: true) return super unless use_traversal_ids_for_descendants_scopes? - if Feature.enabled?(:traversal_ids_btree, default_enabled: :yaml) + if Feature.enabled?(:traversal_ids_btree) self_and_descendants_with_comparison_operators(include_self: include_self) else records = self_and_descendants_with_duplicates_with_array_operator(include_self: include_self) @@ -67,7 +67,7 @@ module Namespaces def self_and_descendant_ids(include_self: true) return super unless use_traversal_ids_for_descendants_scopes? - if Feature.enabled?(:traversal_ids_btree, default_enabled: :yaml) + if Feature.enabled?(:traversal_ids_btree) self_and_descendants_with_comparison_operators(include_self: include_self).as_ids else self_and_descendants_with_duplicates_with_array_operator(include_self: include_self) @@ -102,26 +102,26 @@ module Namespaces private def use_traversal_ids? - Feature.enabled?(:use_traversal_ids, default_enabled: :yaml) + Feature.enabled?(:use_traversal_ids) end def use_traversal_ids_roots? - Feature.enabled?(:use_traversal_ids_roots, default_enabled: :yaml) && + Feature.enabled?(:use_traversal_ids_roots) && use_traversal_ids? end def use_traversal_ids_for_ancestor_scopes? - Feature.enabled?(:use_traversal_ids_for_ancestor_scopes, default_enabled: :yaml) && + Feature.enabled?(:use_traversal_ids_for_ancestor_scopes) && use_traversal_ids? end def use_traversal_ids_for_descendants_scopes? - Feature.enabled?(:use_traversal_ids_for_descendants_scopes, default_enabled: :yaml) && + Feature.enabled?(:use_traversal_ids_for_descendants_scopes) && use_traversal_ids? end def use_traversal_ids_for_self_and_hierarchy_scopes? - Feature.enabled?(:use_traversal_ids_for_self_and_hierarchy_scopes, default_enabled: :yaml) && + Feature.enabled?(:use_traversal_ids_for_self_and_hierarchy_scopes) && use_traversal_ids? end diff --git a/app/models/preloaders/group_root_ancestor_preloader.rb b/app/models/preloaders/group_root_ancestor_preloader.rb index 3ca713d9635..29c60e90964 100644 --- a/app/models/preloaders/group_root_ancestor_preloader.rb +++ b/app/models/preloaders/group_root_ancestor_preloader.rb @@ -8,7 +8,7 @@ module Preloaders end def execute - return unless ::Feature.enabled?(:use_traversal_ids, default_enabled: :yaml) + return unless ::Feature.enabled?(:use_traversal_ids) # type == 'Group' condition located on subquery to prevent a filter in the query root_query = Namespace.joins("INNER JOIN (#{join_sql}) as root_query ON root_query.root_id = namespaces.id") diff --git a/app/models/preloaders/user_max_access_level_in_groups_preloader.rb b/app/models/preloaders/user_max_access_level_in_groups_preloader.rb index 2cd54b975f3..8df986b47a2 100644 --- a/app/models/preloaders/user_max_access_level_in_groups_preloader.rb +++ b/app/models/preloaders/user_max_access_level_in_groups_preloader.rb @@ -10,7 +10,7 @@ module Preloaders end def execute - if ::Feature.enabled?(:use_traversal_ids, default_enabled: :yaml) + if ::Feature.enabled?(:use_traversal_ids) preload_with_traversal_ids else preload_direct_memberships diff --git a/app/models/project.rb b/app/models/project.rb index f1e2967fb0e..528f87972b3 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -113,7 +113,7 @@ class Project < ApplicationRecord default_value_for(:ci_config_path) { Gitlab::CurrentSettings.default_ci_config_path } add_authentication_token_field :runners_token, - encrypted: -> { Feature.enabled?(:projects_tokens_optional_encryption, default_enabled: true) ? :optional : :required }, + encrypted: -> { Feature.enabled?(:projects_tokens_optional_encryption) ? :optional : :required }, prefix: RunnersTokenPrefixable::RUNNERS_TOKEN_PREFIX before_validation :mark_remote_mirrors_for_removal, if: -> { RemoteMirror.table_exists? } @@ -965,7 +965,7 @@ class Project < ApplicationRecord end def ancestors(hierarchy_order: nil) - if Feature.enabled?(:linear_project_ancestors, self, default_enabled: :yaml) + if Feature.enabled?(:linear_project_ancestors, self) group&.self_and_ancestors(hierarchy_order: hierarchy_order) || Group.none else ancestors_upto(hierarchy_order: hierarchy_order) @@ -1027,7 +1027,7 @@ class Project < ApplicationRecord end def unlink_forks_upon_visibility_decrease_enabled? - Feature.enabled?(:unlink_fork_network_upon_visibility_decrease, self, default_enabled: true) + Feature.enabled?(:unlink_fork_network_upon_visibility_decrease, self) end # LFS and hashed repository storage are required for using Design Management. @@ -2873,12 +2873,12 @@ class Project < ApplicationRecord end def work_items_feature_flag_enabled? - group&.work_items_feature_flag_enabled? || Feature.enabled?(:work_items, self, default_enabled: :yaml) + group&.work_items_feature_flag_enabled? || Feature.enabled?(:work_items, self) end def enqueue_record_project_target_platforms return unless Gitlab.com? - return unless Feature.enabled?(:record_projects_target_platforms, self, default_enabled: :yaml) + return unless Feature.enabled?(:record_projects_target_platforms, self) Projects::RecordTargetPlatformsWorker.perform_async(id) end diff --git a/app/models/project_ci_cd_setting.rb b/app/models/project_ci_cd_setting.rb index 28a493cae33..fcb9700fdf8 100644 --- a/app/models/project_ci_cd_setting.rb +++ b/app/models/project_ci_cd_setting.rb @@ -22,7 +22,7 @@ class ProjectCiCdSetting < ApplicationRecord chronic_duration_attr :runner_token_expiration_interval_human_readable, :runner_token_expiration_interval def forward_deployment_enabled? - super && ::Feature.enabled?(:forward_deployment_enabled, project, default_enabled: true) + super && ::Feature.enabled?(:forward_deployment_enabled, project) end def keep_latest_artifacts_available? diff --git a/app/models/project_setting.rb b/app/models/project_setting.rb index c6f9147cad7..e9fd7e4446c 100644 --- a/app/models/project_setting.rb +++ b/app/models/project_setting.rb @@ -21,7 +21,7 @@ class ProjectSetting < ApplicationRecord validate :validates_mr_default_target_self default_value_for(:legacy_open_source_license_available) do - Feature.enabled?(:legacy_open_source_license_available, default_enabled: :yaml, type: :ops) + Feature.enabled?(:legacy_open_source_license_available, type: :ops) end def squash_enabled_by_default? diff --git a/app/models/project_statistics.rb b/app/models/project_statistics.rb index 7d7f9c2d5d6..95fc135f38f 100644 --- a/app/models/project_statistics.rb +++ b/app/models/project_statistics.rb @@ -77,7 +77,7 @@ class ProjectStatistics < ApplicationRecord end def update_container_registry_size - return unless Feature.enabled?(:container_registry_project_statistics, project, default_enabled: :yaml) + return unless Feature.enabled?(:container_registry_project_statistics, project) self.container_registry_size = project.container_repositories_size || 0 end diff --git a/app/models/user.rb b/app/models/user.rb index 0408cc2cb5d..d499a6074e0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -941,7 +941,7 @@ class User < ApplicationRecord end def two_factor_u2f_enabled? - return false if Feature.enabled?(:webauthn, default_enabled: :yaml) + return false if Feature.enabled?(:webauthn) if u2f_registrations.loaded? u2f_registrations.any? @@ -955,7 +955,7 @@ class User < ApplicationRecord end def two_factor_webauthn_enabled? - return false unless Feature.enabled?(:webauthn, default_enabled: :yaml) + return false unless Feature.enabled?(:webauthn) (webauthn_registrations.loaded? && webauthn_registrations.any?) || (!webauthn_registrations.loaded? && webauthn_registrations.exists?) end @@ -1583,7 +1583,7 @@ class User < ApplicationRecord end def manageable_groups(include_groups_with_developer_maintainer_access: false) - owned_and_maintainer_group_hierarchy = if Feature.enabled?(:linear_user_manageable_groups, self, default_enabled: :yaml) + owned_and_maintainer_group_hierarchy = if Feature.enabled?(:linear_user_manageable_groups, self) owned_or_maintainers_groups.self_and_descendants else Gitlab::ObjectHierarchy.new(owned_or_maintainers_groups).base_and_descendants @@ -1673,7 +1673,7 @@ class User < ApplicationRecord def ci_owned_runners_cross_joins_fix_enabled? strong_memoize(:ci_owned_runners_cross_joins_fix_enabled) do - Feature.enabled?(:ci_owned_runners_cross_joins_fix, self, default_enabled: :yaml) + Feature.enabled?(:ci_owned_runners_cross_joins_fix, self) end end @@ -1735,7 +1735,7 @@ class User < ApplicationRecord end def attention_requested_open_merge_requests_count(force: false) - if Feature.enabled?(:uncached_mr_attention_requests_count, self, default_enabled: :yaml) + if Feature.enabled?(:uncached_mr_attention_requests_count, self) MergeRequestsFinder.new(self, attention: self.username, state: 'opened', non_archived: true).execute.count else Rails.cache.fetch(attention_request_cache_key, force: force, expires_in: COUNT_CACHE_VALIDITY_PERIOD) do @@ -2071,7 +2071,7 @@ class User < ApplicationRecord end def mr_attention_requests_enabled? - Feature.enabled?(:mr_attention_requests, self, default_enabled: :yaml) + Feature.enabled?(:mr_attention_requests, self) end protected @@ -2317,7 +2317,7 @@ class User < ApplicationRecord # to avoid querying descendants since they are already covered # by ancestor namespaces. If the FF is not available fallback to # inefficient search: https://gitlab.com/gitlab-org/gitlab/-/issues/336436 - unless Feature.enabled?(:use_traversal_ids, default_enabled: :yaml) + unless Feature.enabled?(:use_traversal_ids) return Ci::NamespaceMirror.contains_any_of_namespaces(search_members.pluck(:source_id)) end @@ -2326,7 +2326,7 @@ class User < ApplicationRecord .shortest_traversal_ids_prefixes # Use efficient btree index to perform search - if Feature.enabled?(:ci_owned_runners_unnest_index, self, default_enabled: :yaml) + if Feature.enabled?(:ci_owned_runners_unnest_index, self) Ci::NamespaceMirror.contains_traversal_ids(traversal_ids) else Ci::NamespaceMirror.contains_any_of_namespaces(traversal_ids.map(&:last)) diff --git a/app/models/wiki.rb b/app/models/wiki.rb index 78292c8e1fc..ca1266e50f4 100644 --- a/app/models/wiki.rb +++ b/app/models/wiki.rb @@ -227,7 +227,7 @@ class Wiki end def create_page(title, content, format = :markdown, message = nil) - if Feature.enabled?(:gitaly_replace_wiki_create_page, container, type: :undefined, default_enabled: :yaml) + if Feature.enabled?(:gitaly_replace_wiki_create_page, container, type: :undefined) with_valid_format(format) do |default_extension| if file_exists_by_regex?(title) raise_duplicate_page_error! @@ -261,7 +261,7 @@ class Wiki end def update_page(page, content:, title: nil, format: :markdown, message: nil) - if Feature.enabled?(:gitaly_replace_wiki_update_page, container, type: :undefined, default_enabled: :yaml) + if Feature.enabled?(:gitaly_replace_wiki_update_page, container, type: :undefined) with_valid_format(format) do |default_extension| title = title.presence || Pathname(page.path).sub_ext('').to_s diff --git a/app/policies/group_policy.rb b/app/policies/group_policy.rb index eaefd7fcf8f..0094bc388a8 100644 --- a/app/policies/group_policy.rb +++ b/app/policies/group_policy.rb @@ -54,7 +54,7 @@ class GroupPolicy < Namespaces::GroupProjectNamespaceSharedPolicy end condition(:dependency_proxy_access_allowed) do - if Feature.enabled?(:dependency_proxy_for_private_groups, default_enabled: true) + if Feature.enabled?(:dependency_proxy_for_private_groups) access_level(for_any_session: true) >= GroupMember::GUEST || valid_dependency_proxy_deploy_token else can?(:read_group) @@ -81,7 +81,7 @@ class GroupPolicy < Namespaces::GroupProjectNamespaceSharedPolicy condition(:crm_enabled, score: 0, scope: :subject) { Feature.enabled?(:customer_relations, @subject) && @subject.crm_enabled? } condition(:group_runner_registration_allowed) do - Feature.disabled?(:runner_registration_control, default_enabled: :yaml) || Gitlab::CurrentSettings.valid_runner_registrars.include?('group') + Feature.disabled?(:runner_registration_control) || Gitlab::CurrentSettings.valid_runner_registrars.include?('group') end rule { can?(:read_group) & design_management_enabled }.policy do diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index 54bceb58c94..60519dc346b 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -195,7 +195,7 @@ class ProjectPolicy < BasePolicy end condition(:project_runner_registration_allowed) do - Feature.disabled?(:runner_registration_control, default_enabled: :yaml) || Gitlab::CurrentSettings.valid_runner_registrars.include?('project') + Feature.disabled?(:runner_registration_control) || Gitlab::CurrentSettings.valid_runner_registrars.include?('project') end # `:read_project` may be prevented in EE, but `:read_project_for_iids` should diff --git a/app/presenters/user_presenter.rb b/app/presenters/user_presenter.rb index dc775fb4160..26b8169d2b0 100644 --- a/app/presenters/user_presenter.rb +++ b/app/presenters/user_presenter.rb @@ -21,7 +21,7 @@ class UserPresenter < Gitlab::View::Presenter::Delegated delegator_override :saved_replies def saved_replies - return ::Users::SavedReply.none unless Feature.enabled?(:saved_replies, current_user, default_enabled: :yaml) + return ::Users::SavedReply.none unless Feature.enabled?(:saved_replies, current_user) return ::Users::SavedReply.none unless current_user.can?(:read_saved_replies, user) user.saved_replies diff --git a/app/services/bulk_imports/file_decompression_service.rb b/app/services/bulk_imports/file_decompression_service.rb index b76746b199f..41616fc1c75 100644 --- a/app/services/bulk_imports/file_decompression_service.rb +++ b/app/services/bulk_imports/file_decompression_service.rb @@ -21,7 +21,7 @@ module BulkImports def execute validate_tmpdir validate_filepath - validate_decompressed_file_size if Feature.enabled?(:validate_import_decompressed_archive_size, default_enabled: :yaml) + validate_decompressed_file_size if Feature.enabled?(:validate_import_decompressed_archive_size) validate_symlink(filepath) decompress_file diff --git a/app/services/ci/job_artifacts/destroy_batch_service.rb b/app/services/ci/job_artifacts/destroy_batch_service.rb index 8a44d2b77e4..5121a8b0a8b 100644 --- a/app/services/ci/job_artifacts/destroy_batch_service.rb +++ b/app/services/ci/job_artifacts/destroy_batch_service.rb @@ -130,7 +130,7 @@ module Ci end def fix_expire_at? - Feature.enabled?(:ci_detect_wrongly_expired_artifacts, default_enabled: :yaml) + Feature.enabled?(:ci_detect_wrongly_expired_artifacts) end def wrongly_expired?(artifact) diff --git a/app/services/ci/pipeline_creation/start_pipeline_service.rb b/app/services/ci/pipeline_creation/start_pipeline_service.rb index 89eb926bda9..bdbb021e4e8 100644 --- a/app/services/ci/pipeline_creation/start_pipeline_service.rb +++ b/app/services/ci/pipeline_creation/start_pipeline_service.rb @@ -13,7 +13,7 @@ module Ci ## # Create a persistent ref for the pipeline. # The pipeline ref is fetched in the jobs and deleted when the pipeline transitions to a finished state. - if ::Feature.enabled?(:ci_reduce_persistent_ref_writes, pipeline.project, default_enabled: :yaml) + if ::Feature.enabled?(:ci_reduce_persistent_ref_writes, pipeline.project) pipeline.ensure_persistent_ref end diff --git a/app/services/ci/queue/build_queue_service.rb b/app/services/ci/queue/build_queue_service.rb index 9f476c8a785..fefbdb151ec 100644 --- a/app/services/ci/queue/build_queue_service.rb +++ b/app/services/ci/queue/build_queue_service.rb @@ -80,7 +80,7 @@ module Ci def strategy strong_memoize(:strategy) do - if ::Feature.enabled?(:ci_pending_builds_queue_source, runner, default_enabled: :yaml) + if ::Feature.enabled?(:ci_pending_builds_queue_source, runner) Queue::PendingBuildsStrategy.new(runner) else Queue::BuildsTableStrategy.new(runner) diff --git a/app/services/ci/queue/builds_table_strategy.rb b/app/services/ci/queue/builds_table_strategy.rb index 237dd510d50..c27c10bd18d 100644 --- a/app/services/ci/queue/builds_table_strategy.rb +++ b/app/services/ci/queue/builds_table_strategy.rb @@ -18,7 +18,7 @@ module Ci .joins('LEFT JOIN project_features ON ci_builds.project_id = project_features.project_id') .where('project_features.builds_access_level IS NULL or project_features.builds_access_level > 0') - if Feature.enabled?(:ci_queueing_disaster_recovery_disable_fair_scheduling, runner, type: :ops, default_enabled: :yaml) + if Feature.enabled?(:ci_queueing_disaster_recovery_disable_fair_scheduling, runner, type: :ops) # if disaster recovery is enabled, we fallback to FIFO scheduling relation.order('ci_builds.id ASC') else diff --git a/app/services/ci/queue/pending_builds_strategy.rb b/app/services/ci/queue/pending_builds_strategy.rb index 47158b8ea1d..f2eba0681db 100644 --- a/app/services/ci/queue/pending_builds_strategy.rb +++ b/app/services/ci/queue/pending_builds_strategy.rb @@ -51,7 +51,7 @@ module Ci end def use_denormalized_data_strategy? - ::Feature.enabled?(:ci_queuing_use_denormalized_data_strategy, default_enabled: :yaml) + ::Feature.enabled?(:ci_queuing_use_denormalized_data_strategy) end private @@ -70,7 +70,7 @@ module Ci end def builds_ordered_for_shared_runners(relation) - if Feature.enabled?(:ci_queueing_disaster_recovery_disable_fair_scheduling, runner, type: :ops, default_enabled: :yaml) + if Feature.enabled?(:ci_queueing_disaster_recovery_disable_fair_scheduling, runner, type: :ops) # if disaster recovery is enabled, we fallback to FIFO scheduling relation.order('ci_pending_builds.build_id ASC') else diff --git a/app/services/ci/runners/register_runner_service.rb b/app/services/ci/runners/register_runner_service.rb index 7978d094d9b..196d2de1a65 100644 --- a/app/services/ci/runners/register_runner_service.rb +++ b/app/services/ci/runners/register_runner_service.rb @@ -47,7 +47,7 @@ module Ci end def runner_registrar_valid?(type) - Feature.disabled?(:runner_registration_control, default_enabled: :yaml) || Gitlab::CurrentSettings.valid_runner_registrars.include?(type) + Feature.disabled?(:runner_registration_control) || Gitlab::CurrentSettings.valid_runner_registrars.include?(type) end def token_scope diff --git a/app/services/ci/stuck_builds/drop_running_service.rb b/app/services/ci/stuck_builds/drop_running_service.rb index a79224cc231..dfcf3ca3836 100644 --- a/app/services/ci/stuck_builds/drop_running_service.rb +++ b/app/services/ci/stuck_builds/drop_running_service.rb @@ -16,7 +16,7 @@ module Ci private def running_timed_out_builds - if Feature.enabled?(:ci_new_query_for_running_stuck_jobs, default_enabled: :yaml) + if Feature.enabled?(:ci_new_query_for_running_stuck_jobs) Ci::Build .running .created_at_before(BUILD_RUNNING_OUTDATED_TIMEOUT.ago) diff --git a/app/services/ci/update_build_state_service.rb b/app/services/ci/update_build_state_service.rb index 9df36b86404..a74ddcfaf06 100644 --- a/app/services/ci/update_build_state_service.rb +++ b/app/services/ci/update_build_state_service.rb @@ -217,11 +217,11 @@ module Ci def chunks_migration_enabled? ::Feature.enabled?(:ci_enable_live_trace, build.project) && - ::Feature.enabled?(:ci_accept_trace, build.project, type: :ops, default_enabled: true) + ::Feature.enabled?(:ci_accept_trace, build.project, type: :ops) end def log_invalid_chunks? - ::Feature.enabled?(:ci_trace_log_invalid_chunks, build.project, type: :ops, default_enabled: false) + ::Feature.enabled?(:ci_trace_log_invalid_chunks, build.project, type: :ops) end end end diff --git a/app/services/deployments/update_environment_service.rb b/app/services/deployments/update_environment_service.rb index b0ba8ecaa47..b0eb153a7af 100644 --- a/app/services/deployments/update_environment_service.rb +++ b/app/services/deployments/update_environment_service.rb @@ -58,7 +58,7 @@ module Deployments def expanded_environment_url return unless environment_url - if ::Feature.enabled?(:ci_expand_environment_name_and_url, deployment.project, default_enabled: :yaml) + if ::Feature.enabled?(:ci_expand_environment_name_and_url, deployment.project) ExpandVariables.expand(environment_url, -> { variables.sort_and_expand_all }) else ExpandVariables.expand(environment_url, -> { variables }) diff --git a/app/services/environments/stop_service.rb b/app/services/environments/stop_service.rb index 39a43b21405..5a0dca4e35b 100644 --- a/app/services/environments/stop_service.rb +++ b/app/services/environments/stop_service.rb @@ -19,8 +19,7 @@ module Environments end def execute_for_merge_request_pipeline(merge_request) - if ::Feature.enabled?(:fix_related_environments_for_merge_requests, merge_request.target_project, - default_enabled: :yaml) + if ::Feature.enabled?(:fix_related_environments_for_merge_requests, merge_request.target_project) return unless merge_request.actual_head_pipeline&.merge_request? end diff --git a/app/services/event_create_service.rb b/app/services/event_create_service.rb index 417680e37cf..5a2c29f8e7a 100644 --- a/app/services/event_create_service.rb +++ b/app/services/event_create_service.rb @@ -185,7 +185,7 @@ class EventCreateService track_event(event_action: :pushed, event_target: Project, author_id: current_user.id) namespace = project.namespace - if Feature.enabled?(:route_hll_to_snowplow, namespace, default_enabled: :yaml) + if Feature.enabled?(:route_hll_to_snowplow, namespace) Gitlab::Tracking.event(self.class.to_s, 'action_active_users_project_repo', namespace: namespace, user: current_user, project: project) end diff --git a/app/services/groups/import_export/export_service.rb b/app/services/groups/import_export/export_service.rb index ea26ebec20b..2bfd5a5ebab 100644 --- a/app/services/groups/import_export/export_service.rb +++ b/app/services/groups/import_export/export_service.rb @@ -78,7 +78,7 @@ module Groups end def ndjson? - ::Feature.enabled?(:group_export_ndjson, group&.parent, default_enabled: :yaml) + ::Feature.enabled?(:group_export_ndjson, group&.parent) end def version_saver diff --git a/app/services/groups/import_export/import_service.rb b/app/services/groups/import_export/import_service.rb index c8c2124078d..f026f1698a9 100644 --- a/app/services/groups/import_export/import_service.rb +++ b/app/services/groups/import_export/import_service.rb @@ -72,7 +72,7 @@ module Groups end def ndjson? - ::Feature.enabled?(:group_import_ndjson, group&.parent, default_enabled: true) && + ::Feature.enabled?(:group_import_ndjson, group&.parent) && File.exist?(File.join(shared.export_path, 'tree/groups/_all.ndjson')) end diff --git a/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb b/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb index ae9a450660c..ac58711a0ac 100644 --- a/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb +++ b/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb @@ -58,7 +58,7 @@ module Import end def validate_aws_s3? - ::Feature.enabled?(:import_project_from_remote_file_s3, default_enabled: :yaml) + ::Feature.enabled?(:import_project_from_remote_file_s3) end def headers diff --git a/app/services/merge_requests/mergeability/run_checks_service.rb b/app/services/merge_requests/mergeability/run_checks_service.rb index 03c6d985c23..fd6907c976b 100644 --- a/app/services/merge_requests/mergeability/run_checks_service.rb +++ b/app/services/merge_requests/mergeability/run_checks_service.rb @@ -37,7 +37,7 @@ module MergeRequests attr_reader :merge_request, :params def run_check(check) - return check.execute unless Feature.enabled?(:mergeability_caching, merge_request.project, default_enabled: :yaml) + return check.execute unless Feature.enabled?(:mergeability_caching, merge_request.project) return check.execute unless check.cacheable? cached_result = results.read(merge_check: check) diff --git a/app/services/projects/branches_by_mode_service.rb b/app/services/projects/branches_by_mode_service.rb index 090671cc79a..0248f997a03 100644 --- a/app/services/projects/branches_by_mode_service.rb +++ b/app/services/projects/branches_by_mode_service.rb @@ -37,7 +37,7 @@ class Projects::BranchesByModeService def use_gitaly_pagination? return false if params[:page].present? || params[:search].present? - Feature.enabled?(:branch_list_keyset_pagination, project, default_enabled: :yaml) + Feature.enabled?(:branch_list_keyset_pagination, project) end def fetch_branches_via_offset_pagination diff --git a/app/services/projects/lfs_pointers/lfs_download_service.rb b/app/services/projects/lfs_pointers/lfs_download_service.rb index 76005a1c96e..c032fbf1508 100644 --- a/app/services/projects/lfs_pointers/lfs_download_service.rb +++ b/app/services/projects/lfs_pointers/lfs_download_service.rb @@ -23,7 +23,7 @@ module Projects def execute return unless project&.lfs_enabled? && lfs_download_object return error("LFS file with oid #{lfs_oid} has invalid attributes") unless lfs_download_object.valid? - return link_existing_lfs_object! if Feature.enabled?(:lfs_link_existing_object, project, default_enabled: :yaml) && lfs_size > LARGE_FILE_SIZE && lfs_object + return link_existing_lfs_object! if Feature.enabled?(:lfs_link_existing_object, project) && lfs_size > LARGE_FILE_SIZE && lfs_object wrap_download_errors do download_lfs_file! diff --git a/app/services/projects/overwrite_project_service.rb b/app/services/projects/overwrite_project_service.rb index eea8f867b45..d3fed43363c 100644 --- a/app/services/projects/overwrite_project_service.rb +++ b/app/services/projects/overwrite_project_service.rb @@ -41,7 +41,7 @@ module Projects private def track_service(start_time, source_project, exception) - return if ::Feature.disabled?(:project_overwrite_service_tracking, source_project, default_enabled: :yaml) + return if ::Feature.disabled?(:project_overwrite_service_tracking, source_project) duration = ::Gitlab::Metrics::System.monotonic_time - start_time diff --git a/app/services/projects/update_remote_mirror_service.rb b/app/services/projects/update_remote_mirror_service.rb index f3ea0967a99..705d23ec704 100644 --- a/app/services/projects/update_remote_mirror_service.rb +++ b/app/services/projects/update_remote_mirror_service.rb @@ -65,7 +65,7 @@ module Projects message += "Error synchronizing LFS files:" message += "\n\n#{lfs_status[:message]}\n\n" - failed = Feature.enabled?(:remote_mirror_fail_on_lfs, project, default_enabled: :yaml) + failed = Feature.enabled?(:remote_mirror_fail_on_lfs, project) end if response.divergent_refs.any? diff --git a/app/services/service_ping/submit_service.rb b/app/services/service_ping/submit_service.rb index d1afabe6d92..909c4e860e9 100644 --- a/app/services/service_ping/submit_service.rb +++ b/app/services/service_ping/submit_service.rb @@ -50,7 +50,7 @@ module ServicePing DevopsReportService.new(response).execute end - return unless Feature.enabled?(:measure_service_ping_metric_collection, default_enabled: :yaml) + return unless Feature.enabled?(:measure_service_ping_metric_collection) submit_payload({ metadata: { metrics: metrics_collection_time(usage_data) } }, path: METADATA_PATH) end diff --git a/app/services/users/destroy_service.rb b/app/services/users/destroy_service.rb index 1ea65049dc2..5dcdfdc604d 100644 --- a/app/services/users/destroy_service.rb +++ b/app/services/users/destroy_service.rb @@ -64,7 +64,7 @@ module Users # This ensures we delete records in batches. user.destroy_dependent_associations_in_batches(exclude: [:snippets]) - if Feature.enabled?(:nullify_in_batches_on_user_deletion, default_enabled: :yaml) + if Feature.enabled?(:nullify_in_batches_on_user_deletion) user.nullify_dependent_associations_in_batches end diff --git a/app/views/admin/application_settings/ci_cd.html.haml b/app/views/admin/application_settings/ci_cd.html.haml index aab4f44d4d7..c7fc5f59d73 100644 --- a/app/views/admin/application_settings/ci_cd.html.haml +++ b/app/views/admin/application_settings/ci_cd.html.haml @@ -38,7 +38,7 @@ .settings-content = render 'registry' -- if Feature.enabled?(:runner_registration_control, default_enabled: :yaml) +- if Feature.enabled?(:runner_registration_control) %section.settings.as-runner.no-animate#js-runner-settings{ class: ('expanded' if expanded_by_default?) } .settings-header %h4 diff --git a/app/views/admin/application_settings/metrics_and_profiling.html.haml b/app/views/admin/application_settings/metrics_and_profiling.html.haml index 346be6ef44c..8e4b0b53f28 100644 --- a/app/views/admin/application_settings/metrics_and_profiling.html.haml +++ b/app/views/admin/application_settings/metrics_and_profiling.html.haml @@ -53,7 +53,7 @@ .settings-content = render 'usage' -- if Feature.enabled?(:configure_sentry_in_application_settings, default_enabled: :yaml) +- if Feature.enabled?(:configure_sentry_in_application_settings) %section.settings.as-sentry.no-animate#js-sentry-settings{ class: ('expanded' if expanded_by_default?), data: { qa_selector: 'sentry_settings_content' } } .settings-header %h4 diff --git a/app/views/admin/broadcast_messages/_form.html.haml b/app/views/admin/broadcast_messages/_form.html.haml index 4102918931f..dfd3b87c674 100644 --- a/app/views/admin/broadcast_messages/_form.html.haml +++ b/app/views/admin/broadcast_messages/_form.html.haml @@ -29,7 +29,7 @@ = f.label :starts_at, _("Dismissable") .col-sm-10 = f.gitlab_ui_checkbox_component :dismissable, _('Allow users to dismiss the broadcast message') - - if Feature.enabled?(:role_targeted_broadcast_messages, default_enabled: :yaml) + - if Feature.enabled?(:role_targeted_broadcast_messages) .form-group.row .col-sm-2.col-form-label = f.label :target_access_levels, _('Target roles') diff --git a/app/views/admin/broadcast_messages/index.html.haml b/app/views/admin/broadcast_messages/index.html.haml index 54c2a9d5250..8b657eda0c0 100644 --- a/app/views/admin/broadcast_messages/index.html.haml +++ b/app/views/admin/broadcast_messages/index.html.haml @@ -1,6 +1,6 @@ - breadcrumb_title _("Messages") - page_title _("Broadcast Messages") -- targeted_broadcast_messages_enabled = Feature.enabled?(:role_targeted_broadcast_messages, default_enabled: :yaml) +- targeted_broadcast_messages_enabled = Feature.enabled?(:role_targeted_broadcast_messages) %h3.page-title = _('Broadcast Messages') diff --git a/app/views/clusters/clusters/show.html.haml b/app/views/clusters/clusters/show.html.haml index fb46b4e5064..58e0ef96333 100644 --- a/app/views/clusters/clusters/show.html.haml +++ b/app/views/clusters/clusters/show.html.haml @@ -28,14 +28,6 @@ = render 'banner' - .gl-alert.gl-alert-warning{ role: 'alert' } - = sprite_icon('warning', css_class: "gl-alert-icon gl-alert-icon-no-title gl-icon") - %button.js-close.gl-alert-dismiss{ type: 'button', 'aria-label' => _('Dismiss'), data: { testid: 'dismiss-one-click-application-removal' } } - = sprite_icon('close', css_class: 'gl-icon') - .gl-alert-body - = s_('ClusterApplicationsRemoved|One-click application management was removed in GitLab 14.0. Your applications are still installed in your cluster, and integrations continue working.') - = link_to _('More information.'), help_page_path("user/clusters/applications"), target: '_blank', rel: 'noopener noreferrer' - - if cluster_created?(@cluster) .js-toggle-container = gl_tabs_nav do diff --git a/app/views/dashboard/todos/index.html.haml b/app/views/dashboard/todos/index.html.haml index 1d711f366c4..4f6ddf10984 100644 --- a/app/views/dashboard/todos/index.html.haml +++ b/app/views/dashboard/todos/index.html.haml @@ -70,6 +70,8 @@ = sort_title_recently_created = link_to todos_filter_path(sort: sort_value_oldest_created) do = sort_title_oldest_created + = link_to todos_filter_path(sort: sort_value_recently_updated) do + = sort_title_recently_updated .row.js-todos-all - if @allowed_todos.any? diff --git a/app/views/groups/dependency_proxies/show.html.haml b/app/views/groups/dependency_proxies/show.html.haml index 940a504438d..5b782c9f351 100644 --- a/app/views/groups/dependency_proxies/show.html.haml +++ b/app/views/groups/dependency_proxies/show.html.haml @@ -1,6 +1,6 @@ - page_title _("Dependency Proxy") - @content_class = "limit-container-width" unless fluid_layout -- dependency_proxy_available = Feature.enabled?(:dependency_proxy_for_private_groups, default_enabled: true) || @group.public? +- dependency_proxy_available = Feature.enabled?(:dependency_proxy_for_private_groups) || @group.public? #js-dependency-proxy{ data: { group_path: @group.full_path, dependency_proxy_available: dependency_proxy_available.to_s, diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml index 8afa6316c56..209faa937dc 100644 --- a/app/views/groups/issues.html.haml +++ b/app/views/groups/issues.html.haml @@ -5,7 +5,7 @@ = content_for :meta_tags do = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{@group.name} issues") -- if Feature.enabled?(:vue_issues_list, @group, default_enabled: :yaml) +- if Feature.enabled?(:vue_issues_list, @group) .js-issues-list{ data: group_issues_list_data(@group, current_user) } - if @can_bulk_update = render_if_exists 'shared/issuable/group_bulk_update_sidebar', group: @group, type: :issues diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml index 750030601b7..58a78a8adc1 100644 --- a/app/views/groups/new.html.haml +++ b/app/views/groups/new.html.haml @@ -15,7 +15,7 @@ #import-group-pane.tab-pane - if import_sources_enabled? - - if Feature.enabled?(:bulk_import, default_enabled: :yaml) + - if Feature.enabled?(:bulk_import) = render 'import_group_from_another_instance_panel' .gl-mt-7.gl-border-b-solid.gl-border-gray-100.gl-border-1 = render 'import_group_from_file_panel' diff --git a/app/views/groups/settings/packages_and_registries/show.html.haml b/app/views/groups/settings/packages_and_registries/show.html.haml index 78ce981eb07..e482b87bade 100644 --- a/app/views/groups/settings/packages_and_registries/show.html.haml +++ b/app/views/groups/settings/packages_and_registries/show.html.haml @@ -1,7 +1,7 @@ - breadcrumb_title _('Packages & Registries') - page_title _('Packages & Registries') - @content_class = 'limit-container-width' unless fluid_layout -- dependency_proxy_available = Feature.enabled?(:dependency_proxy_for_private_groups, default_enabled: true) || @group.public? +- dependency_proxy_available = Feature.enabled?(:dependency_proxy_for_private_groups) || @group.public? %section#js-packages-and-registries-settings{ data: { default_expanded: expanded_by_default?.to_s, group_path: @group.full_path, diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 3d62683da43..c1154faae44 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -39,7 +39,7 @@ - search_menu_item = top_nav_search_menu_item_attrs %li.nav-item.header-search-new.d-none.d-lg-block.m-auto - unless current_controller?(:search) - - if Feature.enabled?(:new_header_search, default_enabled: :yaml) + - if Feature.enabled?(:new_header_search) = render 'layouts/header_search' - else = render 'layouts/search' diff --git a/app/views/profiles/_email_settings.html.haml b/app/views/profiles/_email_settings.html.haml index 1057e96f442..35cad79b6fd 100644 --- a/app/views/profiles/_email_settings.html.haml +++ b/app/views/profiles/_email_settings.html.haml @@ -5,15 +5,34 @@ - help_text = email_change_disabled ? s_("Your account uses dedicated credentials for the \"%{group_name}\" group and can only be updated through SSO.") % { group_name: @user.managing_group.name } : read_only_help_text - password_automatically_set = @user.password_automatically_set? -= form.text_field :email, required: true, class: 'input-lg gl-form-input', value: (@user.email unless @user.temp_oauth_email?), help: help_text.html_safe, readonly: readonly || email_change_disabled -- unless password_automatically_set - = hidden_field_tag 'user[validation_password]', :validation_password, class: 'js-password-prompt-field', help: s_("Profiles|Enter your password to confirm the email change") -= form.select :public_email, options_for_select(@user.public_verified_emails, selected: @user.public_email), - { help: s_("Profiles|This email will be displayed on your public profile"), include_blank: s_("Profiles|Do not show on profile") }, - control_class: 'select2 input-lg', disabled: email_change_disabled -- commit_email_link_url = help_page_path('user/profile/index', anchor: 'change-the-email-displayed-on-your-commits', target: '_blank') -- commit_email_link_start = '<a href="%{url}">'.html_safe % { url: commit_email_link_url } -- commit_email_docs_link = s_('Profiles|This email will be used for web based operations, such as edits and merges. %{commit_email_link_start}Learn more%{commit_email_link_end}').html_safe % { commit_email_link_start: commit_email_link_start, commit_email_link_end: '</a>'.html_safe } -= form.select :commit_email, options_for_select(commit_email_select_options(@user), selected: @user.commit_email), - { help: commit_email_docs_link }, - control_class: 'select2 input-lg', disabled: email_change_disabled +.form-group.gl-form-group + = form.label :email, _('Email') + = form.text_field :email, required: true, class: 'gl-form-input form-control gl-form-input-lg', value: (@user.email unless @user.temp_oauth_email?), readonly: readonly || email_change_disabled + %small.form-text.text-gl-muted + = help_text.html_safe + + - unless password_automatically_set + = hidden_field_tag 'user[validation_password]', :validation_password, class: 'js-password-prompt-field', help: s_("Profiles|Enter your password to confirm the email change") + +.form-group.gl-form-group + = form.label :public_email, s_('Profiles|Public email') + .gl-form-input-lg + = form.select :public_email, + options_for_select(@user.public_verified_emails, selected: @user.public_email), + { include_blank: s_("Profiles|Do not show on profile") }, + { class: 'gl-form-select custom-select', disabled: email_change_disabled } + %small.form-text.text-gl-muted + = s_("Profiles|This email will be displayed on your public profile") + +.form-group.gl-form-group + - commit_email_link_url = help_page_path('user/profile/index', anchor: 'change-the-email-displayed-on-your-commits', target: '_blank') + - commit_email_link_start = '<a href="%{url}">'.html_safe % { url: commit_email_link_url } + - commit_email_docs_link = s_('Profiles|This email will be used for web based operations, such as edits and merges. %{commit_email_link_start}Learn more%{commit_email_link_end}').html_safe % { commit_email_link_start: commit_email_link_start, commit_email_link_end: '</a>'.html_safe } + = form.label :commit_email, s_('Profiles|Commit email') + .gl-form-input-lg + = form.select :commit_email, + options_for_select(commit_email_select_options(@user), selected: @user.commit_email), + {}, + { class: 'gl-form-select custom-select', disabled: email_change_disabled } + %small.form-text.text-gl-muted + = commit_email_docs_link diff --git a/app/views/profiles/_name.html.haml b/app/views/profiles/_name.html.haml index aea38bf4c3b..5af4fe24d62 100644 --- a/app/views/profiles/_name.html.haml +++ b/app/views/profiles/_name.html.haml @@ -1,5 +1,9 @@ += form.label :name, s_('Profiles|Full name') - if user.read_only_attribute?(:name) - = form.text_field :name, class: 'gl-form-input', required: true, readonly: true, wrapper: { class: 'col-md-9 qa-full-name rspec-full-name' }, - help: s_("Profiles|Your name was automatically set based on your %{provider_label} account, so people you know can recognize you") % { provider_label: attribute_provider_label(:name) } + = form.text_field :name, class: 'gl-form-input form-control', required: true, readonly: true + %small.form-text.text-gl-muted + = s_("Profiles|Your name was automatically set based on your %{provider_label} account, so people you know can recognize you") % { provider_label: attribute_provider_label(:name) } - else - = form.text_field :name, class: 'gl-form-input', label: s_('Profiles|Full name'), required: true, title: s_("Profiles|Using emojis in names seems fun, but please try to set a status message instead"), wrapper: { class: 'col-md-9 qa-full-name rspec-full-name' }, help: s_("Profiles|Enter your name, so people you know can recognize you") + = form.text_field :name, class: 'gl-form-input form-control', required: true, title: s_("Profiles|Using emojis in names seems fun, but please try to set a status message instead") + %small.form-text.text-gl-muted + = s_("Profiles|Enter your name, so people you know can recognize you") diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 531e72b7cc2..107c7cebc61 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -5,7 +5,7 @@ - availability = availability_values - custom_emoji = show_status_emoji?(@user.status) -= bootstrap_form_for @user, url: profile_path, method: :put, html: { multipart: true, class: 'edit-user gl-mt-3 js-quick-submit gl-show-field-errors js-password-prompt-form', remote: true }, authenticity_token: true do |f| += gitlab_ui_form_for @user, url: profile_path, method: :put, html: { multipart: true, class: 'edit-user gl-mt-3 js-quick-submit gl-show-field-errors js-password-prompt-form', remote: true }, authenticity_token: true do |f| = form_errors(@user) .row.js-search-settings-section @@ -34,7 +34,7 @@ .gl-my-3 %button.gl-button.btn.btn-default.js-choose-user-avatar-button{ type: 'button' }= s_("Profiles|Choose file...") %span.avatar-file-name.gl-ml-3.js-avatar-filename= s_("Profiles|No file chosen.") - = f.file_field_without_bootstrap :avatar, class: 'js-user-avatar-input hidden', accept: 'image/*' + = f.file_field :avatar, class: 'js-user-avatar-input hidden', accept: 'image/*' .gl-text-gray-500= s_("Profiles|The maximum file size allowed is 200KB.") - if @user.avatar? = link_to s_("Profiles|Remove avatar"), profile_avatar_path, data: { confirm: s_("Profiles|Avatar will be removed. Are you sure?") }, method: :delete, class: 'gl-button btn btn-danger-secondary btn-sm gl-mt-5' @@ -62,16 +62,24 @@ = sprite_icon("close") = status_form.hidden_field :emoji, id: 'js-status-emoji-field' - = status_form.text_field :message, - id: 'js-status-message-field', - class: 'form-control gl-form-input input-lg', - label: s_("Profiles|Your status"), - prepend: emoji_button, - append: reset_message_button, - placeholder: s_("Profiles|What's your status?") - .checkbox-icon-inline-wrapper - = status_form.check_box :availability, { data: { testid: "user-availability-checkbox" }, label: s_("Profiles|Busy"), wrapper_class: 'gl-mr-0 gl-font-weight-bold' }, availability["busy"], availability["not_set"] - .gl-text-gray-600.gl-ml-5= s_('Profiles|An indicator appears next to your name and avatar') + .form-group.gl-form-group + = status_form.label :message, s_("Profiles|Your status") + .input-group{ role: 'group' } + .input-group-prepend + = emoji_button + = status_form.text_field :message, + id: 'js-status-message-field', + class: 'form-control gl-form-input input-lg', + placeholder: s_("Profiles|What's your status?") + .input-group-append + = reset_message_button + .form-group.gl-form-group + = status_form.gitlab_ui_checkbox_component :availability, + s_("Profiles|Busy"), + help_text: s_('Profiles|An indicator appears next to your name and avatar'), + checkbox_options: { data: { testid: "user-availability-checkbox" } }, + checked_value: availability["busy"], + unchecked_value: availability["not_set"] .col-lg-12 %hr .row.user-time-preferences.js-search-settings-section @@ -94,35 +102,71 @@ = s_("Profiles|Some options are unavailable for LDAP accounts") .col-lg-8 .row - = render 'profiles/name', form: f, user: @user - = f.text_field :id, class: 'gl-form-input', readonly: true, label: s_('Profiles|User ID'), wrapper: { class: 'col-md-3' } - - = f.text_field :pronouns, label: s_('Profiles|Pronouns'), class: 'input-md gl-form-input', help: s_("Profiles|Enter your pronouns to let people know how to refer to you") - = f.text_field :pronunciation, label: s_('Profiles|Pronunciation'), class: 'input-md gl-form-input', help: s_("Profiles|Enter how your name is pronounced to help people address you correctly") + .form-group.gl-form-group.col-md-9.rspec-full-name + = render 'profiles/name', form: f, user: @user + .form-group.gl-form-group.col-md-3 + = f.label :id, s_('Profiles|User ID') + = f.text_field :id, class: 'gl-form-input form-control', readonly: true + .form-group.gl-form-group + = f.label :pronouns, s_('Profiles|Pronouns') + = f.text_field :pronouns, class: 'gl-form-input form-control gl-form-input-lg' + %small.form-text.text-gl-muted + = s_("Profiles|Enter your pronouns to let people know how to refer to you") + .form-group.gl-form-group + = f.label :pronunciation, s_('Profiles|Pronunciation') + = f.text_field :pronunciation, class: 'gl-form-input form-control gl-form-input-lg' + %small.form-text.text-gl-muted + = s_("Profiles|Enter how your name is pronounced to help people address you correctly") = render_if_exists 'profiles/extra_settings', form: f = render_if_exists 'profiles/email_settings', form: f - = f.text_field :skype, class: 'input-md gl-form-input', placeholder: s_("Profiles|username") - = f.text_field :linkedin, class: 'input-md gl-form-input', help: s_("Profiles|Your LinkedIn profile name from linkedin.com/in/profilename") - = f.text_field :twitter, class: 'input-md gl-form-input', placeholder: s_("Profiles|@username") - = f.text_field :website_url, label: s_('Profiles|Website url'), class: 'input-lg gl-form-input', placeholder: s_("Profiles|https://website.com") - - if @user.read_only_attribute?(:location) - = f.text_field :location, class: 'gl-form-input', readonly: true, help: s_("Profiles|Your location was automatically set based on your %{provider_label} account") % { provider_label: attribute_provider_label(:location) } - - else - = f.text_field :location, label: s_('Profiles|Location'), class: 'input-lg gl-form-input', placeholder: s_("Profiles|City, country") - = f.text_field :job_title, label: s_('Profiles|Job title'), class: 'input-md gl-form-input' - = f.text_field :organization, label: s_('Profiles|Organization'), class: 'input-md gl-form-input', help: s_("Profiles|Who you represent or work for") - = f.text_area :bio, class: 'gl-form-input', label: s_('Profiles|Bio'), rows: 4, maxlength: 250, help: s_("Profiles|Tell us about yourself in fewer than 250 characters") + .form-group.gl-form-group + = f.label :skype + = f.text_field :skype, class: 'gl-form-input form-control gl-form-input-lg', placeholder: s_("Profiles|username") + .form-group.gl-form-group + = f.label :linkedin + = f.text_field :linkedin, class: 'gl-form-input form-control gl-form-input-lg' + %small.form-text.text-gl-muted + = s_("Profiles|Your LinkedIn profile name from linkedin.com/in/profilename") + .form-group.gl-form-group + = f.label :twitter + = f.text_field :twitter, class: 'gl-form-input form-control gl-form-input-lg', placeholder: s_("Profiles|@username") + .form-group.gl-form-group + = f.label :website_url, s_('Profiles|Website url') + = f.text_field :website_url, class: 'gl-form-input form-control gl-form-input-lg', placeholder: s_("Profiles|https://website.com") + .form-group.gl-form-group + = f.label :location, s_('Profiles|Location') + - if @user.read_only_attribute?(:location) + = f.text_field :location, class: 'gl-form-input form-control gl-form-input-lg', readonly: true + %small.form-text.text-gl-muted + = s_("Profiles|Your location was automatically set based on your %{provider_label} account") % { provider_label: attribute_provider_label(:location) } + - else + = f.text_field :location, class: 'gl-form-input form-control gl-form-input-lg', placeholder: s_("Profiles|City, country") + .form-group.gl-form-group + = f.label :job_title, s_('Profiles|Job title') + = f.text_field :job_title, class: 'gl-form-input form-control gl-form-input-lg' + .form-group.gl-form-group + = f.label :organization, s_('Profiles|Organization') + = f.text_field :organization, class: 'gl-form-input form-control gl-form-input-lg' + %small.form-text.text-gl-muted + = s_("Profiles|Who you represent or work for") + .form-group.gl-form-group + = f.label :bio, s_('Profiles|Bio') + = f.text_area :bio, class: 'gl-form-input gl-form-textarea form-control', rows: 4, maxlength: 250 + %small.form-text.text-gl-muted + = s_("Profiles|Tell us about yourself in fewer than 250 characters") %hr - %h5= _('Private profile') - .checkbox-icon-inline-wrapper - - private_profile_label = capture do - = s_("Profiles|Don't display activity-related personal information on your profile") - = f.check_box :private_profile, label: private_profile_label, inline: true, wrapper_class: 'mr-0' - = link_to sprite_icon('question-o'), help_page_path('user/profile/index.md', anchor: 'make-your-user-profile-page-private') - %h5= s_("Profiles|Private contributions") - = f.check_box :include_private_contributions, label: s_('Profiles|Include private contributions on my profile'), wrapper_class: 'mb-2', inline: true - .help-block - = s_("Profiles|Choose to show contributions of private projects on your public profile without any project, repository or organization information") + %fieldset.form-group.gl-form-group + %legend.col-form-label.col-form-label + = _('Private profile') + - private_profile_label = s_("Profiles|Don't display activity-related personal information on your profile") + - private_profile_help_link = link_to sprite_icon('question-o'), help_page_path('user/profile/index.md', anchor: 'make-your-user-profile-page-private') + = f.gitlab_ui_checkbox_component :private_profile, '%{private_profile_label} %{private_profile_help_link}'.html_safe % { private_profile_label: private_profile_label, private_profile_help_link: private_profile_help_link.html_safe } + %fieldset.form-group.gl-form-group + %legend.col-form-label.col-form-label + = s_("Profiles|Private contributions") + = f.gitlab_ui_checkbox_component :include_private_contributions, + s_('Profiles|Include private contributions on my profile'), + help_text: s_("Profiles|Choose to show contributions of private projects on your public profile without any project, repository or organization information") %hr = f.submit s_("Profiles|Update profile settings"), class: 'gl-button btn btn-confirm gl-mr-3 js-password-prompt-btn' = link_to _("Cancel"), user_path(current_user), class: 'gl-button btn btn-default btn-cancel' diff --git a/app/views/profiles/two_factor_auths/show.html.haml b/app/views/profiles/two_factor_auths/show.html.haml index b85b7841d55..ace644a493b 100644 --- a/app/views/profiles/two_factor_auths/show.html.haml +++ b/app/views/profiles/two_factor_auths/show.html.haml @@ -2,7 +2,7 @@ - page_title _('Two-Factor Authentication'), _('Account') - add_to_breadcrumbs _('Account'), profile_account_path - @content_class = "limit-container-width" unless fluid_layout -- webauthn_enabled = Feature.enabled?(:webauthn, default_enabled: :yaml) +- webauthn_enabled = Feature.enabled?(:webauthn) .js-two-factor-auth{ 'data-two-factor-skippable' => "#{two_factor_skippable?}", 'data-two_factor_skip_url' => skip_profile_two_factor_auth_path } .row.gl-mt-3 diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index e896ad38780..eee9cfe0618 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -1,7 +1,7 @@ - empty_repo = @project.empty_repo? - show_auto_devops_callout = show_auto_devops_callout?(@project) - emails_disabled = @project.emails_disabled? -- cache_enabled = Feature.enabled?(:cache_home_panel, @project, type: :development, default_enabled: :yaml) +- cache_enabled = Feature.enabled?(:cache_home_panel, @project, type: :development) .project-home-panel.js-show-on-project-root.gl-my-5{ class: [("empty-project" if empty_repo)] } .gl-display-flex.gl-justify-content-space-between.gl-flex-wrap.gl-sm-flex-direction-column.gl-mb-3 diff --git a/app/views/projects/blob/_blob.html.haml b/app/views/projects/blob/_blob.html.haml index 85b9a69ab4c..2c3aade1068 100644 --- a/app/views/projects/blob/_blob.html.haml +++ b/app/views/projects/blob/_blob.html.haml @@ -14,7 +14,7 @@ #blob-content-holder.blob-content-holder - if @code_navigation_path #js-code-navigation{ data: { code_navigation_path: @code_navigation_path, blob_path: blob.path, definition_path_prefix: project_blob_path(@project, @ref) } } - - if Feature.enabled?(:refactor_blob_viewer, @project, default_enabled: :yaml) && !expanded + - if Feature.enabled?(:refactor_blob_viewer, @project) && !expanded -# Data info will be removed once we migrate this to use GraphQL -# Follow-up issue: https://gitlab.com/gitlab-org/gitlab/-/issues/330406 #js-view-blob-app{ data: { blob_path: blob.path, diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml index 85a0346e691..295b2de9bd2 100644 --- a/app/views/projects/branches/index.html.haml +++ b/app/views/projects/branches/index.html.haml @@ -39,7 +39,7 @@ %ul.content-list.all-branches - @branches.each do |branch| = render "projects/branches/branch", branch: branch, merged: @merged_branch_names.include?(branch.name), commit_status: @branch_pipeline_statuses[branch.name], show_commit_status: @branch_pipeline_statuses.any? - - if Feature.enabled?(:branch_list_keyset_pagination, @project, default_enabled: :yaml) + - if Feature.enabled?(:branch_list_keyset_pagination, @project) = render('kaminari/gitlab/without_count', previous_path: @prev_path, next_path: @next_path) - else = paginate @branches, theme: 'gitlab' diff --git a/app/views/projects/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml index f887a4c744e..c6fb3bcd559 100644 --- a/app/views/projects/commits/_commits.html.haml +++ b/app/views/projects/commits/_commits.html.haml @@ -14,7 +14,7 @@ %li.commits-row{ data: { day: day } } %ul.content-list.commit-list.flex-list - - if Feature.enabled?(:cached_commits, project, default_enabled: :yaml) + - if Feature.enabled?(:cached_commits, project) = render partial: 'projects/commits/commit', collection: daily_commits, locals: { project: project, ref: ref, merge_request: merge_request }, cached: -> (commit) { commit_partial_cache_key(commit, ref: ref, merge_request: merge_request, request: request) } - else = render partial: 'projects/commits/commit', collection: daily_commits, locals: { project: project, ref: ref, merge_request: merge_request } @@ -28,7 +28,7 @@ %li.commits-row %ul.content-list.commit-list.flex-list - - if Feature.enabled?(:cached_commits, project, default_enabled: :yaml) + - if Feature.enabled?(:cached_commits, project) = render partial: 'projects/commits/commit', collection: context_commits, locals: { project: project, ref: ref, merge_request: merge_request }, cached: -> (commit) { commit_partial_cache_key(commit, ref: ref, merge_request: merge_request, request: request) } - else = render partial: 'projects/commits/commit', collection: context_commits, locals: { project: project, ref: ref, merge_request: merge_request } diff --git a/app/views/projects/diffs/_text_file.html.haml b/app/views/projects/diffs/_text_file.html.haml index 2cd215c5518..9b64afa8c60 100644 --- a/app/views/projects/diffs/_text_file.html.haml +++ b/app/views/projects/diffs/_text_file.html.haml @@ -4,7 +4,7 @@ %a.show-suppressed-diff.cursor-pointer.js-show-suppressed-diff= _("Changes suppressed. Click to show.") %table.text-file.diff-wrap-lines.code.code-commit.js-syntax-highlight.commit-diff{ data: diff_view_data, class: too_big ? 'hide' : '' } - - if Feature.enabled?(:inline_haml_diff_line_rendering, @project, default_enabled: :yaml) + - if Feature.enabled?(:inline_haml_diff_line_rendering, @project) - diff_file.highlighted_diff_lines.each do |line| - line_code = diff_file.line_code(line) diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index f1c19756474..a904b53515c 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -1,4 +1,4 @@ -- add_page_startup_api_call Feature.enabled?(:paginated_issue_discussions, @project, default_enabled: :yaml) ? discussions_path(@issue, per_page: 20) : discussions_path(@issue) +- add_page_startup_api_call Feature.enabled?(:paginated_issue_discussions, @project) ? discussions_path(@issue, per_page: 20) : discussions_path(@issue) - @gfm_form = true diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml index d74b6c0639c..fe2be0f73c9 100644 --- a/app/views/projects/issues/index.html.haml +++ b/app/views/projects/issues/index.html.haml @@ -13,7 +13,7 @@ issues_path: project_issues_path(@project), project_path: @project.full_path } } -- if Feature.enabled?(:vue_issues_list, @project&.group, default_enabled: :yaml) +- if Feature.enabled?(:vue_issues_list, @project&.group) .js-issues-list{ data: project_issues_list_data(@project, current_user) } - if @can_bulk_update = render 'shared/issuable/bulk_update_sidebar', type: :issues diff --git a/app/views/projects/jobs/index.html.haml b/app/views/projects/jobs/index.html.haml index 9a2a1e57165..e725e8e6889 100644 --- a/app/views/projects/jobs/index.html.haml +++ b/app/views/projects/jobs/index.html.haml @@ -4,7 +4,7 @@ - add_page_specific_style 'page_bundles/ci_status' - admin = local_assigns.fetch(:admin, false) -- if Feature.enabled?(:jobs_table_vue, @project, default_enabled: :yaml) +- if Feature.enabled?(:jobs_table_vue, @project) #js-jobs-table{ data: { admin: admin, full_path: @project.full_path, job_statuses: job_statuses.to_json, pipeline_editor_path: project_ci_pipeline_editor_path(@project), empty_state_svg_path: image_path('jobs-empty-state.svg') } } - else .top-area diff --git a/app/views/projects/pipelines/show.html.haml b/app/views/projects/pipelines/show.html.haml index 2b0a0fc1253..30b224a60da 100644 --- a/app/views/projects/pipelines/show.html.haml +++ b/app/views/projects/pipelines/show.html.haml @@ -27,7 +27,7 @@ = s_('You can also test your %{gitlab_ci_yml} in %{lint_link_start}CI Lint%{lint_link_end}').html_safe % { gitlab_ci_yml: '.gitlab-ci.yml', lint_link_start: lint_link_start, lint_link_end: '</a>'.html_safe } #js-pipeline-notification{ data: { deprecated_keywords_doc_path: help_page_path('ci/yaml/index.md', anchor: 'deprecated-keywords'), full_path: @project.full_path, pipeline_iid: @pipeline.iid } } - - if Feature.enabled?(:pipeline_tabs_vue, @project, default_enabled: :yaml) + - if Feature.enabled?(:pipeline_tabs_vue, @project) #js-pipeline-tabs{ data: js_pipeline_tabs_data(@project, @pipeline) } - else = render "projects/pipelines/with_tabs", pipeline: @pipeline, stages: @stages, pipeline_has_errors: pipeline_has_errors diff --git a/app/workers/ci/build_finished_worker.rb b/app/workers/ci/build_finished_worker.rb index 70c234bd4c7..2d7f3a67004 100644 --- a/app/workers/ci/build_finished_worker.rb +++ b/app/workers/ci/build_finished_worker.rb @@ -61,7 +61,7 @@ module Ci end def archive_trace_worker_class(build) - if Feature.enabled?(:ci_build_finished_worker_namespace_changed, build.project, default_enabled: :yaml) + if Feature.enabled?(:ci_build_finished_worker_namespace_changed, build.project) Ci::ArchiveTraceWorker else ::ArchiveTraceWorker diff --git a/app/workers/concerns/git_garbage_collect_methods.rb b/app/workers/concerns/git_garbage_collect_methods.rb index 308ffacfc6b..fd5094b3014 100644 --- a/app/workers/concerns/git_garbage_collect_methods.rb +++ b/app/workers/concerns/git_garbage_collect_methods.rb @@ -83,7 +83,7 @@ module GitGarbageCollectMethods def gitaly_call(task, resource) repository = resource.repository.raw_repository - if Feature.enabled?(:optimized_housekeeping, container(resource), default_enabled: :yaml) + if Feature.enabled?(:optimized_housekeeping, container(resource)) client = repository.gitaly_repository_client if task == :prune diff --git a/app/workers/concerns/worker_attributes.rb b/app/workers/concerns/worker_attributes.rb index 8f7a3da5429..5d7251e9a98 100644 --- a/app/workers/concerns/worker_attributes.rb +++ b/app/workers/concerns/worker_attributes.rb @@ -104,7 +104,7 @@ module WorkerAttributes def get_data_consistency_feature_flag_enabled? return true unless class_attributes[:data_consistency_feature_flag] - Feature.enabled?(class_attributes[:data_consistency_feature_flag], default_enabled: :yaml) + Feature.enabled?(class_attributes[:data_consistency_feature_flag]) end # Set this attribute on a job when it will call to services outside of the @@ -175,7 +175,7 @@ module WorkerAttributes def deduplication_enabled? return true unless get_deduplication_options[:feature_flag] - Feature.enabled?(get_deduplication_options[:feature_flag], default_enabled: :yaml) + Feature.enabled?(get_deduplication_options[:feature_flag]) end def big_payload! diff --git a/app/workers/database/batched_background_migration/ci_database_worker.rb b/app/workers/database/batched_background_migration/ci_database_worker.rb index 13314cf95e2..ee9cbba7076 100644 --- a/app/workers/database/batched_background_migration/ci_database_worker.rb +++ b/app/workers/database/batched_background_migration/ci_database_worker.rb @@ -5,7 +5,7 @@ module Database include SingleDatabaseWorker def self.enabled? - Feature.enabled?(:execute_batched_migrations_on_schedule_ci_database, type: :ops, default_enabled: :yaml) + Feature.enabled?(:execute_batched_migrations_on_schedule_ci_database, type: :ops) end def self.tracking_database diff --git a/app/workers/database/batched_background_migration_worker.rb b/app/workers/database/batched_background_migration_worker.rb index 6a41fe70915..31208d7a473 100644 --- a/app/workers/database/batched_background_migration_worker.rb +++ b/app/workers/database/batched_background_migration_worker.rb @@ -5,7 +5,7 @@ module Database include BatchedBackgroundMigration::SingleDatabaseWorker def self.enabled? - Feature.enabled?(:execute_batched_migrations_on_schedule, type: :ops, default_enabled: :yaml) + Feature.enabled?(:execute_batched_migrations_on_schedule, type: :ops) end def self.tracking_database diff --git a/app/workers/gitlab/github_import/stage/import_issues_and_diff_notes_worker.rb b/app/workers/gitlab/github_import/stage/import_issues_and_diff_notes_worker.rb index 5188bda03e2..34996b710d4 100644 --- a/app/workers/gitlab/github_import/stage/import_issues_and_diff_notes_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_issues_and_diff_notes_worker.rb @@ -36,7 +36,7 @@ module Gitlab private def diff_notes_importer(project) - if project.group.present? && Feature.enabled?(:github_importer_single_endpoint_notes_import, project.group, type: :ops, default_enabled: :yaml) + if project.group.present? && Feature.enabled?(:github_importer_single_endpoint_notes_import, project.group, type: :ops) Importer::SingleEndpointDiffNotesImporter else Importer::DiffNotesImporter diff --git a/app/workers/gitlab/github_import/stage/import_notes_worker.rb b/app/workers/gitlab/github_import/stage/import_notes_worker.rb index 90a1337169f..167b3e147a3 100644 --- a/app/workers/gitlab/github_import/stage/import_notes_worker.rb +++ b/app/workers/gitlab/github_import/stage/import_notes_worker.rb @@ -29,7 +29,7 @@ module Gitlab end def importers(project) - if project.group.present? && Feature.enabled?(:github_importer_single_endpoint_notes_import, project.group, type: :ops, default_enabled: :yaml) + if project.group.present? && Feature.enabled?(:github_importer_single_endpoint_notes_import, project.group, type: :ops) [ Importer::SingleEndpointMergeRequestNotesImporter, Importer::SingleEndpointIssueNotesImporter diff --git a/app/workers/merge_request_cleanup_refs_worker.rb b/app/workers/merge_request_cleanup_refs_worker.rb index 27bd5774b8d..db6f4649f47 100644 --- a/app/workers/merge_request_cleanup_refs_worker.rb +++ b/app/workers/merge_request_cleanup_refs_worker.rb @@ -18,7 +18,7 @@ class MergeRequestCleanupRefsWorker FAILURE_THRESHOLD = 3 def perform_work - return unless Feature.enabled?(:merge_request_refs_cleanup, default_enabled: false) + return unless Feature.enabled?(:merge_request_refs_cleanup) unless merge_request logger.error('No existing merge request to be cleaned up.') diff --git a/app/workers/schedule_merge_request_cleanup_refs_worker.rb b/app/workers/schedule_merge_request_cleanup_refs_worker.rb index 58cd8f7ade3..b3d0067471a 100644 --- a/app/workers/schedule_merge_request_cleanup_refs_worker.rb +++ b/app/workers/schedule_merge_request_cleanup_refs_worker.rb @@ -12,7 +12,7 @@ class ScheduleMergeRequestCleanupRefsWorker def perform return if Gitlab::Database.read_only? - return unless Feature.enabled?(:merge_request_refs_cleanup, default_enabled: false) + return unless Feature.enabled?(:merge_request_refs_cleanup) MergeRequestCleanupRefsWorker.perform_with_capacity end |