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
before_action :check_password_authentication_available, only: [:create]
before_action :throttle_reset, only: [:create]
feature_category :authentication_and_authorization
# rubocop: disable CodeReuse/ActiveRecord
def edit
super
......
......@@ -3,6 +3,8 @@
class Profiles::AccountsController < Profiles::ApplicationController
include AuthHelper
feature_category :users
def show
render(locals: show_view_variables)
end
......
# frozen_string_literal: true
class Profiles::ActiveSessionsController < Profiles::ApplicationController
feature_category :users
def index
@sessions = ActiveSession.list(current_user).reject(&:is_impersonated)
end
......
# frozen_string_literal: true
class Profiles::AvatarsController < Profiles::ApplicationController
feature_category :users
def destroy
@user = current_user
......
......@@ -4,6 +4,8 @@ class Profiles::ChatNamesController < Profiles::ApplicationController
before_action :chat_name_token, only: [:new]
before_action :chat_name_params, only: [:new, :create, :deny]
feature_category :users
def index
@chat_names = current_user.chat_names
end
......
......@@ -5,6 +5,8 @@ class Profiles::EmailsController < Profiles::ApplicationController
before_action -> { rate_limit!(:profile_add_new_email) }, only: [:create]
before_action -> { rate_limit!(:profile_resend_email_confirmation) }, only: [:resend_confirmation_instructions]
feature_category :users
def index
@primary_email = current_user.email
@emails = current_user.emails.order_id_desc
......
......@@ -3,6 +3,8 @@
class Profiles::GpgKeysController < Profiles::ApplicationController
before_action :set_gpg_key, only: [:destroy, :revoke]
feature_category :users
def index
@gpg_keys = current_user.gpg_keys.with_subkeys
@gpg_key = GpgKey.new
......
......@@ -3,6 +3,8 @@
class Profiles::GroupsController < Profiles::ApplicationController
include RoutableActions
feature_category :users
def update
group = find_routable!(Group, params[:id])
notification_setting = current_user.notification_settings_for(group)
......
......@@ -3,6 +3,8 @@
class Profiles::KeysController < Profiles::ApplicationController
skip_before_action :authenticate_user!, only: [:get_keys]
feature_category :users
def index
@keys = current_user.keys.order_id_desc
@key = Key.new
......
# frozen_string_literal: true
class Profiles::NotificationsController < Profiles::ApplicationController
feature_category :users
# rubocop: disable CodeReuse/ActiveRecord
def show
@user = current_user
......
......@@ -9,6 +9,8 @@ class Profiles::PasswordsController < Profiles::ApplicationController
layout :determine_layout
feature_category :authentication_and_authorization
def new
end
......
# frozen_string_literal: true
class Profiles::PersonalAccessTokensController < Profiles::ApplicationController
feature_category :authentication_and_authorization
def index
set_index_vars
@personal_access_token = finder.build
......
......@@ -3,6 +3,8 @@
class Profiles::PreferencesController < Profiles::ApplicationController
before_action :user
feature_category :users
def show
end
......
......@@ -6,6 +6,8 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
push_frontend_feature_flag(:webauthn)
end
feature_category :authentication_and_authorization
def show
unless current_user.two_factor_enabled?
current_user.otp_secret = User.generate_otp_secret(32)
......
# frozen_string_literal: true
class Profiles::U2fRegistrationsController < Profiles::ApplicationController
feature_category :authentication_and_authorization
def destroy
u2f_registration = current_user.u2f_registrations.find(params[:id])
u2f_registration.destroy
......
# frozen_string_literal: true
class Profiles::WebauthnRegistrationsController < Profiles::ApplicationController
feature_category :authentication_and_authorization
def destroy
webauthn_registration = current_user.webauthn_registrations.find(params[:id])
webauthn_registration.destroy
......
......@@ -10,6 +10,8 @@ class ProfilesController < Profiles::ApplicationController
push_frontend_feature_flag(:webauthn)
end
feature_category :users
def show
end
......
......@@ -3,6 +3,8 @@
class Projects::AlertManagementController < Projects::ApplicationController
before_action :authorize_read_alert_management_alert!
feature_category :alert_management
def index
end
......
......@@ -10,6 +10,8 @@ module Projects
prepend_before_action :repository, :project_without_auth
feature_category :alert_management
def create
token = extract_alert_manager_token(request)
result = notify_service.execute(token)
......
......@@ -15,6 +15,8 @@ class Projects::ArtifactsController < Projects::ApplicationController
MAX_PER_PAGE = 20
feature_category :continuous_integration
def index
# Loading artifacts is very expensive in projects with a lot of artifacts.
# This feature flag prevents a DOS attack vector.
......
......@@ -3,6 +3,11 @@
class Projects::AutocompleteSourcesController < Projects::ApplicationController
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
render json: ::Projects::ParticipantsService.new(@project, current_user).execute(target)
end
......
......@@ -5,6 +5,8 @@ class Projects::AvatarsController < Projects::ApplicationController
before_action :authorize_admin_project!, only: [:destroy]
feature_category :projects
def show
@blob = @repository.blob_at_branch(@repository.root_ref, @project.avatar_in_git)
......
......@@ -6,6 +6,8 @@ class Projects::BadgesController < Projects::ApplicationController
before_action :no_cache_headers, only: [:pipeline, :coverage]
before_action :authorize_read_build!, only: [:pipeline, :coverage]
feature_category :continuous_integration
def pipeline
pipeline_status = Gitlab::Badge::Pipeline::Status
.new(project, params[:ref], opts: {
......
......@@ -9,6 +9,8 @@ class Projects::BlameController < Projects::ApplicationController
before_action :assign_ref_vars
before_action :authorize_download_code!
feature_category :source_code_management
def show
@blob = @repository.blob_at(@commit.id, @path)
......
......@@ -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
feature_category :source_code_management
def new
commit unless @repository.empty?
end
......
......@@ -12,6 +12,8 @@ class Projects::BoardsController < Projects::ApplicationController
push_frontend_feature_flag(:boards_with_swimlanes, project, default_enabled: false)
end
feature_category :boards
private
def assign_endpoint_vars
......
......@@ -13,6 +13,8 @@ class Projects::BranchesController < Projects::ApplicationController
before_action :redirect_for_legacy_index_sort_or_search, only: [:index]
before_action :limit_diverging_commit_counts!, only: [:diverging_commit_counts]
feature_category :source_code_management
def index
respond_to do |format|
format.html do
......
......@@ -8,6 +8,8 @@ class Projects::BuildArtifactsController < Projects::ApplicationController
before_action :extract_ref_name_and_path
before_action :validate_artifacts!, except: [:download]
feature_category :continuous_integration
def download
redirect_to download_project_job_artifacts_path(project, job, params: request.query_parameters)
end
......
......@@ -3,6 +3,8 @@
class Projects::BuildsController < Projects::ApplicationController
before_action :authorize_read_build!
feature_category :continuous_integration
def index
redirect_to project_jobs_path(project)
end
......
......@@ -9,6 +9,8 @@ class Projects::Ci::DailyBuildGroupReportResultsController < Projects::Applicati
before_action :authorize_read_build_report_results!
before_action :validate_param_type!
feature_category :continuous_integration
def index
respond_to do |format|
format.csv { send_data(render_csv(report_results), type: 'text/csv; charset=utf-8') }
......
......@@ -6,6 +6,8 @@ class Projects::Ci::LintsController < Projects::ApplicationController
push_frontend_feature_flag(:ci_lint_vue, project)
end
feature_category :pipeline_authoring
def show
end
......
......@@ -21,6 +21,8 @@ class Projects::CommitController < Projects::ApplicationController
BRANCH_SEARCH_LIMIT = 1000
feature_category :source_code_management
def show
apply_diff_view_cookie!
......
......@@ -15,6 +15,8 @@ class Projects::CommitsController < Projects::ApplicationController
before_action :validate_ref!, except: :commits_root
before_action :set_commits, except: :commits_root
feature_category :source_code_management
def commits_root
redirect_to project_commits_path(@project, @project.default_branch)
end
......
......@@ -19,6 +19,8 @@ class Projects::CompareController < Projects::ApplicationController
# Validation
before_action :validate_refs!
feature_category :source_code_management
def index
end
......
......@@ -3,6 +3,8 @@
class Projects::ConfluencesController < Projects::ApplicationController
before_action :ensure_confluence
feature_category :integrations
def show
end
......
......@@ -11,6 +11,8 @@ module Projects
before_action :authorize_read_issue!, only: [:issue, :production]
before_action :authorize_read_merge_request!, only: [:code, :review]
feature_category :planning_analytics
def issue
render_events(cycle_analytics[:issue].events)
end
......
......@@ -12,6 +12,8 @@ class Projects::CycleAnalyticsController < Projects::ApplicationController
track_unique_visits :show, target_id: 'p_analytics_valuestream'
feature_category :planning_analytics
def show
@cycle_analytics = ::CycleAnalytics::ProjectLevel.new(@project, options: options(cycle_analytics_project_params))
......
......@@ -10,6 +10,8 @@ class Projects::DeployKeysController < Projects::ApplicationController
layout 'project_settings'
feature_category :continuous_delivery
def index
respond_to do |format|
format.html { redirect_to_repository }
......
......@@ -3,6 +3,8 @@
class Projects::DeployTokensController < Projects::ApplicationController
before_action :authorize_admin_project!
feature_category :continuous_delivery
def revoke
@token = @project.deploy_tokens.find(params[:id])
@token.revoke!
......
......@@ -3,6 +3,8 @@
class Projects::DeploymentsController < Projects::ApplicationController
before_action :authorize_read_deployment!
feature_category :continuous_delivery
# rubocop: disable CodeReuse/ActiveRecord
def index
deployments = environment.deployments.reorder(created_at: :desc)
......
......@@ -3,6 +3,8 @@
class Projects::DesignManagement::DesignsController < Projects::ApplicationController
before_action :authorize_read_design!
feature_category :design_management
private
def authorize_read_design!
......
......@@ -9,6 +9,8 @@ class Projects::DiscussionsController < Projects::ApplicationController
before_action :discussion, only: [:resolve, :unresolve]
before_action :authorize_resolve_discussion!, only: [:resolve, :unresolve]
feature_category :issue_tracking
def resolve
Discussions::ResolveService.new(project, current_user, one_or_more_discussions: discussion).execute
......
......@@ -5,6 +5,8 @@ class Projects::Environments::PrometheusApiController < Projects::ApplicationCon
before_action :proxyable
feature_category :metrics
private
def proxyable
......
# frozen_string_literal: true
class Projects::Environments::SampleMetricsController < Projects::ApplicationController
feature_category :metrics
def 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
before_action :expire_etag_cache, only: [:index], unless: -> { request.format.json? }
after_action :expire_etag_cache, only: [:cancel_auto_stop]
feature_category :continuous_delivery
def index
@environments = project.environments
.with_state(params[:scope] || :available)
......
......@@ -3,6 +3,8 @@
class Projects::ErrorTracking::BaseController < Projects::ApplicationController
POLLING_INTERVAL = 1_000
feature_category :error_tracking
def set_polling_interval
Gitlab::PollingInterval.set_header(response, interval: POLLING_INTERVAL)
end
......
......@@ -7,6 +7,8 @@ module Projects
before_action :authorize_read_sentry_issue!
feature_category :error_tracking
def index
service = ::ErrorTracking::ListProjectsService.new(
project,
......
......@@ -4,6 +4,8 @@ class Projects::FeatureFlagsClientsController < Projects::ApplicationController
before_action :authorize_admin_feature_flags_client!
before_action :feature_flags_client
feature_category :feature_flags
def reset_token
feature_flags_client.reset_token!
......
......@@ -19,6 +19,8 @@ class Projects::FeatureFlagsController < Projects::ApplicationController
push_frontend_feature_flag(:feature_flags_legacy_read_only_override, project)
end
feature_category :feature_flags
def index
@feature_flags = FeatureFlagsFinder
.new(project, current_user, scope: params[:scope])
......
......@@ -4,6 +4,8 @@ class Projects::FeatureFlagsUserListsController < Projects::ApplicationControlle
before_action :authorize_admin_feature_flags_user_lists!
before_action :user_list, only: [:edit, :show]
feature_category :feature_flags
def new
end
......
......@@ -10,6 +10,8 @@ class Projects::FindFileController < Projects::ApplicationController
before_action :assign_ref_vars
before_action :authorize_download_code!
feature_category :source_code_management
def show
return render_404 unless @repository.commit(@ref)
......
......@@ -14,6 +14,8 @@ class Projects::ForksController < Projects::ApplicationController
before_action :authorize_fork_project!, only: [:new, :create]
before_action :authorize_fork_namespace!, only: [:create]
feature_category :source_code_management
def index
@total_forks_count = project.forks.size
@public_forks_count = project.forks.public_only.size
......
......@@ -4,6 +4,8 @@ class Projects::GrafanaApiController < Projects::ApplicationController
include RenderServiceResults
include MetricsDashboard
feature_category :metrics
def proxy
result = ::Grafana::ProxyService.new(
project,
......
......@@ -11,6 +11,8 @@ class Projects::GraphsController < Projects::ApplicationController
track_unique_visits :charts, target_id: 'p_analytics_repo'
feature_category :source_code_management
def show
respond_to do |format|
format.html
......
......@@ -5,6 +5,8 @@ class Projects::GroupLinksController < Projects::ApplicationController
before_action :authorize_admin_project!
before_action :authorize_admin_project_member!, only: [:update]
feature_category :subgroups
def create
group = Group.find(params[:link_group_id]) if params[:link_group_id].present?
......
......@@ -12,6 +12,8 @@ class Projects::HookLogsController < Projects::ApplicationController
layout 'project_settings'
feature_category :integrations
def show
end
......
......@@ -12,6 +12,8 @@ class Projects::HooksController < Projects::ApplicationController
layout "project_settings"
feature_category :integrations
def index
@hooks = @project.hooks
@hook = ProjectHook.new
......
......@@ -7,6 +7,8 @@ module Projects
before_action :authorize_read_project!
before_action :validate_jira_import_settings!
feature_category :integrations
def show
end
......
......@@ -11,6 +11,8 @@ class Projects::ImportsController < Projects::ApplicationController
before_action :redirect_if_progress, except: :show
before_action :redirect_if_no_import, only: :show
feature_category :importers
def new
end
......
......@@ -10,6 +10,8 @@ module Projects
prepend_before_action :project_without_auth
feature_category :incident_management
def create
result = webhook_processor.execute(params[:token])
......
......@@ -7,6 +7,8 @@ class Projects::IncidentsController < Projects::ApplicationController
before_action :authorize_read_issue!
before_action :load_incident, only: [:show]
feature_category :incident_management
def index
end
......
......@@ -7,6 +7,8 @@ module Projects
before_action :authorize_admin_issue_link!, only: [:create, :destroy]
before_action :authorize_issue_link_association!, only: :destroy
feature_category :issue_tracking
private
def authorize_admin_issue_link!
......
......@@ -65,6 +65,17 @@ class Projects::IssuesController < Projects::ApplicationController
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
@issues = @issuables
......
......@@ -16,6 +16,8 @@ class Projects::JobsController < Projects::ApplicationController
layout 'project'
feature_category :continuous_integration
def index
# We need all builds for tabs counters
@all_builds = Ci::JobsFinder.new(current_user: current_user, project: @project).execute
......
......@@ -15,6 +15,8 @@ class Projects::LabelsController < Projects::ApplicationController
respond_to :js, :html
feature_category :issue_tracking
def index
@prioritized_labels = @available_labels.prioritized(@project)
@labels = @available_labels.unprioritized(@project).page(params[:page])
......
......@@ -7,6 +7,8 @@ module Projects
before_action :authorize_read_pod_logs!
before_action :ensure_deployments, only: %i(k8s elasticsearch)
feature_category :logging
def index
if environment || cluster
render :index
......
......@@ -10,6 +10,8 @@ class Projects::MattermostsController < Projects::ApplicationController
before_action :service
before_action :teams, only: [:new]
feature_category :integrations
def new
end
......
......@@ -5,6 +5,8 @@ class Projects::MergeRequests::ApplicationController < Projects::ApplicationCont
before_action :merge_request
before_action :authorize_read_merge_request!
feature_category :code_review
private
def merge_request
......
......@@ -6,6 +6,8 @@ module Projects
class BuilderController < Projects::ApplicationController
before_action :authorize_metrics_dashboard!
feature_category :metrics
def panel_preview
respond_to do |format|
format.json do
......
......@@ -14,6 +14,8 @@ module Projects
push_frontend_feature_flag(:disable_metric_dashboard_refresh_rate)
end
feature_category :metrics
def show
if environment
render 'projects/environments/metrics'
......
......@@ -21,6 +21,8 @@ class Projects::MilestonesController < Projects::ApplicationController
respond_to :html
feature_category :issue_tracking
def index
@sort = params[:sort] || 'due_date_asc'
@milestones = milestones.sort_by_attribute(@sort)
......
......@@ -10,6 +10,8 @@ class Projects::MirrorsController < Projects::ApplicationController
layout "project_settings"
feature_category :source_code_management
def show
redirect_to_repository_settings(project, anchor: 'js-push-remote-settings')
end
......
......@@ -11,6 +11,8 @@ class Projects::NetworkController < Projects::ApplicationController
before_action :assign_options
before_action :assign_commit
feature_category :source_code_management
def show
@url = project_network_path(@project, @ref, @options.merge(format: :json))
@commit_url = project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")
......
......@@ -11,6 +11,8 @@ class Projects::NotesController < Projects::ApplicationController
before_action :authorize_create_note!, only: [:create]
before_action :authorize_resolve_note!, only: [:resolve, :unresolve]
feature_category :issue_tracking
def delete_attachment
note.remove_attachment!
note.update_attribute(:attachment, nil)
......
......@@ -6,6 +6,8 @@ module Projects
include PackagesAccess
include SendFileUpload
feature_category :package_registry
def download
package_file = project.package_files.find(params[:id])
......
......@@ -5,6 +5,8 @@ module Projects
class PackagesController < Projects::ApplicationController
include PackagesAccess
feature_category :package_registry
def show
@package = project.packages.find(params[:id])
@package_files = @package.package_files.recent
......
......@@ -8,6 +8,8 @@ class Projects::PagesController < Projects::ApplicationController
before_action :authorize_update_pages!, except: [:show, :destroy]
before_action :authorize_remove_pages!, only: [:destroy]
feature_category :pages
# rubocop: disable CodeReuse/ActiveRecord
def show
@domains = @project.pages_domains.order(:domain).present(current_user: current_user)
......
......@@ -9,6 +9,8 @@ class Projects::PagesDomainsController < Projects::ApplicationController
helper_method :domain_presenter
feature_category :pages
def show
end
......
......@@ -12,6 +12,8 @@ module Projects
respond_error(http_status: :bad_request, message: _('Request parameter %{param} is missing.') % { param: exception.param })
end
feature_category :metrics
def create
result = ::Metrics::Dashboard::CloneDashboardService.new(project, current_user, dashboard_params).execute
......
......@@ -10,6 +10,8 @@ class Projects::PipelineSchedulesController < Projects::ApplicationController
before_action :authorize_update_pipeline_schedule!, except: [:index, :new, :create, :play]
before_action :authorize_admin_pipeline_schedule!, only: [:destroy]
feature_category :continuous_integration
# rubocop: disable CodeReuse/ActiveRecord
def index
@scope = params[:scope]
......
......@@ -10,6 +10,8 @@ module Projects
before_action :pipeline
before_action :authorize_read_pipeline!
feature_category :continuous_integration
private
def pipeline
......
......@@ -31,6 +31,8 @@ class Projects::PipelinesController < Projects::ApplicationController
POLLING_INTERVAL = 10_000
feature_category :continuous_integration
def index
@pipelines = Ci::PipelinesFinder
.new(project, current_user, index_params)
......
......@@ -3,6 +3,8 @@
class Projects::PipelinesSettingsController < Projects::ApplicationController
before_action :authorize_admin_pipeline!
feature_category :continuous_integration
def show
redirect_to project_settings_ci_cd_path(@project, params: params.to_unsafe_h)
end
......
......@@ -5,6 +5,8 @@ class Projects::ProductAnalyticsController < Projects::ApplicationController
before_action :authorize_read_product_analytics!
before_action :tracker_variables, only: [:setup, :test]
feature_category :product_analytics
def index
@events = product_analytics_events.order_by_time.page(params[:page])
end
......
......@@ -8,6 +8,8 @@ class Projects::ProjectMembersController < Projects::ApplicationController
# Authorize
before_action :authorize_admin_project_member!, except: [:index, :leave, :request_access]
feature_category :authentication_and_authorization
def index
@sort = params[:sort].presence || sort_value_name
......
......@@ -16,6 +16,8 @@ module Projects
before_action :authorize_read_prometheus_alerts!, except: [:notify]
before_action :alert, only: [:update, :show, :destroy, :metrics_dashboard]
feature_category :alert_management
def index
render json: serialize_as_json(alerts)
end
......
......@@ -6,6 +6,8 @@ module Projects
before_action :authorize_admin_project!
before_action :require_prometheus_metrics!
feature_category :metrics
def active_common
respond_to do |format|
format.json do
......
......@@ -10,6 +10,8 @@ class Projects::ProtectedRefsController < Projects::ApplicationController
layout "project_settings"
feature_category :source_code_management
def index
redirect_to_repository_settings(@project)
end
......
......@@ -15,6 +15,8 @@ class Projects::RawController < Projects::ApplicationController
before_action :no_cache_headers, only: [:show]
before_action :redirect_to_external_storage, only: :show, if: :static_objects_external_storage_enabled?
feature_category :source_code_management
def show
@blob = @repository.blob_at(@commit.id, @path)
......
......@@ -11,6 +11,8 @@ class Projects::RefsController < Projects::ApplicationController
before_action :assign_ref_vars
before_action :authorize_download_code!
feature_category :source_code_management
def switch
respond_to do |format|
format.html do
......
......@@ -8,6 +8,8 @@ module Projects
before_action :verify_registry_enabled!
before_action :authorize_read_container_image!
feature_category :container_registry
private
def verify_registry_enabled!
......
......@@ -7,6 +7,8 @@ module Projects
before_action :release
before_action :authorize_read_release_evidence!
feature_category :release_evidence
def show
respond_to do |format|
format.json do
......
......@@ -13,6 +13,8 @@ class Projects::ReleasesController < Projects::ApplicationController
before_action :authorize_update_release!, only: %i[edit update]
before_action :authorize_create_release!, only: :new
feature_category :release_orchestration
def index
respond_to do |format|
format.html do
......
......@@ -18,6 +18,8 @@ class Projects::RepositoriesController < Projects::ApplicationController
before_action :authorize_admin_project!, only: :create
before_action :redirect_to_external_storage, only: :archive, if: :static_objects_external_storage_enabled?
feature_category :source_code_management
def create
@project.create_repository
......
......@@ -5,6 +5,8 @@ class Projects::RunnerProjectsController < Projects::ApplicationController
layout 'project_settings'
feature_category :continuous_integration
def create
@runner = Ci::Runner.find(params[:runner_project][:runner_id])
......
......@@ -6,6 +6,8 @@ class Projects::RunnersController < Projects::ApplicationController
layout 'project_settings'
feature_category :continuous_integration
def index
redirect_to project_settings_ci_cd_path(@project, anchor: 'js-runners-settings')
end
......
......@@ -5,6 +5,8 @@ module Projects
class FunctionsController < Projects::ApplicationController
before_action :authorize_read_cluster!
feature_category :serverless
def index
respond_to do |format|
format.json do
......
......@@ -3,6 +3,8 @@
class Projects::ServiceDeskController < Projects::ApplicationController
before_action :authorize_admin_project!
feature_category :service_desk
def show
json_response
end
......
......@@ -19,6 +19,8 @@ class Projects::ServicesController < Projects::ApplicationController
layout "project_settings"
feature_category :integrations
def edit
@default_integration = Service.default_integration(service.type, project)
end
......
......@@ -7,6 +7,8 @@ module Projects
before_action :check_feature_availability
feature_category :authentication_and_authorization
def index
@project_access_token = PersonalAccessToken.new
set_index_vars
......
......@@ -14,6 +14,8 @@ module Projects
helper_method :highlight_badge
feature_category :continuous_integration
def show
if Feature.enabled?(:ci_pipeline_triggers_settings_vue_ui, @project)
@triggers_json = ::Ci::TriggerSerializer.new.represent(
......
......@@ -6,6 +6,8 @@ module Projects
before_action :authorize_admin_project!
layout "project_settings"
feature_category :integrations
def show
@services = @project.find_or_initialize_services
end
......
......@@ -11,6 +11,8 @@ module Projects
helper_method :error_tracking_setting
helper_method :tracing_setting
feature_category :incident_management
def update
result = ::Projects::Operations::UpdateService.new(project, current_user, update_params).execute
......
......@@ -10,6 +10,9 @@ module Projects
push_frontend_feature_flag(:deploy_keys_on_protected_branches, @project)
end
feature_category :source_code_management, [:show, :cleanup]
feature_category :continuous_delivery, [:create_deploy_token]
def show
render_show
end
......
......@@ -4,6 +4,8 @@ class Projects::Snippets::ApplicationController < Projects::ApplicationControlle
include FindSnippet
include SnippetAuthorizations
feature_category :snippets
private
# This overrides the default snippet create authorization
......
......@@ -3,6 +3,8 @@
class Projects::StarrersController < Projects::ApplicationController
include SortingHelper
feature_category :projects
def index
@starrers = UsersStarProjectsFinder.new(@project, params, current_user: @current_user).execute
@sort = params[:sort].presence || sort_value_name
......
......@@ -13,6 +13,8 @@ class Projects::StaticSiteEditorController < Projects::ApplicationController
push_frontend_feature_flag(:sse_image_uploads)
end
feature_category :static_site_editor
def show
service_response = ::StaticSiteEditor::ConfigService.new(
container: project,
......
......@@ -8,6 +8,8 @@ class Projects::Tags::ReleasesController < Projects::ApplicationController
before_action :tag
before_action :release
feature_category :release_evidence
def edit
end
......
......@@ -10,6 +10,9 @@ class Projects::TagsController < Projects::ApplicationController
before_action :authorize_download_code!
before_action :authorize_admin_tag!, only: [:new, :create, :destroy]
feature_category :source_code_management, [:index, :show, :new, :destroy]
feature_category :release_evidence, [:create]
# rubocop: disable CodeReuse/ActiveRecord
def index
params[:sort] = params[:sort].presence || sort_value_recently_updated
......
......@@ -5,6 +5,8 @@ class Projects::TemplatesController < Projects::ApplicationController
before_action :authorize_can_read_issuable!
before_action :get_template_class
feature_category :templates
def show
template = @template_type.find(params[:key], project)
......
......@@ -6,6 +6,8 @@ class Projects::TodosController < Projects::ApplicationController
before_action :authenticate_user!, only: [:create]
feature_category :issue_tracking
private
def issuable
......
......@@ -12,6 +12,8 @@ module Projects
before_action :authorize_update_environment!
feature_category :tracing
def show
end
......
......@@ -15,6 +15,8 @@ class Projects::TreeController < Projects::ApplicationController
before_action :authorize_download_code!
before_action :authorize_edit_tree!, only: [:create_dir]
feature_category :source_code_management
def show
return render_404 unless @commit
......
......@@ -8,6 +8,8 @@ class Projects::TriggersController < Projects::ApplicationController
layout 'project_settings'
feature_category :continuous_integration
def index
redirect_to project_settings_ci_cd_path(@project, anchor: 'js-pipeline-triggers')
end
......
......@@ -11,6 +11,8 @@ class Projects::UploadsController < Projects::ApplicationController
before_action :authorize_upload_file!, only: [:create, :authorize]
before_action :verify_workhorse_api!, only: [:authorize]
feature_category :not_owned
private
def upload_model_class
......
......@@ -3,6 +3,8 @@
class Projects::UsagePingController < Projects::ApplicationController
before_action :authenticate_user!
feature_category :collection
def web_ide_clientside_preview
return render_404 unless Gitlab::CurrentSettings.web_ide_clientside_preview_enabled?
......
......@@ -3,6 +3,8 @@
class Projects::VariablesController < Projects::ApplicationController
before_action :authorize_admin_build!
feature_category :continuous_integration
def show
respond_to do |format|
format.json do
......
......@@ -3,6 +3,8 @@
class Projects::WebIdeSchemasController < Projects::ApplicationController
before_action :authenticate_user!
feature_category :web_ide
def show
return respond_422 unless branch_sha
......
......@@ -8,6 +8,8 @@ class Projects::WebIdeTerminalsController < Projects::ApplicationController
before_action :authorize_read_web_ide_terminal!, except: [:check_config, :create]
before_action :authorize_update_web_ide_terminal!, only: [:cancel, :retry]
feature_category :web_ide
def check_config
return respond_422 unless branch_sha
......
......@@ -5,6 +5,8 @@ class Projects::WikisController < Projects::ApplicationController
alias_method :container, :project
feature_category :wiki
def git_access
end
end
......@@ -47,6 +47,16 @@ class ProjectsController < Projects::ApplicationController
layout :determine_layout
feature_category :projects, [
:index, :show, :new, :create, :edit, :update, :transfer,
:destroy, :resolve, :archive, :unarchive, :toggle_star
]
feature_category :source_code_management, [:remove_fork, :housekeeping, :refs]
feature_category :issue_tracking, [:preview_markdown, :new_issuable_address]
feature_category :importers, [:export, :remove_export, :generate_new_export, :download_export]
feature_category :audit_events, [:activity]
def index
redirect_to(current_user ? root_path : explore_root_path)
end
......
......@@ -5,6 +5,11 @@ module EE
module AutocompleteSourcesController
extend ActiveSupport::Concern
prepended do
feature_category :epics, [:epics]
feature_category :vulnerability_management, [:vulnerabilities]
end
def epics
return render_404 unless project.group.feature_available?(:epics)
......
......@@ -10,6 +10,8 @@ module EE
include DescriptionDiffActions
before_action :whitelist_query_limiting_ee, only: [:update]
feature_category :issue_tracking, [:delete_description_version, :description_diff]
end
private
......
......@@ -9,6 +9,8 @@ module EE
before_action :log_download_export_audit_event, only: [:download_export]
before_action :log_archive_audit_event, only: [:archive]
before_action :log_unarchive_audit_event, only: [:unarchive]
feature_category :projects, [:restore]
end
def restore
......
......@@ -3,6 +3,8 @@
class Profiles::BillingsController < Profiles::ApplicationController
before_action :verify_namespace_plan_check_enabled
feature_category :purchase
def index
@plans_data = FetchSubscriptionPlansService
.new(plan: current_user.namespace.plan_name_for_upgrading)
......
......@@ -7,6 +7,8 @@ class Profiles::SlacksController < Profiles::ApplicationController
layout 'application'
feature_category :users
def edit
@projects = disabled_projects if current_user
end
......
......@@ -5,6 +5,8 @@ class Profiles::UsageQuotasController < Profiles::ApplicationController
push_frontend_feature_flag(:additional_repo_storage_by_namespace, @group)
end
feature_category :purchase
def index
@namespace = current_user.namespace
@projects = @namespace.projects.with_shared_runners_limit_enabled.page(params[:page])
......
......@@ -13,6 +13,8 @@ module Projects
track_unique_visits :index, target_id: 'p_analytics_code_reviews'
feature_category :planning_analytics
def index
end
end
......
......@@ -8,6 +8,8 @@ class Projects::Analytics::IssuesAnalyticsController < Projects::ApplicationCont
track_unique_visits :show, target_id: 'p_analytics_issues'
feature_category :planning_analytics
def show
respond_to do |format|
format.html
......
......@@ -7,6 +7,8 @@ class Projects::Analytics::MergeRequestAnalyticsController < Projects::Applicati
track_unique_visits :show, target_id: 'p_analytics_merge_request'
feature_category :planning_analytics
def show
end
end
......@@ -3,6 +3,8 @@
class Projects::ApproverGroupsController < Projects::ApplicationController
before_action :authorize_for_subject!
feature_category :code_review
def destroy
subject.approver_groups.find(params[:id]).destroy
......
......@@ -3,6 +3,8 @@
class Projects::ApproversController < Projects::ApplicationController
before_action :authorize_for_subject!
feature_category :code_review
# @deprecated
def destroy
subject.approvers.find(params[:id]).destroy
......
......@@ -13,6 +13,8 @@ class Projects::AuditEventsController < Projects::ApplicationController
layout 'project_settings'
feature_category :audit_events
def index
@is_last_page = events.last_page?
@events = AuditEventSerializer.new.represent(events)
......
......@@ -8,6 +8,8 @@ module Projects
push_frontend_feature_flag(:path_to_vulnerable_dependency, project)
end
feature_category :dependency_scanning
def index
respond_to do |format|
format.html do
......
......@@ -6,6 +6,8 @@ module Projects
before_action :authorize_admin_feature_flags_issue_links!
feature_category :feature_flags
private
def create_service
......
......@@ -10,6 +10,8 @@ class Projects::InsightsController < Projects::ApplicationController
track_unique_visits :show, target_id: 'p_analytics_insights'
feature_category :insights
private
def insights_entity
......
......@@ -17,6 +17,8 @@ module Projects
rescue_from ::Projects::Integrations::Jira::IssuesFinder::IntegrationError, with: :render_integration_error
rescue_from ::Projects::Integrations::Jira::IssuesFinder::RequestError, with: :render_request_error
feature_category :integrations
def index
params[:state] = params[:state].presence || default_state
......
......@@ -4,6 +4,8 @@ class Projects::Iterations::InheritedController < Projects::ApplicationControlle
before_action :check_iterations_available!
before_action :authorize_show_iteration!
feature_category :issue_tracking
def show; end
private
......
......@@ -4,6 +4,8 @@ class Projects::IterationsController < Projects::ApplicationController
before_action :check_iterations_available!
before_action :authorize_show_iteration!
feature_category :issue_tracking
def index; end
private
......
......@@ -5,6 +5,8 @@ module Projects
before_action :authorize_read_licenses!, only: [:index]
before_action :authorize_admin_software_license_policy!, only: [:create, :update]
feature_category :license_compliance
def index
respond_to do |format|
format.html do
......
......@@ -4,6 +4,8 @@ module Projects
class OnDemandScansController < Projects::ApplicationController
before_action :authorize_read_on_demand_scans!
feature_category :dynamic_application_security_testing
def index
end
end
......
......@@ -13,6 +13,8 @@ class Projects::PathLocksController < Projects::ApplicationController
before_action :assign_ref_vars, only: :toggle
before_action :lfs_blob_ids, only: :toggle
feature_category :source_code_management
def index
@path_locks = @project.path_locks.page(params[:page])
end
......
......@@ -3,6 +3,8 @@ class Projects::ProtectedEnvironmentsController < Projects::ApplicationControlle
before_action :authorize_admin_project!
before_action :protected_environment, except: [:create, :search]
feature_category :continuous_delivery
def create
protected_environment = ::ProtectedEnvironments::CreateService.new(@project, current_user, protected_environment_params).execute
......
......@@ -11,6 +11,8 @@ class Projects::PushRulesController < Projects::ApplicationController
layout "project_settings"
feature_category :source_code_management
def update
@push_rule = project.push_rule
@push_rule.update(push_rule_params)
......
......@@ -12,6 +12,8 @@ class Projects::Quality::TestCasesController < Projects::ApplicationController
push_frontend_feature_flag(:quality_test_cases, project)
end
feature_category :quality_management
def index
respond_to do |format|
format.html
......
......@@ -3,6 +3,8 @@
class Projects::RequirementsManagement::RequirementsController < Projects::ApplicationController
before_action :authorize_read_requirement!
feature_category :requirements_management
def index
respond_to do |format|
format.html
......
......@@ -17,6 +17,8 @@ module Projects
authorize_modify_auto_fix_setting!
end
feature_category :static_application_security_testing
def show
@configuration = ConfigurationPresenter.new(project,
auto_fix_permission: auto_fix_authorized?,
......
......@@ -10,6 +10,8 @@ module Projects
before_action only: [:index] do
push_frontend_feature_flag(:security_auto_fix, project, default_enabled: false)
end
feature_category :static_application_security_testing
end
end
end
......@@ -5,6 +5,8 @@ module Projects
class DastProfilesController < Projects::ApplicationController
before_action :authorize_read_on_demand_scans!
feature_category :dynamic_application_security_testing
def show
end
end
......
......@@ -5,6 +5,8 @@ module Projects
class DastScannerProfilesController < Projects::ApplicationController
before_action :authorize_read_on_demand_scans!
feature_category :dynamic_application_security_testing
def new
end
......
......@@ -8,6 +8,8 @@ module Projects
push_frontend_feature_flag(:security_on_demand_scans_site_validation, @project)
end
feature_category :dynamic_application_security_testing
def new
end
......
......@@ -3,6 +3,8 @@
module Projects
module Security
class DiscoverController < Projects::ApplicationController
feature_category :navigation
def show
render_404 unless helpers.show_discover_project_security?(@project)
end
......
......@@ -8,6 +8,8 @@ module Projects
before_action :authorize_read_threat_monitoring!
before_action :set_polling_interval, only: [:summary]
feature_category :container_network_security
def summary
return not_found unless environment.has_metrics?
......
......@@ -11,6 +11,8 @@ module Projects
before_action :ensure_sast_configuration_enabled!, except: [:create]
before_action :authorize_edit_tree!, only: [:create]
feature_category :static_application_security_testing
def show
end
......
......@@ -6,6 +6,8 @@ module Projects
before_action :authorize_read_vulnerability!
before_action :scanned_resources
feature_category :dynamic_application_security_testing
def index
respond_to do |format|
format.csv do
......
......@@ -13,6 +13,8 @@ module Projects
before_action :authorize_create_note!, only: [:create]
feature_category :vulnerability_management
private
alias_method :vulnerable, :project
......
......@@ -11,6 +11,8 @@ module Projects
alias_method :vulnerable, :project
feature_category :vulnerability_management
def show
pipeline = vulnerability.finding.pipelines.first
@pipeline = pipeline if Ability.allowed?(current_user, :read_pipeline, pipeline)
......
......@@ -8,6 +8,8 @@ module Projects
before_action :authorize_read_waf_anomalies!
before_action :set_polling_interval
feature_category :web_firewall
def summary
return not_found unless anomaly_summary_service.elasticsearch_client
......
......@@ -11,6 +11,8 @@ module Projects
layout 'project_settings'
feature_category :integrations
def slack_auth
result = Projects::SlackApplicationInstallService.new(project, current_user, params).execute
......
......@@ -7,6 +7,8 @@ class Projects::SubscriptionsController < Projects::ApplicationController
before_action :feature_ci_project_subscriptions!
before_action :authorize_upstream_project!, only: [:create]
feature_category :continuous_integration
def create
subscription = project.upstream_project_subscriptions.create(upstream_project: upstream_project)
......
......@@ -4,6 +4,8 @@ module Projects
class ThreatMonitoringController < Projects::ApplicationController
before_action :authorize_read_threat_monitoring!
feature_category :web_firewall
def edit
@environment = project.environments.find(params[:environment_id])
@policy_name = params[:id]
......
......@@ -11,6 +11,8 @@ class Projects::VulnerabilityFeedbackController < Projects::ApplicationControlle
respond_to :json
feature_category :vulnerability_management
def index
# TODO: Move to finder or list service
@vulnerability_feedback = @project.vulnerability_feedback.with_associations
......
......@@ -25,13 +25,6 @@ RSpec.describe "Every controller" do
controller_actions.map do |controller, action|
next if controller.feature_category_for_action(action)
next unless controller.to_s.start_with?('B', 'C', 'D', 'E', 'F',
'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'Q', 'R',
'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', 'A', 'G',
'Projects::MergeRequestsController')
"#{controller}##{action}"
end.compact
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment