Commit eb12b1b4 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'controller-feature-categories-p' into 'master'

Controller feature categories: P [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!44621
parents 6d9235b5 a3a6f8af
...@@ -7,6 +7,8 @@ class PasswordsController < Devise::PasswordsController ...@@ -7,6 +7,8 @@ class PasswordsController < Devise::PasswordsController
before_action :check_password_authentication_available, only: [:create] before_action :check_password_authentication_available, only: [:create]
before_action :throttle_reset, only: [:create] before_action :throttle_reset, only: [:create]
feature_category :authentication_and_authorization
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def edit def edit
super super
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Profiles::AccountsController < Profiles::ApplicationController class Profiles::AccountsController < Profiles::ApplicationController
include AuthHelper include AuthHelper
feature_category :users
def show def show
render(locals: show_view_variables) render(locals: show_view_variables)
end end
......
# frozen_string_literal: true # frozen_string_literal: true
class Profiles::ActiveSessionsController < Profiles::ApplicationController class Profiles::ActiveSessionsController < Profiles::ApplicationController
feature_category :users
def index def index
@sessions = ActiveSession.list(current_user).reject(&:is_impersonated) @sessions = ActiveSession.list(current_user).reject(&:is_impersonated)
end end
......
# frozen_string_literal: true # frozen_string_literal: true
class Profiles::AvatarsController < Profiles::ApplicationController class Profiles::AvatarsController < Profiles::ApplicationController
feature_category :users
def destroy def destroy
@user = current_user @user = current_user
......
...@@ -4,6 +4,8 @@ class Profiles::ChatNamesController < Profiles::ApplicationController ...@@ -4,6 +4,8 @@ class Profiles::ChatNamesController < Profiles::ApplicationController
before_action :chat_name_token, only: [:new] before_action :chat_name_token, only: [:new]
before_action :chat_name_params, only: [:new, :create, :deny] before_action :chat_name_params, only: [:new, :create, :deny]
feature_category :users
def index def index
@chat_names = current_user.chat_names @chat_names = current_user.chat_names
end end
......
...@@ -5,6 +5,8 @@ class Profiles::EmailsController < Profiles::ApplicationController ...@@ -5,6 +5,8 @@ class Profiles::EmailsController < Profiles::ApplicationController
before_action -> { rate_limit!(:profile_add_new_email) }, only: [:create] before_action -> { rate_limit!(:profile_add_new_email) }, only: [:create]
before_action -> { rate_limit!(:profile_resend_email_confirmation) }, only: [:resend_confirmation_instructions] before_action -> { rate_limit!(:profile_resend_email_confirmation) }, only: [:resend_confirmation_instructions]
feature_category :users
def index def index
@primary_email = current_user.email @primary_email = current_user.email
@emails = current_user.emails.order_id_desc @emails = current_user.emails.order_id_desc
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Profiles::GpgKeysController < Profiles::ApplicationController class Profiles::GpgKeysController < Profiles::ApplicationController
before_action :set_gpg_key, only: [:destroy, :revoke] before_action :set_gpg_key, only: [:destroy, :revoke]
feature_category :users
def index def index
@gpg_keys = current_user.gpg_keys.with_subkeys @gpg_keys = current_user.gpg_keys.with_subkeys
@gpg_key = GpgKey.new @gpg_key = GpgKey.new
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Profiles::GroupsController < Profiles::ApplicationController class Profiles::GroupsController < Profiles::ApplicationController
include RoutableActions include RoutableActions
feature_category :users
def update def update
group = find_routable!(Group, params[:id]) group = find_routable!(Group, params[:id])
notification_setting = current_user.notification_settings_for(group) notification_setting = current_user.notification_settings_for(group)
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Profiles::KeysController < Profiles::ApplicationController class Profiles::KeysController < Profiles::ApplicationController
skip_before_action :authenticate_user!, only: [:get_keys] skip_before_action :authenticate_user!, only: [:get_keys]
feature_category :users
def index def index
@keys = current_user.keys.order_id_desc @keys = current_user.keys.order_id_desc
@key = Key.new @key = Key.new
......
# frozen_string_literal: true # frozen_string_literal: true
class Profiles::NotificationsController < Profiles::ApplicationController class Profiles::NotificationsController < Profiles::ApplicationController
feature_category :users
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def show def show
@user = current_user @user = current_user
......
...@@ -9,6 +9,8 @@ class Profiles::PasswordsController < Profiles::ApplicationController ...@@ -9,6 +9,8 @@ class Profiles::PasswordsController < Profiles::ApplicationController
layout :determine_layout layout :determine_layout
feature_category :authentication_and_authorization
def new def new
end end
......
# frozen_string_literal: true # frozen_string_literal: true
class Profiles::PersonalAccessTokensController < Profiles::ApplicationController class Profiles::PersonalAccessTokensController < Profiles::ApplicationController
feature_category :authentication_and_authorization
def index def index
set_index_vars set_index_vars
@personal_access_token = finder.build @personal_access_token = finder.build
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Profiles::PreferencesController < Profiles::ApplicationController class Profiles::PreferencesController < Profiles::ApplicationController
before_action :user before_action :user
feature_category :users
def show def show
end end
......
...@@ -6,6 +6,8 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController ...@@ -6,6 +6,8 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
push_frontend_feature_flag(:webauthn) push_frontend_feature_flag(:webauthn)
end end
feature_category :authentication_and_authorization
def show def show
unless current_user.two_factor_enabled? unless current_user.two_factor_enabled?
current_user.otp_secret = User.generate_otp_secret(32) current_user.otp_secret = User.generate_otp_secret(32)
......
# frozen_string_literal: true # frozen_string_literal: true
class Profiles::U2fRegistrationsController < Profiles::ApplicationController class Profiles::U2fRegistrationsController < Profiles::ApplicationController
feature_category :authentication_and_authorization
def destroy def destroy
u2f_registration = current_user.u2f_registrations.find(params[:id]) u2f_registration = current_user.u2f_registrations.find(params[:id])
u2f_registration.destroy u2f_registration.destroy
......
# frozen_string_literal: true # frozen_string_literal: true
class Profiles::WebauthnRegistrationsController < Profiles::ApplicationController class Profiles::WebauthnRegistrationsController < Profiles::ApplicationController
feature_category :authentication_and_authorization
def destroy def destroy
webauthn_registration = current_user.webauthn_registrations.find(params[:id]) webauthn_registration = current_user.webauthn_registrations.find(params[:id])
webauthn_registration.destroy webauthn_registration.destroy
......
...@@ -10,6 +10,8 @@ class ProfilesController < Profiles::ApplicationController ...@@ -10,6 +10,8 @@ class ProfilesController < Profiles::ApplicationController
push_frontend_feature_flag(:webauthn) push_frontend_feature_flag(:webauthn)
end end
feature_category :users
def show def show
end end
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Projects::AlertManagementController < Projects::ApplicationController class Projects::AlertManagementController < Projects::ApplicationController
before_action :authorize_read_alert_management_alert! before_action :authorize_read_alert_management_alert!
feature_category :alert_management
def index def index
end end
......
...@@ -10,6 +10,8 @@ module Projects ...@@ -10,6 +10,8 @@ module Projects
prepend_before_action :repository, :project_without_auth prepend_before_action :repository, :project_without_auth
feature_category :alert_management
def create def create
token = extract_alert_manager_token(request) token = extract_alert_manager_token(request)
result = notify_service.execute(token) result = notify_service.execute(token)
......
...@@ -15,6 +15,8 @@ class Projects::ArtifactsController < Projects::ApplicationController ...@@ -15,6 +15,8 @@ class Projects::ArtifactsController < Projects::ApplicationController
MAX_PER_PAGE = 20 MAX_PER_PAGE = 20
feature_category :continuous_integration
def index def index
# Loading artifacts is very expensive in projects with a lot of artifacts. # Loading artifacts is very expensive in projects with a lot of artifacts.
# This feature flag prevents a DOS attack vector. # This feature flag prevents a DOS attack vector.
......
...@@ -3,6 +3,11 @@ ...@@ -3,6 +3,11 @@
class Projects::AutocompleteSourcesController < Projects::ApplicationController class Projects::AutocompleteSourcesController < Projects::ApplicationController
before_action :authorize_read_milestone!, only: :milestones before_action :authorize_read_milestone!, only: :milestones
feature_category :issue_tracking, [:issues, :labels, :milestones, :commands]
feature_category :code_review, [:merge_requests]
feature_category :users, [:members]
feature_category :snippets, [:snippets]
def members def members
render json: ::Projects::ParticipantsService.new(@project, current_user).execute(target) render json: ::Projects::ParticipantsService.new(@project, current_user).execute(target)
end end
......
...@@ -5,6 +5,8 @@ class Projects::AvatarsController < Projects::ApplicationController ...@@ -5,6 +5,8 @@ class Projects::AvatarsController < Projects::ApplicationController
before_action :authorize_admin_project!, only: [:destroy] before_action :authorize_admin_project!, only: [:destroy]
feature_category :projects
def show def show
@blob = @repository.blob_at_branch(@repository.root_ref, @project.avatar_in_git) @blob = @repository.blob_at_branch(@repository.root_ref, @project.avatar_in_git)
......
...@@ -6,6 +6,8 @@ class Projects::BadgesController < Projects::ApplicationController ...@@ -6,6 +6,8 @@ class Projects::BadgesController < Projects::ApplicationController
before_action :no_cache_headers, only: [:pipeline, :coverage] before_action :no_cache_headers, only: [:pipeline, :coverage]
before_action :authorize_read_build!, only: [:pipeline, :coverage] before_action :authorize_read_build!, only: [:pipeline, :coverage]
feature_category :continuous_integration
def pipeline def pipeline
pipeline_status = Gitlab::Badge::Pipeline::Status pipeline_status = Gitlab::Badge::Pipeline::Status
.new(project, params[:ref], opts: { .new(project, params[:ref], opts: {
......
...@@ -9,6 +9,8 @@ class Projects::BlameController < Projects::ApplicationController ...@@ -9,6 +9,8 @@ class Projects::BlameController < Projects::ApplicationController
before_action :assign_ref_vars before_action :assign_ref_vars
before_action :authorize_download_code! before_action :authorize_download_code!
feature_category :source_code_management
def show def show
@blob = @repository.blob_at(@commit.id, @path) @blob = @repository.blob_at(@commit.id, @path)
......
...@@ -39,6 +39,8 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -39,6 +39,8 @@ class Projects::BlobController < Projects::ApplicationController
track_redis_hll_event :create, :update, name: 'g_edit_by_sfe', feature: :track_editor_edit_actions, feature_default_enabled: true track_redis_hll_event :create, :update, name: 'g_edit_by_sfe', feature: :track_editor_edit_actions, feature_default_enabled: true
feature_category :source_code_management
def new def new
commit unless @repository.empty? commit unless @repository.empty?
end end
......
...@@ -12,6 +12,8 @@ class Projects::BoardsController < Projects::ApplicationController ...@@ -12,6 +12,8 @@ class Projects::BoardsController < Projects::ApplicationController
push_frontend_feature_flag(:boards_with_swimlanes, project, default_enabled: false) push_frontend_feature_flag(:boards_with_swimlanes, project, default_enabled: false)
end end
feature_category :boards
private private
def assign_endpoint_vars def assign_endpoint_vars
......
...@@ -13,6 +13,8 @@ class Projects::BranchesController < Projects::ApplicationController ...@@ -13,6 +13,8 @@ class Projects::BranchesController < Projects::ApplicationController
before_action :redirect_for_legacy_index_sort_or_search, only: [:index] before_action :redirect_for_legacy_index_sort_or_search, only: [:index]
before_action :limit_diverging_commit_counts!, only: [:diverging_commit_counts] before_action :limit_diverging_commit_counts!, only: [:diverging_commit_counts]
feature_category :source_code_management
def index def index
respond_to do |format| respond_to do |format|
format.html do format.html do
......
...@@ -8,6 +8,8 @@ class Projects::BuildArtifactsController < Projects::ApplicationController ...@@ -8,6 +8,8 @@ class Projects::BuildArtifactsController < Projects::ApplicationController
before_action :extract_ref_name_and_path before_action :extract_ref_name_and_path
before_action :validate_artifacts!, except: [:download] before_action :validate_artifacts!, except: [:download]
feature_category :continuous_integration
def download def download
redirect_to download_project_job_artifacts_path(project, job, params: request.query_parameters) redirect_to download_project_job_artifacts_path(project, job, params: request.query_parameters)
end end
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Projects::BuildsController < Projects::ApplicationController class Projects::BuildsController < Projects::ApplicationController
before_action :authorize_read_build! before_action :authorize_read_build!
feature_category :continuous_integration
def index def index
redirect_to project_jobs_path(project) redirect_to project_jobs_path(project)
end end
......
...@@ -9,6 +9,8 @@ class Projects::Ci::DailyBuildGroupReportResultsController < Projects::Applicati ...@@ -9,6 +9,8 @@ class Projects::Ci::DailyBuildGroupReportResultsController < Projects::Applicati
before_action :authorize_read_build_report_results! before_action :authorize_read_build_report_results!
before_action :validate_param_type! before_action :validate_param_type!
feature_category :continuous_integration
def index def index
respond_to do |format| respond_to do |format|
format.csv { send_data(render_csv(report_results), type: 'text/csv; charset=utf-8') } format.csv { send_data(render_csv(report_results), type: 'text/csv; charset=utf-8') }
......
...@@ -6,6 +6,8 @@ class Projects::Ci::LintsController < Projects::ApplicationController ...@@ -6,6 +6,8 @@ class Projects::Ci::LintsController < Projects::ApplicationController
push_frontend_feature_flag(:ci_lint_vue, project) push_frontend_feature_flag(:ci_lint_vue, project)
end end
feature_category :pipeline_authoring
def show def show
end end
......
...@@ -21,6 +21,8 @@ class Projects::CommitController < Projects::ApplicationController ...@@ -21,6 +21,8 @@ class Projects::CommitController < Projects::ApplicationController
BRANCH_SEARCH_LIMIT = 1000 BRANCH_SEARCH_LIMIT = 1000
feature_category :source_code_management
def show def show
apply_diff_view_cookie! apply_diff_view_cookie!
......
...@@ -15,6 +15,8 @@ class Projects::CommitsController < Projects::ApplicationController ...@@ -15,6 +15,8 @@ class Projects::CommitsController < Projects::ApplicationController
before_action :validate_ref!, except: :commits_root before_action :validate_ref!, except: :commits_root
before_action :set_commits, except: :commits_root before_action :set_commits, except: :commits_root
feature_category :source_code_management
def commits_root def commits_root
redirect_to project_commits_path(@project, @project.default_branch) redirect_to project_commits_path(@project, @project.default_branch)
end end
......
...@@ -19,6 +19,8 @@ class Projects::CompareController < Projects::ApplicationController ...@@ -19,6 +19,8 @@ class Projects::CompareController < Projects::ApplicationController
# Validation # Validation
before_action :validate_refs! before_action :validate_refs!
feature_category :source_code_management
def index def index
end end
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Projects::ConfluencesController < Projects::ApplicationController class Projects::ConfluencesController < Projects::ApplicationController
before_action :ensure_confluence before_action :ensure_confluence
feature_category :integrations
def show def show
end end
......
...@@ -11,6 +11,8 @@ module Projects ...@@ -11,6 +11,8 @@ module Projects
before_action :authorize_read_issue!, only: [:issue, :production] before_action :authorize_read_issue!, only: [:issue, :production]
before_action :authorize_read_merge_request!, only: [:code, :review] before_action :authorize_read_merge_request!, only: [:code, :review]
feature_category :planning_analytics
def issue def issue
render_events(cycle_analytics[:issue].events) render_events(cycle_analytics[:issue].events)
end end
......
...@@ -12,6 +12,8 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController ...@@ -12,6 +12,8 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController
track_unique_visits :show, target_id: 'p_analytics_valuestream' track_unique_visits :show, target_id: 'p_analytics_valuestream'
feature_category :planning_analytics
def show def show
@cycle_analytics = ::CycleAnalytics::ProjectLevel.new(@project, options: options(cycle_analytics_project_params)) @cycle_analytics = ::CycleAnalytics::ProjectLevel.new(@project, options: options(cycle_analytics_project_params))
......
...@@ -10,6 +10,8 @@ class Projects::DeployKeysController < Projects::ApplicationController ...@@ -10,6 +10,8 @@ class Projects::DeployKeysController < Projects::ApplicationController
layout 'project_settings' layout 'project_settings'
feature_category :continuous_delivery
def index def index
respond_to do |format| respond_to do |format|
format.html { redirect_to_repository } format.html { redirect_to_repository }
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Projects::DeployTokensController < Projects::ApplicationController class Projects::DeployTokensController < Projects::ApplicationController
before_action :authorize_admin_project! before_action :authorize_admin_project!
feature_category :continuous_delivery
def revoke def revoke
@token = @project.deploy_tokens.find(params[:id]) @token = @project.deploy_tokens.find(params[:id])
@token.revoke! @token.revoke!
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Projects::DeploymentsController < Projects::ApplicationController class Projects::DeploymentsController < Projects::ApplicationController
before_action :authorize_read_deployment! before_action :authorize_read_deployment!
feature_category :continuous_delivery
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def index def index
deployments = environment.deployments.reorder(created_at: :desc) deployments = environment.deployments.reorder(created_at: :desc)
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Projects::DesignManagement::DesignsController < Projects::ApplicationController class Projects::DesignManagement::DesignsController < Projects::ApplicationController
before_action :authorize_read_design! before_action :authorize_read_design!
feature_category :design_management
private private
def authorize_read_design! def authorize_read_design!
......
...@@ -9,6 +9,8 @@ class Projects::DiscussionsController < Projects::ApplicationController ...@@ -9,6 +9,8 @@ class Projects::DiscussionsController < Projects::ApplicationController
before_action :discussion, only: [:resolve, :unresolve] before_action :discussion, only: [:resolve, :unresolve]
before_action :authorize_resolve_discussion!, only: [:resolve, :unresolve] before_action :authorize_resolve_discussion!, only: [:resolve, :unresolve]
feature_category :issue_tracking
def resolve def resolve
Discussions::ResolveService.new(project, current_user, one_or_more_discussions: discussion).execute Discussions::ResolveService.new(project, current_user, one_or_more_discussions: discussion).execute
......
...@@ -5,6 +5,8 @@ class Projects::Environments::PrometheusApiController < Projects::ApplicationCon ...@@ -5,6 +5,8 @@ class Projects::Environments::PrometheusApiController < Projects::ApplicationCon
before_action :proxyable before_action :proxyable
feature_category :metrics
private private
def proxyable def proxyable
......
# frozen_string_literal: true # frozen_string_literal: true
class Projects::Environments::SampleMetricsController < Projects::ApplicationController class Projects::Environments::SampleMetricsController < Projects::ApplicationController
feature_category :metrics
def query def query
result = Metrics::SampleMetricsService.new(params[:identifier], range_start: params[:start], range_end: params[:end]).query result = Metrics::SampleMetricsService.new(params[:identifier], range_start: params[:start], range_end: params[:end]).query
......
...@@ -25,6 +25,8 @@ class Projects::EnvironmentsController < Projects::ApplicationController ...@@ -25,6 +25,8 @@ class Projects::EnvironmentsController < Projects::ApplicationController
before_action :expire_etag_cache, only: [:index], unless: -> { request.format.json? } before_action :expire_etag_cache, only: [:index], unless: -> { request.format.json? }
after_action :expire_etag_cache, only: [:cancel_auto_stop] after_action :expire_etag_cache, only: [:cancel_auto_stop]
feature_category :continuous_delivery
def index def index
@environments = project.environments @environments = project.environments
.with_state(params[:scope] || :available) .with_state(params[:scope] || :available)
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Projects::ErrorTracking::BaseController < Projects::ApplicationController class Projects::ErrorTracking::BaseController < Projects::ApplicationController
POLLING_INTERVAL = 1_000 POLLING_INTERVAL = 1_000
feature_category :error_tracking
def set_polling_interval def set_polling_interval
Gitlab::PollingInterval.set_header(response, interval: POLLING_INTERVAL) Gitlab::PollingInterval.set_header(response, interval: POLLING_INTERVAL)
end end
......
...@@ -7,6 +7,8 @@ module Projects ...@@ -7,6 +7,8 @@ module Projects
before_action :authorize_read_sentry_issue! before_action :authorize_read_sentry_issue!
feature_category :error_tracking
def index def index
service = ::ErrorTracking::ListProjectsService.new( service = ::ErrorTracking::ListProjectsService.new(
project, project,
......
...@@ -4,6 +4,8 @@ class Projects::FeatureFlagsClientsController < Projects::ApplicationController ...@@ -4,6 +4,8 @@ class Projects::FeatureFlagsClientsController < Projects::ApplicationController
before_action :authorize_admin_feature_flags_client! before_action :authorize_admin_feature_flags_client!
before_action :feature_flags_client before_action :feature_flags_client
feature_category :feature_flags
def reset_token def reset_token
feature_flags_client.reset_token! feature_flags_client.reset_token!
......
...@@ -19,6 +19,8 @@ class Projects::FeatureFlagsController < Projects::ApplicationController ...@@ -19,6 +19,8 @@ class Projects::FeatureFlagsController < Projects::ApplicationController
push_frontend_feature_flag(:feature_flags_legacy_read_only_override, project) push_frontend_feature_flag(:feature_flags_legacy_read_only_override, project)
end end
feature_category :feature_flags
def index def index
@feature_flags = FeatureFlagsFinder @feature_flags = FeatureFlagsFinder
.new(project, current_user, scope: params[:scope]) .new(project, current_user, scope: params[:scope])
......
...@@ -4,6 +4,8 @@ class Projects::FeatureFlagsUserListsController < Projects::ApplicationControlle ...@@ -4,6 +4,8 @@ class Projects::FeatureFlagsUserListsController < Projects::ApplicationControlle
before_action :authorize_admin_feature_flags_user_lists! before_action :authorize_admin_feature_flags_user_lists!
before_action :user_list, only: [:edit, :show] before_action :user_list, only: [:edit, :show]
feature_category :feature_flags
def new def new
end end
......
...@@ -10,6 +10,8 @@ class Projects::FindFileController < Projects::ApplicationController ...@@ -10,6 +10,8 @@ class Projects::FindFileController < Projects::ApplicationController
before_action :assign_ref_vars before_action :assign_ref_vars
before_action :authorize_download_code! before_action :authorize_download_code!
feature_category :source_code_management
def show def show
return render_404 unless @repository.commit(@ref) return render_404 unless @repository.commit(@ref)
......
...@@ -14,6 +14,8 @@ class Projects::ForksController < Projects::ApplicationController ...@@ -14,6 +14,8 @@ class Projects::ForksController < Projects::ApplicationController
before_action :authorize_fork_project!, only: [:new, :create] before_action :authorize_fork_project!, only: [:new, :create]
before_action :authorize_fork_namespace!, only: [:create] before_action :authorize_fork_namespace!, only: [:create]
feature_category :source_code_management
def index def index
@total_forks_count = project.forks.size @total_forks_count = project.forks.size
@public_forks_count = project.forks.public_only.size @public_forks_count = project.forks.public_only.size
......
...@@ -4,6 +4,8 @@ class Projects::GrafanaApiController < Projects::ApplicationController ...@@ -4,6 +4,8 @@ class Projects::GrafanaApiController < Projects::ApplicationController
include RenderServiceResults include RenderServiceResults
include MetricsDashboard include MetricsDashboard
feature_category :metrics
def proxy def proxy
result = ::Grafana::ProxyService.new( result = ::Grafana::ProxyService.new(
project, project,
......
...@@ -11,6 +11,8 @@ class Projects::GraphsController < Projects::ApplicationController ...@@ -11,6 +11,8 @@ class Projects::GraphsController < Projects::ApplicationController
track_unique_visits :charts, target_id: 'p_analytics_repo' track_unique_visits :charts, target_id: 'p_analytics_repo'
feature_category :source_code_management
def show def show
respond_to do |format| respond_to do |format|
format.html format.html
......
...@@ -5,6 +5,8 @@ class Projects::GroupLinksController < Projects::ApplicationController ...@@ -5,6 +5,8 @@ class Projects::GroupLinksController < Projects::ApplicationController
before_action :authorize_admin_project! before_action :authorize_admin_project!
before_action :authorize_admin_project_member!, only: [:update] before_action :authorize_admin_project_member!, only: [:update]
feature_category :subgroups
def create def create
group = Group.find(params[:link_group_id]) if params[:link_group_id].present? group = Group.find(params[:link_group_id]) if params[:link_group_id].present?
......
...@@ -12,6 +12,8 @@ class Projects::HookLogsController < Projects::ApplicationController ...@@ -12,6 +12,8 @@ class Projects::HookLogsController < Projects::ApplicationController
layout 'project_settings' layout 'project_settings'
feature_category :integrations
def show def show
end end
......
...@@ -12,6 +12,8 @@ class Projects::HooksController < Projects::ApplicationController ...@@ -12,6 +12,8 @@ class Projects::HooksController < Projects::ApplicationController
layout "project_settings" layout "project_settings"
feature_category :integrations
def index def index
@hooks = @project.hooks @hooks = @project.hooks
@hook = ProjectHook.new @hook = ProjectHook.new
......
...@@ -7,6 +7,8 @@ module Projects ...@@ -7,6 +7,8 @@ module Projects
before_action :authorize_read_project! before_action :authorize_read_project!
before_action :validate_jira_import_settings! before_action :validate_jira_import_settings!
feature_category :integrations
def show def show
end end
......
...@@ -11,6 +11,8 @@ class Projects::ImportsController < Projects::ApplicationController ...@@ -11,6 +11,8 @@ class Projects::ImportsController < Projects::ApplicationController
before_action :redirect_if_progress, except: :show before_action :redirect_if_progress, except: :show
before_action :redirect_if_no_import, only: :show before_action :redirect_if_no_import, only: :show
feature_category :importers
def new def new
end end
......
...@@ -10,6 +10,8 @@ module Projects ...@@ -10,6 +10,8 @@ module Projects
prepend_before_action :project_without_auth prepend_before_action :project_without_auth
feature_category :incident_management
def create def create
result = webhook_processor.execute(params[:token]) result = webhook_processor.execute(params[:token])
......
...@@ -7,6 +7,8 @@ class Projects::IncidentsController < Projects::ApplicationController ...@@ -7,6 +7,8 @@ class Projects::IncidentsController < Projects::ApplicationController
before_action :authorize_read_issue! before_action :authorize_read_issue!
before_action :load_incident, only: [:show] before_action :load_incident, only: [:show]
feature_category :incident_management
def index def index
end end
......
...@@ -7,6 +7,8 @@ module Projects ...@@ -7,6 +7,8 @@ module Projects
before_action :authorize_admin_issue_link!, only: [:create, :destroy] before_action :authorize_admin_issue_link!, only: [:create, :destroy]
before_action :authorize_issue_link_association!, only: :destroy before_action :authorize_issue_link_association!, only: :destroy
feature_category :issue_tracking
private private
def authorize_admin_issue_link! def authorize_admin_issue_link!
......
...@@ -65,6 +65,17 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -65,6 +65,17 @@ class Projects::IssuesController < Projects::ApplicationController
alias_method :designs, :show alias_method :designs, :show
feature_category :issue_tracking, [
:index, :calendar, :show, :new, :create, :edit, :update,
:destroy, :move, :reorder, :designs, :toggle_subscription,
:discussions, :bulk_update, :realtime_changes,
:toggle_award_emoji, :mark_as_spam, :related_branches,
:can_create_branch, :create_merge_request
]
feature_category :service_desk, [:service_desk]
feature_category :importers, [:import_csv, :export_csv]
def index def index
@issues = @issuables @issues = @issuables
......
...@@ -16,6 +16,8 @@ class Projects::JobsController < Projects::ApplicationController ...@@ -16,6 +16,8 @@ class Projects::JobsController < Projects::ApplicationController
layout 'project' layout 'project'
feature_category :continuous_integration
def index def index
# We need all builds for tabs counters # We need all builds for tabs counters
@all_builds = Ci::JobsFinder.new(current_user: current_user, project: @project).execute @all_builds = Ci::JobsFinder.new(current_user: current_user, project: @project).execute
......
...@@ -15,6 +15,8 @@ class Projects::LabelsController < Projects::ApplicationController ...@@ -15,6 +15,8 @@ class Projects::LabelsController < Projects::ApplicationController
respond_to :js, :html respond_to :js, :html
feature_category :issue_tracking
def index def index
@prioritized_labels = @available_labels.prioritized(@project) @prioritized_labels = @available_labels.prioritized(@project)
@labels = @available_labels.unprioritized(@project).page(params[:page]) @labels = @available_labels.unprioritized(@project).page(params[:page])
......
...@@ -7,6 +7,8 @@ module Projects ...@@ -7,6 +7,8 @@ module Projects
before_action :authorize_read_pod_logs! before_action :authorize_read_pod_logs!
before_action :ensure_deployments, only: %i(k8s elasticsearch) before_action :ensure_deployments, only: %i(k8s elasticsearch)
feature_category :logging
def index def index
if environment || cluster if environment || cluster
render :index render :index
......
...@@ -10,6 +10,8 @@ class Projects::MattermostsController < Projects::ApplicationController ...@@ -10,6 +10,8 @@ class Projects::MattermostsController < Projects::ApplicationController
before_action :service before_action :service
before_action :teams, only: [:new] before_action :teams, only: [:new]
feature_category :integrations
def new def new
end end
......
...@@ -5,6 +5,8 @@ class Projects::MergeRequests::ApplicationController < Projects::ApplicationCont ...@@ -5,6 +5,8 @@ class Projects::MergeRequests::ApplicationController < Projects::ApplicationCont
before_action :merge_request before_action :merge_request
before_action :authorize_read_merge_request! before_action :authorize_read_merge_request!
feature_category :code_review
private private
def merge_request def merge_request
......
...@@ -6,6 +6,8 @@ module Projects ...@@ -6,6 +6,8 @@ module Projects
class BuilderController < Projects::ApplicationController class BuilderController < Projects::ApplicationController
before_action :authorize_metrics_dashboard! before_action :authorize_metrics_dashboard!
feature_category :metrics
def panel_preview def panel_preview
respond_to do |format| respond_to do |format|
format.json do format.json do
......
...@@ -14,6 +14,8 @@ module Projects ...@@ -14,6 +14,8 @@ module Projects
push_frontend_feature_flag(:disable_metric_dashboard_refresh_rate) push_frontend_feature_flag(:disable_metric_dashboard_refresh_rate)
end end
feature_category :metrics
def show def show
if environment if environment
render 'projects/environments/metrics' render 'projects/environments/metrics'
......
...@@ -21,6 +21,8 @@ class Projects::MilestonesController < Projects::ApplicationController ...@@ -21,6 +21,8 @@ class Projects::MilestonesController < Projects::ApplicationController
respond_to :html respond_to :html
feature_category :issue_tracking
def index def index
@sort = params[:sort] || 'due_date_asc' @sort = params[:sort] || 'due_date_asc'
@milestones = milestones.sort_by_attribute(@sort) @milestones = milestones.sort_by_attribute(@sort)
......
...@@ -10,6 +10,8 @@ class Projects::MirrorsController < Projects::ApplicationController ...@@ -10,6 +10,8 @@ class Projects::MirrorsController < Projects::ApplicationController
layout "project_settings" layout "project_settings"
feature_category :source_code_management
def show def show
redirect_to_repository_settings(project, anchor: 'js-push-remote-settings') redirect_to_repository_settings(project, anchor: 'js-push-remote-settings')
end end
......
...@@ -11,6 +11,8 @@ class Projects::NetworkController < Projects::ApplicationController ...@@ -11,6 +11,8 @@ class Projects::NetworkController < Projects::ApplicationController
before_action :assign_options before_action :assign_options
before_action :assign_commit before_action :assign_commit
feature_category :source_code_management
def show def show
@url = project_network_path(@project, @ref, @options.merge(format: :json)) @url = project_network_path(@project, @ref, @options.merge(format: :json))
@commit_url = project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s") @commit_url = project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")
......
...@@ -11,6 +11,8 @@ class Projects::NotesController < Projects::ApplicationController ...@@ -11,6 +11,8 @@ class Projects::NotesController < Projects::ApplicationController
before_action :authorize_create_note!, only: [:create] before_action :authorize_create_note!, only: [:create]
before_action :authorize_resolve_note!, only: [:resolve, :unresolve] before_action :authorize_resolve_note!, only: [:resolve, :unresolve]
feature_category :issue_tracking
def delete_attachment def delete_attachment
note.remove_attachment! note.remove_attachment!
note.update_attribute(:attachment, nil) note.update_attribute(:attachment, nil)
......
...@@ -6,6 +6,8 @@ module Projects ...@@ -6,6 +6,8 @@ module Projects
include PackagesAccess include PackagesAccess
include SendFileUpload include SendFileUpload
feature_category :package_registry
def download def download
package_file = project.package_files.find(params[:id]) package_file = project.package_files.find(params[:id])
......
...@@ -5,6 +5,8 @@ module Projects ...@@ -5,6 +5,8 @@ module Projects
class PackagesController < Projects::ApplicationController class PackagesController < Projects::ApplicationController
include PackagesAccess include PackagesAccess
feature_category :package_registry
def show def show
@package = project.packages.find(params[:id]) @package = project.packages.find(params[:id])
@package_files = @package.package_files.recent @package_files = @package.package_files.recent
......
...@@ -8,6 +8,8 @@ class Projects::PagesController < Projects::ApplicationController ...@@ -8,6 +8,8 @@ class Projects::PagesController < Projects::ApplicationController
before_action :authorize_update_pages!, except: [:show, :destroy] before_action :authorize_update_pages!, except: [:show, :destroy]
before_action :authorize_remove_pages!, only: [:destroy] before_action :authorize_remove_pages!, only: [:destroy]
feature_category :pages
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def show def show
@domains = @project.pages_domains.order(:domain).present(current_user: current_user) @domains = @project.pages_domains.order(:domain).present(current_user: current_user)
......
...@@ -9,6 +9,8 @@ class Projects::PagesDomainsController < Projects::ApplicationController ...@@ -9,6 +9,8 @@ class Projects::PagesDomainsController < Projects::ApplicationController
helper_method :domain_presenter helper_method :domain_presenter
feature_category :pages
def show def show
end end
......
...@@ -12,6 +12,8 @@ module Projects ...@@ -12,6 +12,8 @@ module Projects
respond_error(http_status: :bad_request, message: _('Request parameter %{param} is missing.') % { param: exception.param }) respond_error(http_status: :bad_request, message: _('Request parameter %{param} is missing.') % { param: exception.param })
end end
feature_category :metrics
def create def create
result = ::Metrics::Dashboard::CloneDashboardService.new(project, current_user, dashboard_params).execute result = ::Metrics::Dashboard::CloneDashboardService.new(project, current_user, dashboard_params).execute
......
...@@ -10,6 +10,8 @@ class Projects::PipelineSchedulesController < Projects::ApplicationController ...@@ -10,6 +10,8 @@ class Projects::PipelineSchedulesController < Projects::ApplicationController
before_action :authorize_update_pipeline_schedule!, except: [:index, :new, :create, :play] before_action :authorize_update_pipeline_schedule!, except: [:index, :new, :create, :play]
before_action :authorize_admin_pipeline_schedule!, only: [:destroy] before_action :authorize_admin_pipeline_schedule!, only: [:destroy]
feature_category :continuous_integration
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def index def index
@scope = params[:scope] @scope = params[:scope]
......
...@@ -10,6 +10,8 @@ module Projects ...@@ -10,6 +10,8 @@ module Projects
before_action :pipeline before_action :pipeline
before_action :authorize_read_pipeline! before_action :authorize_read_pipeline!
feature_category :continuous_integration
private private
def pipeline def pipeline
......
...@@ -31,6 +31,8 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -31,6 +31,8 @@ class Projects::PipelinesController < Projects::ApplicationController
POLLING_INTERVAL = 10_000 POLLING_INTERVAL = 10_000
feature_category :continuous_integration
def index def index
@pipelines = Ci::PipelinesFinder @pipelines = Ci::PipelinesFinder
.new(project, current_user, index_params) .new(project, current_user, index_params)
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Projects::PipelinesSettingsController < Projects::ApplicationController class Projects::PipelinesSettingsController < Projects::ApplicationController
before_action :authorize_admin_pipeline! before_action :authorize_admin_pipeline!
feature_category :continuous_integration
def show def show
redirect_to project_settings_ci_cd_path(@project, params: params.to_unsafe_h) redirect_to project_settings_ci_cd_path(@project, params: params.to_unsafe_h)
end end
......
...@@ -5,6 +5,8 @@ class Projects::ProductAnalyticsController < Projects::ApplicationController ...@@ -5,6 +5,8 @@ class Projects::ProductAnalyticsController < Projects::ApplicationController
before_action :authorize_read_product_analytics! before_action :authorize_read_product_analytics!
before_action :tracker_variables, only: [:setup, :test] before_action :tracker_variables, only: [:setup, :test]
feature_category :product_analytics
def index def index
@events = product_analytics_events.order_by_time.page(params[:page]) @events = product_analytics_events.order_by_time.page(params[:page])
end end
......
...@@ -8,6 +8,8 @@ class Projects::ProjectMembersController < Projects::ApplicationController ...@@ -8,6 +8,8 @@ class Projects::ProjectMembersController < Projects::ApplicationController
# Authorize # Authorize
before_action :authorize_admin_project_member!, except: [:index, :leave, :request_access] before_action :authorize_admin_project_member!, except: [:index, :leave, :request_access]
feature_category :authentication_and_authorization
def index def index
@sort = params[:sort].presence || sort_value_name @sort = params[:sort].presence || sort_value_name
......
...@@ -16,6 +16,8 @@ module Projects ...@@ -16,6 +16,8 @@ module Projects
before_action :authorize_read_prometheus_alerts!, except: [:notify] before_action :authorize_read_prometheus_alerts!, except: [:notify]
before_action :alert, only: [:update, :show, :destroy, :metrics_dashboard] before_action :alert, only: [:update, :show, :destroy, :metrics_dashboard]
feature_category :alert_management
def index def index
render json: serialize_as_json(alerts) render json: serialize_as_json(alerts)
end end
......
...@@ -6,6 +6,8 @@ module Projects ...@@ -6,6 +6,8 @@ module Projects
before_action :authorize_admin_project! before_action :authorize_admin_project!
before_action :require_prometheus_metrics! before_action :require_prometheus_metrics!
feature_category :metrics
def active_common def active_common
respond_to do |format| respond_to do |format|
format.json do format.json do
......
...@@ -10,6 +10,8 @@ class Projects::ProtectedRefsController < Projects::ApplicationController ...@@ -10,6 +10,8 @@ class Projects::ProtectedRefsController < Projects::ApplicationController
layout "project_settings" layout "project_settings"
feature_category :source_code_management
def index def index
redirect_to_repository_settings(@project) redirect_to_repository_settings(@project)
end end
......
...@@ -15,6 +15,8 @@ class Projects::RawController < Projects::ApplicationController ...@@ -15,6 +15,8 @@ class Projects::RawController < Projects::ApplicationController
before_action :no_cache_headers, only: [:show] before_action :no_cache_headers, only: [:show]
before_action :redirect_to_external_storage, only: :show, if: :static_objects_external_storage_enabled? before_action :redirect_to_external_storage, only: :show, if: :static_objects_external_storage_enabled?
feature_category :source_code_management
def show def show
@blob = @repository.blob_at(@commit.id, @path) @blob = @repository.blob_at(@commit.id, @path)
......
...@@ -11,6 +11,8 @@ class Projects::RefsController < Projects::ApplicationController ...@@ -11,6 +11,8 @@ class Projects::RefsController < Projects::ApplicationController
before_action :assign_ref_vars before_action :assign_ref_vars
before_action :authorize_download_code! before_action :authorize_download_code!
feature_category :source_code_management
def switch def switch
respond_to do |format| respond_to do |format|
format.html do format.html do
......
...@@ -8,6 +8,8 @@ module Projects ...@@ -8,6 +8,8 @@ module Projects
before_action :verify_registry_enabled! before_action :verify_registry_enabled!
before_action :authorize_read_container_image! before_action :authorize_read_container_image!
feature_category :container_registry
private private
def verify_registry_enabled! def verify_registry_enabled!
......
...@@ -7,6 +7,8 @@ module Projects ...@@ -7,6 +7,8 @@ module Projects
before_action :release before_action :release
before_action :authorize_read_release_evidence! before_action :authorize_read_release_evidence!
feature_category :release_evidence
def show def show
respond_to do |format| respond_to do |format|
format.json do format.json do
......
...@@ -13,6 +13,8 @@ class Projects::ReleasesController < Projects::ApplicationController ...@@ -13,6 +13,8 @@ class Projects::ReleasesController < Projects::ApplicationController
before_action :authorize_update_release!, only: %i[edit update] before_action :authorize_update_release!, only: %i[edit update]
before_action :authorize_create_release!, only: :new before_action :authorize_create_release!, only: :new
feature_category :release_orchestration
def index def index
respond_to do |format| respond_to do |format|
format.html do format.html do
......
...@@ -18,6 +18,8 @@ class Projects::RepositoriesController < Projects::ApplicationController ...@@ -18,6 +18,8 @@ class Projects::RepositoriesController < Projects::ApplicationController
before_action :authorize_admin_project!, only: :create before_action :authorize_admin_project!, only: :create
before_action :redirect_to_external_storage, only: :archive, if: :static_objects_external_storage_enabled? before_action :redirect_to_external_storage, only: :archive, if: :static_objects_external_storage_enabled?
feature_category :source_code_management
def create def create
@project.create_repository @project.create_repository
......
...@@ -5,6 +5,8 @@ class Projects::RunnerProjectsController < Projects::ApplicationController ...@@ -5,6 +5,8 @@ class Projects::RunnerProjectsController < Projects::ApplicationController
layout 'project_settings' layout 'project_settings'
feature_category :continuous_integration
def create def create
@runner = Ci::Runner.find(params[:runner_project][:runner_id]) @runner = Ci::Runner.find(params[:runner_project][:runner_id])
......
...@@ -6,6 +6,8 @@ class Projects::RunnersController < Projects::ApplicationController ...@@ -6,6 +6,8 @@ class Projects::RunnersController < Projects::ApplicationController
layout 'project_settings' layout 'project_settings'
feature_category :continuous_integration
def index def index
redirect_to project_settings_ci_cd_path(@project, anchor: 'js-runners-settings') redirect_to project_settings_ci_cd_path(@project, anchor: 'js-runners-settings')
end end
......
...@@ -5,6 +5,8 @@ module Projects ...@@ -5,6 +5,8 @@ module Projects
class FunctionsController < Projects::ApplicationController class FunctionsController < Projects::ApplicationController
before_action :authorize_read_cluster! before_action :authorize_read_cluster!
feature_category :serverless
def index def index
respond_to do |format| respond_to do |format|
format.json do format.json do
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Projects::ServiceDeskController < Projects::ApplicationController class Projects::ServiceDeskController < Projects::ApplicationController
before_action :authorize_admin_project! before_action :authorize_admin_project!
feature_category :service_desk
def show def show
json_response json_response
end end
......
...@@ -19,6 +19,8 @@ class Projects::ServicesController < Projects::ApplicationController ...@@ -19,6 +19,8 @@ class Projects::ServicesController < Projects::ApplicationController
layout "project_settings" layout "project_settings"
feature_category :integrations
def edit def edit
@default_integration = Service.default_integration(service.type, project) @default_integration = Service.default_integration(service.type, project)
end end
......
...@@ -7,6 +7,8 @@ module Projects ...@@ -7,6 +7,8 @@ module Projects
before_action :check_feature_availability before_action :check_feature_availability
feature_category :authentication_and_authorization
def index def index
@project_access_token = PersonalAccessToken.new @project_access_token = PersonalAccessToken.new
set_index_vars set_index_vars
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment