Commit 104512a8 authored by Bob Van Landuyt's avatar Bob Van Landuyt

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

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

See merge request gitlab-org/gitlab!44288
parents 52bf3209 95e14061
......@@ -6,6 +6,8 @@ module GoogleApi
before_action :validate_session_key!
feature_category :kubernetes_management
def callback
token, expires_at = GoogleApi::CloudPlatform::Client
.new(nil, callback_google_api_auth_url)
......
......@@ -26,6 +26,8 @@ class GraphqlController < ApplicationController
# callback execution order here
around_action :sessionless_bypass_admin_mode!, if: :sessionless_user?
feature_category :not_owned
def execute
result = multiplex? ? execute_multiplex : execute_query
......
......@@ -5,6 +5,8 @@ class Groups::AvatarsController < Groups::ApplicationController
skip_cross_project_access_check :destroy
feature_category :subgroups
def destroy
@group.remove_avatar!
@group.save
......
......@@ -12,6 +12,8 @@ class Groups::BoardsController < Groups::ApplicationController
push_frontend_feature_flag(:boards_with_swimlanes, group, default_enabled: false)
end
feature_category :boards
private
def assign_endpoint_vars
......
......@@ -5,6 +5,8 @@ module Groups
before_action :group
skip_cross_project_access_check :index
feature_category :subgroups
def index
parent = if params[:parent_id].present?
GroupFinder.new(current_user).execute(id: params[:parent_id])
......
......@@ -3,6 +3,8 @@
class Groups::DeployTokensController < Groups::ApplicationController
before_action :authorize_destroy_deploy_token!
feature_category :continuous_delivery
def revoke
@token = @group.deploy_tokens.find(params[:id])
@token.revoke!
......
......@@ -4,6 +4,8 @@ class Groups::GroupLinksController < Groups::ApplicationController
before_action :authorize_admin_group!
before_action :group_link, only: [:update, :destroy]
feature_category :subgroups
def create
shared_with_group = Group.find(params[:shared_with_group_id]) if params[:shared_with_group_id].present?
......
......@@ -19,6 +19,8 @@ class Groups::GroupMembersController < Groups::ApplicationController
:approve_access_request, :leave, :resend_invite,
:override
feature_category :authentication_and_authorization
def index
@sort = params[:sort].presence || sort_value_name
......
......@@ -3,6 +3,8 @@
class Groups::ImportsController < Groups::ApplicationController
include ContinueParams
feature_category :importers
def show
if @group.import_state.nil? || @group.import_state.finished?
if continue_params[:to]
......
......@@ -10,6 +10,8 @@ class Groups::LabelsController < Groups::ApplicationController
respond_to :html
feature_category :issue_tracking
def index
respond_to do |format|
format.html do
......
......@@ -9,6 +9,8 @@ class Groups::MilestonesController < Groups::ApplicationController
push_frontend_feature_flag(:burnup_charts, @group)
end
feature_category :issue_tracking
def index
respond_to do |format|
format.html do
......
......@@ -4,6 +4,8 @@ module Groups
class PackagesController < Groups::ApplicationController
before_action :verify_packages_enabled!
feature_category :package_registry
private
def verify_packages_enabled!
......
......@@ -7,6 +7,8 @@ module Groups
before_action :verify_container_registry_enabled!
before_action :authorize_read_container_image!
feature_category :package_registry
def index
respond_to do |format|
format.html
......
......@@ -2,6 +2,8 @@
module Groups
class ReleasesController < Groups::ApplicationController
feature_category :release_evidence
def index
respond_to do |format|
format.json do
......
......@@ -7,6 +7,8 @@ class Groups::RunnersController < Groups::ApplicationController
before_action :runner, only: [:edit, :update, :destroy, :pause, :resume, :show]
feature_category :continuous_integration
def show
render 'shared/runners/show'
end
......
......@@ -13,6 +13,8 @@ module Groups
end
before_action :define_variables, only: [:show]
feature_category :continuous_integration
NUMBER_OF_RUNNERS_PER_PAGE = 4
def show
......
......@@ -7,6 +7,8 @@ module Groups
before_action :authorize_admin_group!
feature_category :integrations
def index
@integrations = Service.find_or_initialize_all(Service.for_group(group)).sort_by(&:title)
end
......
......@@ -10,6 +10,8 @@ module Groups
push_frontend_feature_flag(:ajax_new_deploy_token, @group)
end
feature_category :continuous_delivery
def create_deploy_token
result = Groups::DeployTokens::CreateService.new(@group, current_user, deploy_token_params).execute
@new_deploy_token = result[:deploy_token]
......
......@@ -6,6 +6,8 @@ module Groups
before_action :group
skip_cross_project_access_check :index
feature_category :subgroups
def index
shared_projects = GroupProjectsFinder.new(
group: group,
......
......@@ -9,6 +9,8 @@ class Groups::UploadsController < Groups::ApplicationController
before_action :authorize_upload_file!, only: [:create, :authorize]
before_action :verify_workhorse_api!, only: [:authorize]
feature_category :subgroups
private
def upload_model_class
......
......@@ -6,6 +6,8 @@ module Groups
skip_cross_project_access_check :show, :update
feature_category :continuous_integration
def show
respond_to do |format|
format.json do
......
......@@ -46,6 +46,17 @@ class GroupsController < Groups::ApplicationController
layout :determine_layout
feature_category :subgroups, [
:index, :new, :create, :show, :edit, :update,
:destroy, :details, :transfer
]
feature_category :audit_events, [:activity]
feature_category :issue_tracking, [:issues, :issues_calendar, :preview_markdown]
feature_category :code_review, [:merge_requests]
feature_category :projects, [:projects]
feature_category :importers, [:export, :download_export]
def index
redirect_to(current_user ? dashboard_groups_path : explore_groups_path)
end
......
......@@ -14,6 +14,8 @@ module EE
before_action only: :issues do
push_frontend_feature_flag(:scoped_labels, @group, type: :licensed)
end
feature_category :subgroups, [:restore, :subgroups]
end
override :render_show_html
......
......@@ -4,6 +4,8 @@ class Groups::Analytics::ApplicationController < ApplicationController
include RoutableActions
include GracefulTimeoutHandling
feature_category :planning_analytics
private
def self.increment_usage_counter(counter_klass, counter, *args)
......
......@@ -15,6 +15,8 @@ class Groups::AuditEventsController < Groups::ApplicationController
layout 'group_settings'
feature_category :audit_events
def index
@is_last_page = events.last_page?
@events = AuditEventSerializer.new.represent(events)
......
......@@ -3,6 +3,11 @@
class Groups::AutocompleteSourcesController < Groups::ApplicationController
before_action :load_autocomplete_service, except: [:members]
feature_category :subgroups, [:members]
feature_category :issue_tracking, [:issues, :labels, :milestones, :commands]
feature_category :code_review, [:merge_requests]
feature_category :epics, [:epics]
def members
render json: ::Groups::ParticipantsService.new(@group, current_user).execute(target)
end
......
......@@ -6,6 +6,8 @@ class Groups::BillingsController < Groups::ApplicationController
layout 'group_settings'
feature_category :purchase
def index
@top_most_group = @group.root_ancestor if @group.has_parent?
current_plan = (@top_most_group || @group).plan_name_for_upgrading
......
......@@ -11,6 +11,8 @@ class Groups::ContributionAnalyticsController < Groups::ApplicationController
track_unique_visits :show, target_id: 'g_analytics_contribution'
feature_category :planning_analytics
def show
@start_date = data_collector.from
......
......@@ -7,6 +7,8 @@ module Groups
before_action :authorize_admin_dependency_proxy!, only: :update
before_action :dependency_proxy
feature_category :package_registry
def show
@blobs_count = group.dependency_proxy_blobs.count
@blobs_total_size = group.dependency_proxy_blobs.total_size
......
......@@ -9,6 +9,8 @@ class Groups::DependencyProxyForContainersController < Groups::ApplicationContro
attr_reader :token
feature_category :package_registry
def manifest
result = DependencyProxy::PullManifestService.new(image, tag, token).execute
......
......@@ -6,6 +6,8 @@ class Groups::EpicIssuesController < Groups::ApplicationController
before_action :check_epics_available!
before_action :authorize_issue_link_association!, only: [:destroy, :update]
feature_category :epics
def update
result = EpicIssues::UpdateService.new(link, current_user, params[:epic]).execute
......
......@@ -6,6 +6,8 @@ class Groups::EpicLinksController < Groups::ApplicationController
before_action :check_epics_available!, only: [:index, :destroy]
before_action :check_subepics_available!, only: [:create, :update]
feature_category :epics
def update
result = EpicLinks::UpdateService.new(child_epic, current_user, params[:epic]).execute
......
......@@ -10,6 +10,8 @@ class Groups::Epics::NotesController < Groups::ApplicationController
before_action :epic
before_action :authorize_create_note!, only: [:create]
feature_category :epics
private
def project
......
......@@ -21,6 +21,8 @@ class Groups::EpicsController < Groups::ApplicationController
push_frontend_feature_flag(:vue_issuable_epic_sidebar, @group)
end
feature_category :epics
def new
@noteable = Epic.new
end
......
......@@ -14,6 +14,8 @@ class Groups::HooksController < Groups::ApplicationController
layout 'group_settings'
feature_category :integrations
def index
@hooks = @group.hooks
@hook = GroupHook.new
......
......@@ -9,6 +9,8 @@ class Groups::InsightsController < Groups::ApplicationController
track_unique_visits :show, target_id: 'g_analytics_insights'
feature_category :insights
private
def authorize_read_group!
......
......@@ -9,6 +9,8 @@ class Groups::IssuesAnalyticsController < Groups::ApplicationController
track_unique_visits :show, target_id: 'g_analytics_issues'
feature_category :planning_analytics
def show
respond_to do |format|
format.html
......
# frozen_string_literal: true
class Groups::IssuesController < Groups::BulkUpdateController
feature_category :issue_tracking
end
......@@ -5,6 +5,8 @@ class Groups::IterationsController < Groups::ApplicationController
before_action :authorize_show_iteration!, only: [:index, :show]
before_action :authorize_create_iteration!, only: [:new, :edit]
feature_category :issue_tracking
def index; end
def show; end
......
......@@ -8,6 +8,8 @@ class Groups::LdapGroupLinksController < Groups::ApplicationController
layout 'group_settings'
feature_category :authentication_and_authorization
def index
end
......
......@@ -6,6 +6,8 @@ class Groups::LdapSettingsController < Groups::ApplicationController
before_action :authorize_admin_group!
before_action :authorize_manage_ldap_settings!
feature_category :authentication_and_authorization
def update
if @group.update(ldap_settings_params)
redirect_back_or_default(default: group_ldap_group_links_path(@group), options: { notice: _('LDAP settings updated') })
......
......@@ -5,6 +5,8 @@ class Groups::LdapsController < Groups::ApplicationController
before_action :authorize_admin_group!
before_action :check_enabled_extras!
feature_category :authentication_and_authorization
def sync
# A group can transition to pending if it is in the ready or failed
# state. If it is in the started or pending state, then that means
......
# frozen_string_literal: true
class Groups::MergeRequestsController < Groups::BulkUpdateController
feature_category :code_review
end
......@@ -5,6 +5,8 @@ class Groups::OmniauthCallbacksController < OmniauthCallbacksController
skip_before_action :verify_authenticity_token, only: [:failure, :group_saml]
feature_category :authentication_and_authorization
def group_saml
@unauthenticated_group = Group.find_by_full_path(params[:group_id])
@saml_provider = @unauthenticated_group.saml_provider
......
......@@ -10,6 +10,8 @@ class Groups::PushRulesController < Groups::ApplicationController
respond_to :html
feature_category :source_code_management
def edit
end
......
......@@ -14,6 +14,8 @@ module Groups
push_frontend_feature_flag(:async_filtering, @group)
end
feature_category :roadmaps
# show roadmap for a group
def show
# Used to persist the order and show the correct sorting dropdown on UI.
......
......@@ -8,6 +8,8 @@ class Groups::SamlProvidersController < Groups::ApplicationController
before_action :check_group_saml_available!
before_action :check_group_saml_configured
feature_category :authentication_and_authorization
def show
@saml_provider = @group.saml_provider || @group.build_saml_provider
@saml_response_check = load_test_response if @saml_provider.persisted?
......
......@@ -8,6 +8,8 @@ class Groups::ScimOauthController < Groups::ApplicationController
before_action :check_group_saml_available!
before_action :check_group_saml_configured
feature_category :authentication_and_authorization
def show
scim_token = ScimOauthAccessToken.find_by_group_id(@group.id)
......
......@@ -9,6 +9,8 @@ class Groups::Security::ComplianceDashboardsController < Groups::ApplicationCont
track_unique_visits :show, target_id: 'g_compliance_dashboard'
feature_category :compliance_management
def show
@last_page = paginated_merge_requests.last_page?
@merge_requests = serialize(paginated_merge_requests)
......
......@@ -11,6 +11,8 @@ class Groups::Security::CredentialsController < Groups::ApplicationController
before_action :validate_group_level_credentials_inventory_available!, only: [:index]
feature_category :compliance_management
private
def validate_group_level_credentials_inventory_available!
......
......@@ -2,6 +2,8 @@
class Groups::Security::DashboardController < Groups::ApplicationController
layout 'group'
feature_category :vulnerability_management
def show
render :unavailable unless dashboard_available?
end
......
......@@ -3,6 +3,8 @@
class Groups::Security::DiscoverController < Groups::ApplicationController
layout 'group'
feature_category :vulnerability_management
def show
render_404 unless helpers.show_discover_group_security?(@group)
end
......
......@@ -4,6 +4,8 @@ class Groups::Security::MergeCommitReportsController < Groups::ApplicationContro
before_action :authorize_compliance_dashboard!
feature_category :compliance_management
def index
csv_data = MergeCommits::ExportCsvService.new(current_user, group).csv_data
......
......@@ -5,6 +5,8 @@ module Groups
class VulnerabilitiesController < Groups::ApplicationController
layout 'group'
feature_category :vulnerability_management
def index
render :unavailable unless dashboard_available?
end
......
......@@ -15,6 +15,8 @@ class Groups::SsoController < Groups::ApplicationController
layout 'devise'
feature_category :authentication_and_authorization
def saml
@redirect_path = safe_redirect_path(params[:redirect]) || group_path(unauthenticated_group)
@group_path = unauthenticated_group.path
......
......@@ -6,6 +6,8 @@ class Groups::TodosController < Groups::ApplicationController
before_action :authenticate_user!, only: [:create]
feature_category :epics
private
# rubocop: disable CodeReuse/ActiveRecord
......
......@@ -9,6 +9,8 @@ class Groups::UsageQuotasController < Groups::ApplicationController
layout 'group_settings'
feature_category :purchase
def index
@projects = @group.all_projects.with_shared_runners_limit_enabled.page(params[:page])
end
......
......@@ -5,6 +5,8 @@ class Groups::WikisController < Groups::ApplicationController
alias_method :container, :group
feature_category :wiki
private
def authorize_read_wiki!
......
......@@ -29,7 +29,7 @@ RSpec.describe "Every controller" do
'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'Q', 'R',
'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', 'A',
'X', 'Y', 'Z', 'A', 'G',
'Projects::MergeRequestsController')
"#{controller}##{action}"
......
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