Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-05-06 15:09:03 +00:00
parent 669ad9e431
commit 67fa8362ae
327 changed files with 1449 additions and 1969 deletions

View File

@ -200,11 +200,6 @@ Style/CaseLikeIf:
Style/EmptyMethod:
Enabled: false
# Offense count: 118
# Cop supports --auto-correct.
Style/ExplicitBlockArgument:
Enabled: false
# Offense count: 581
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
@ -224,11 +219,6 @@ Style/HashAsLastArrayItem:
Style/HashEachMethods:
Enabled: false
# Offense count: 34
# Configuration parameters: AllowIfModifier.
Style/IfInsideElse:
Enabled: false
# Offense count: 64
# Cop supports --auto-correct.
Style/KeywordParametersOrder:

View File

@ -0,0 +1,114 @@
---
# Cop supports --auto-correct.
Style/ExplicitBlockArgument:
# Offense count: 143
# Temporarily disabled due to too many offenses
Enabled: false
Exclude:
- 'app/controllers/admin/background_migrations_controller.rb'
- 'app/controllers/application_controller.rb'
- 'app/models/application_record.rb'
- 'app/models/broadcast_message.rb'
- 'app/models/ci/build.rb'
- 'app/models/ci/build_trace_chunks/redis.rb'
- 'app/models/ci/build_trace_chunks/redis_trace_chunks.rb'
- 'app/models/concerns/counter_attribute.rb'
- 'app/models/merge_request.rb'
- 'app/models/snippet_repository.rb'
- 'app/services/import_export_clean_up_service.rb'
- 'app/services/issuable/clone/attributes_rewriter.rb'
- 'app/services/packages/debian/generate_distribution_key_service.rb'
- 'app/workers/concerns/each_shard_worker.rb'
- 'db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb'
- 'ee/app/services/gitlab_subscriptions/fetch_subscription_plans_service.rb'
- 'ee/app/services/group_saml/identity/destroy_service.rb'
- 'ee/lib/ee/backup/repositories.rb'
- 'ee/lib/ee/gitlab/background_migration/migrate_approver_to_approval_rules.rb'
- 'ee/lib/gitlab/audit/events/preloader.rb'
- 'ee/lib/gitlab/ci/config/security_orchestration_policies/processor.rb'
- 'ee/lib/gitlab/ci/parsers/license_compliance/v1.rb'
- 'ee/lib/gitlab/geo.rb'
- 'ee/lib/gitlab/geo/event_gap_tracking.rb'
- 'ee/lib/gitlab/items_collection.rb'
- 'ee/spec/features/epic_boards/multiple_epic_boards_spec.rb'
- 'ee/spec/features/projects/security/user_views_security_configuration_spec.rb'
- 'ee/spec/support/helpers/ee/migrations_helpers.rb'
- 'lib/api/helpers/caching.rb'
- 'lib/api/internal/base.rb'
- 'lib/banzai/filter/references/reference_filter.rb'
- 'lib/banzai/request_store_reference_cache.rb'
- 'lib/gitlab/application_context.rb'
- 'lib/gitlab/authorized_keys.rb'
- 'lib/gitlab/cache.rb'
- 'lib/gitlab/ci/build/artifacts/metadata/entry.rb'
- 'lib/gitlab/ci/reports/test_suite.rb'
- 'lib/gitlab/ci/variables/collection.rb'
- 'lib/gitlab/cleanup/remote_uploads.rb'
- 'lib/gitlab/database/dynamic_model_helpers.rb'
- 'lib/gitlab/database/reindexing/reindex_concurrently.rb'
- 'lib/gitlab/git/changes.rb'
- 'lib/gitlab/gitaly_client/list_blobs_adapter.rb'
- 'lib/gitlab/gitaly_client/namespace_service.rb'
- 'lib/gitlab/gitaly_client/ref_service.rb'
- 'lib/gitlab/gitaly_client/storage_settings.rb'
- 'lib/gitlab/github_import/client.rb'
- 'lib/gitlab/graphql/tracers/application_context_tracer.rb'
- 'lib/gitlab/import_export/import_failure_service.rb'
- 'lib/gitlab/import_export/json/ndjson_writer.rb'
- 'lib/gitlab/import_export/json/streaming_serializer.rb'
- 'lib/gitlab/import_export/project/base_task.rb'
- 'lib/gitlab/import_export/project/export_task.rb'
- 'lib/gitlab/import_export/project/import_task.rb'
- 'lib/gitlab/metrics/dashboard/cache.rb'
- 'lib/gitlab/metrics/dashboard/stages/base_stage.rb'
- 'lib/gitlab/profiler.rb'
- 'lib/gitlab/redis/wrapper.rb'
- 'lib/gitlab/reference_counter.rb'
- 'lib/gitlab/seeder.rb'
- 'lib/gitlab/sidekiq_middleware/monitor.rb'
- 'lib/gitlab/sidekiq_middleware/query_analyzer.rb'
- 'lib/gitlab/sidekiq_middleware/request_store_middleware.rb'
- 'lib/gitlab/sidekiq_middleware/server_metrics.rb'
- 'lib/gitlab/utils/measuring.rb'
- 'lib/tasks/config_lint.rake'
- 'qa/qa/ee/page/insights/show.rb'
- 'qa/qa/ee/page/operations_dashboard.rb'
- 'qa/qa/ee/page/project/issue/show.rb'
- 'qa/qa/ee/page/project/show.rb'
- 'qa/qa/ee/page/project/wiki/show.rb'
- 'qa/qa/flow/login.rb'
- 'qa/qa/page/admin/menu.rb'
- 'qa/qa/page/base.rb'
- 'qa/qa/page/component/blob_content.rb'
- 'qa/qa/page/group/settings/group_deploy_tokens.rb'
- 'qa/qa/page/profile/menu.rb'
- 'qa/qa/page/project/settings/deploy_keys.rb'
- 'qa/qa/page/project/settings/deploy_tokens.rb'
- 'qa/qa/page/sub_menus/common.rb'
- 'qa/qa/resource/events/base.rb'
- 'qa/qa/runtime/api/repository_storage_moves.rb'
- 'qa/qa/runtime/search.rb'
- 'qa/qa/specs/features/browser_ui/3_create/repository/push_over_http_file_size_spec.rb'
- 'rubocop/code_reuse_helpers.rb'
- 'spec/features/merge_request/user_sees_wip_help_message_spec.rb'
- 'spec/features/projects/features_visibility_spec.rb'
- 'spec/lib/banzai/filter/repository_link_filter_spec.rb'
- 'spec/lib/gitlab/ci/config/external/file/project_spec.rb'
- 'spec/lib/gitlab/database/query_analyzers/restrict_allowed_schemas_spec.rb'
- 'spec/lib/gitlab/pagination/offset_pagination_spec.rb'
- 'spec/lib/gitlab/usage_data_spec.rb'
- 'spec/models/repository_spec.rb'
- 'spec/services/pages/zip_directory_service_spec.rb'
- 'spec/services/todo_service_spec.rb'
- 'spec/support/helpers/feature_flag_helpers.rb'
- 'spec/support/helpers/features/runner_helpers.rb'
- 'spec/support/helpers/features/top_nav_spec_helpers.rb'
- 'spec/support/helpers/graphql_helpers.rb'
- 'spec/support/helpers/modal_helpers.rb'
- 'spec/support/helpers/next_found_instance_of.rb'
- 'spec/support/helpers/usage_data_helpers.rb'
- 'spec/support/shared_contexts/finders/merge_requests_finder_shared_contexts.rb'
- 'spec/support/shared_contexts/lib/gitlab/sidekiq_logging/structured_logger_shared_context.rb'
- 'spec/support/shared_examples/boards/multiple_issue_boards_shared_examples.rb'
- 'spec/uploaders/object_storage_spec.rb'
- 'tooling/lib/tooling/helm3_client.rb'

