Commit c987c5e1 authored by Sean McGivern's avatar Sean McGivern

Add feature categories to ProjectsController::[A-D]*

Danger wants a commit body, but there's really not any more to say.
These are all best effort and not guaranteed to be 100% accurate.
parent 150c4b6d
......@@ -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,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)
......
......@@ -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
......
......@@ -23,14 +23,12 @@ RSpec.describe "Every controller" do
let_it_be(:routes_without_category) do
controller_actions.map do |controller, action|
child_controller = controller.to_s.split('::').second
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')
next if controller.to_s.start_with?('P') &&
!child_controller.to_s.start_with?('A', 'B', 'C', 'D')
"#{controller}##{action}"
end.compact
......
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