View File

@ -0,0 +1,49 @@
---
Style/IfInsideElse:
# Offense count: 43
# Temporarily disabled due to too many offenses
Enabled: false
Exclude:
- 'app/controllers/application_controller.rb'
- 'app/controllers/passwords_controller.rb'
- 'app/finders/projects_finder.rb'
- 'app/finders/user_recent_events_finder.rb'
- 'app/helpers/diff_helper.rb'
- 'app/helpers/members_helper.rb'
- 'app/helpers/search_helper.rb'
- 'app/models/ci/build.rb'
- 'app/models/namespace.rb'
- 'app/presenters/project_presenter.rb'
- 'app/services/service_ping/build_payload_service.rb'
- 'app/services/system_notes/commit_service.rb'
- 'app/services/task_list_toggle_service.rb'
- 'app/services/user_project_access_changed_service.rb'
- 'app/uploaders/gitlab_uploader.rb'
- 'config/settings.rb'
- 'ee/app/controllers/ee/registrations/welcome_controller.rb'
- 'ee/app/controllers/groups/omniauth_callbacks_controller.rb'
- 'ee/app/models/ee/namespace.rb'
- 'ee/app/models/protected_environments/authorizable.rb'
- 'ee/app/policies/ee/group_policy.rb'
- 'ee/app/services/app_sec/dast/site_profiles/audit/update_service.rb'
- 'ee/app/services/deployments/approval_service.rb'
- 'ee/app/services/geo/framework_repository_sync_service.rb'
- 'ee/app/services/geo/repository_base_sync_service.rb'
- 'ee/app/services/gitlab_subscriptions/fetch_subscription_plans_service.rb'
- 'ee/app/services/vulnerability_external_issue_links/create_service.rb'
- 'ee/lib/gitlab/geo/base_batcher.rb'
- 'lib/api/projects.rb'
- 'lib/gitlab/auth.rb'
- 'lib/gitlab/conflict/file.rb'
- 'lib/gitlab/sql/pattern.rb'
- 'lib/gitlab/usage/service_ping/payload_keys_processor.rb'
- 'lib/tasks/gitlab/cleanup.rake'
- 'lib/tasks/gitlab/shell.rake'
- 'qa/qa/resource/protected_branch.rb'
- 'qa/qa/specs/helpers/feature_flag.rb'
- 'rubocop/cop/migration/add_limit_to_text_columns.rb'
- 'scripts/review_apps/automated_cleanup.rb'
- 'spec/controllers/projects/merge_requests/conflicts_controller_spec.rb'
- 'spec/support/import_export/export_file_helper.rb'
- 'spec/support/shared_examples/finders/snippet_visibility_shared_examples.rb'
- 'spec/support/shared_examples/metrics/active_record_subscriber_shared_examples.rb'

View File

@ -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>

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 { }

View File

@ -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!

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 { }

View File

@ -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

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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]

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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?)

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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,

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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?

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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")

View File

@ -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

View File

@ -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

View File

@ -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?

View File

@ -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?

View File

@ -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

View File

@ -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))

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More