Commit 62dbee1b authored by Sean McGivern's avatar Sean McGivern

Merge branch 'controller-feature-categories-h-z' into 'master'

Controller feature categories H-Z

See merge request gitlab-org/gitlab!44150
parents 047387d6 a7583be1
......@@ -2,6 +2,7 @@
class HelpController < ApplicationController
skip_before_action :authenticate_user!, unless: :public_visibility_restricted?
feature_category :not_owned
layout 'help'
......
......@@ -11,6 +11,8 @@ class IdeController < ApplicationController
push_frontend_feature_flag(:schema_linting)
end
feature_category :web_ide
def index
Gitlab::UsageDataCounters::WebIdeCounter.increment_views_count
end
......
# frozen_string_literal: true
class Import::AvailableNamespacesController < ApplicationController
feature_category :importers
def index
render json: NamespaceSerializer.new.represent(current_user.manageable_groups_with_routes)
end
......
......@@ -4,6 +4,7 @@ class Import::BaseController < ApplicationController
include ActionView::Helpers::SanitizeHelper
before_action :import_rate_limit, only: [:create]
feature_category :importers
def status
respond_to do |format|
......
......@@ -4,6 +4,8 @@ class Import::BulkImportsController < ApplicationController
before_action :ensure_group_import_enabled
before_action :verify_blocked_uri, only: :status
feature_category :importers
def configure
session[access_token_key] = params[access_token_key]&.strip
session[url_key] = params[url_key]
......
......@@ -6,6 +6,8 @@ class Import::GitlabGroupsController < ApplicationController
before_action :ensure_group_import_enabled
before_action :import_rate_limit, only: %i[create]
feature_category :importers
def create
unless file_is_valid?(group_params[:file])
return redirect_back_or_default(options: { alert: s_('GroupImport|Unable to process group import file') })
......
......@@ -12,6 +12,8 @@ class InvitesController < ApplicationController
respond_to :html
feature_category :authentication_and_authorization
def show
track_new_user_invite_experiment('opened')
accept if skip_invitation_prompt?
......
......@@ -7,6 +7,8 @@ class JiraConnect::ApplicationController < ApplicationController
skip_before_action :verify_authenticity_token
before_action :verify_atlassian_jwt!
feature_category :integrations
attr_reader :current_jira_installation
private
......
......@@ -8,6 +8,8 @@ class JwtController < ApplicationController
# Add this before other actions, since we want to have the user or project
prepend_before_action :auth_user, :authenticate_project_or_user
feature_category :authentication_and_authorization
SERVICES = {
Auth::ContainerRegistryAuthenticationService::AUDIENCE => Auth::ContainerRegistryAuthenticationService
}.freeze
......
......@@ -3,6 +3,8 @@
class NotificationSettingsController < ApplicationController
before_action :authenticate_user!
feature_category :users
def create
return render_404 unless can_read?(resource)
......
......@@ -8,6 +8,8 @@ class Oauth::Jira::AuthorizationsController < ApplicationController
skip_before_action :authenticate_user!
skip_before_action :verify_authenticity_token
feature_category :integrations
# 1. Rewire Jira OAuth initial request to our stablished OAuth authorization URL.
def new
session[:redirect_uri] = params['redirect_uri']
......
......@@ -11,6 +11,8 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
protect_from_forgery except: [:kerberos, :saml, :cas3, :failure], with: :exception, prepend: true
feature_category :authentication_and_authorization
def handle_omniauth
omniauth_flow(Gitlab::Auth::OAuth)
end
......
......@@ -7,6 +7,8 @@ module Registrations
before_action :check_experiment_enabled
before_action :ensure_namespace_path_param
feature_category :navigation
def update
current_user.experience_level = params[:experience_level]
......
......@@ -15,6 +15,8 @@ class RegistrationsController < Devise::RegistrationsController
if: -> { action_name == 'create' && Gitlab::CurrentSettings.current_application_settings.enforce_terms? }
before_action :load_recaptcha, only: :new
feature_category :authentication_and_authorization
def new
if experiment_enabled?(:signup_flow)
track_experiment_event(:terms_opt_in, 'start')
......
......@@ -20,6 +20,8 @@ module Repositories
prepend_before_action :authenticate_user, :parse_repo_path
feature_category :source_code_management
private
def download_request?
......
# frozen_string_literal: true
class RunnerSetupController < ApplicationController
feature_category :continuous_integration
def platforms
render json: Gitlab::Ci::RunnerInstructions::OS.merge(Gitlab::Ci::RunnerInstructions::OTHER_ENVIRONMENTS)
end
......
......@@ -25,6 +25,8 @@ class SearchController < ApplicationController
layout 'search'
feature_category :global_search
def show
@project = search_service.project
@group = search_service.group
......
......@@ -3,6 +3,8 @@
class SentNotificationsController < ApplicationController
skip_before_action :authenticate_user!
feature_category :users
def unsubscribe
@sent_notification = SentNotification.for(params[:id])
......
......@@ -49,6 +49,8 @@ class SessionsController < Devise::SessionsController
# token mismatch.
protect_from_forgery with: :exception, prepend: true, except: :destroy
feature_category :authentication_and_authorization
CAPTCHA_HEADER = 'X-GitLab-Show-Login-Captcha'
MAX_FAILED_LOGIN_ATTEMPTS = 5
......
......@@ -4,6 +4,8 @@ class Snippets::ApplicationController < ApplicationController
include FindSnippet
include SnippetAuthorizations
feature_category :snippets
private
def authorize_read_snippet!
......
......@@ -8,6 +8,8 @@ class Snippets::NotesController < ApplicationController
before_action :authorize_read_snippet!, only: [:show, :index]
before_action :authorize_create_note!, only: [:create]
feature_category :snippets
private
def note
......
......@@ -25,6 +25,8 @@ class UploadsController < ApplicationController
before_action :authorize_create_access!, only: [:create, :authorize]
before_action :verify_workhorse_api!, only: [:authorize]
feature_category :not_owned
def uploader_class
PersonalFileUploader
end
......
# frozen_string_literal: true
class UserCalloutsController < ApplicationController
feature_category :navigation
def create
callout = ensure_callout
......
......@@ -14,6 +14,8 @@ module Users
layout 'terms'
feature_category :users
def index
@redirect = redirect_path
......
......@@ -21,6 +21,8 @@ class UsersController < ApplicationController
before_action :authorize_read_user_profile!,
only: [:calendar, :calendar_activities, :groups, :projects, :contributed_projects, :starred_projects, :snippets]
feature_category :users
def show
respond_to do |format|
format.html
......
......@@ -5,6 +5,8 @@ class OmniauthKerberosSpnegoController < ApplicationController
skip_before_action :authenticate_user!
feature_category :authentication_and_authorization
def negotiate
if spnego_provided? && (krb_principal = spnego_credentials!(spnego_token))
session[OmniAuth::Strategies::KerberosSpnego::SESSION_KEY] = krb_principal
......
......@@ -5,6 +5,8 @@ class OperationsController < ApplicationController
respond_to :json, only: [:list]
feature_category :release_orchestration
POLLING_INTERVAL = 120_000
def index
......
......@@ -7,6 +7,8 @@ module Registrations
before_action :authorize_create_group!, only: :new
before_action :check_experiment_enabled
feature_category :navigation
def new
@group = Group.new(visibility_level: helpers.default_group_visibility)
end
......
......@@ -7,6 +7,8 @@ module Registrations
before_action :check_experiment_enabled
before_action :find_namespace, only: :new
feature_category :navigation
def new
@project = Project.new(namespace: @namespace)
end
......
......@@ -9,6 +9,8 @@ module Security
push_frontend_feature_flag(:instance_security_dashboard, default_enabled: true)
end
feature_category :vulnerability_management
protected
def check_feature_enabled!
......
......@@ -9,6 +9,8 @@ class SmartcardController < ApplicationController
before_action :check_ngingx_certificate_header, only: :extract_certificate
before_action :check_certificate_param, only: :verify_certificate
feature_category :authentication_and_authorization
def auth
redirect_to extract_certificate_smartcard_url(extract_certificate_url_options)
end
......
......@@ -8,6 +8,8 @@ module Subscriptions
before_action :find_group
feature_category :purchase
def edit
end
......
......@@ -4,6 +4,8 @@ class SubscriptionsController < ApplicationController
layout 'checkout'
skip_before_action :authenticate_user!, only: :new
feature_category :purchase
content_security_policy do |p|
next if p.directives.blank?
......
......@@ -7,6 +7,8 @@ class SurveyResponsesController < ApplicationController
skip_before_action :authenticate_user!
feature_category :collection
def index
track_response if Gitlab.com?
......
......@@ -10,6 +10,8 @@ class TrialsController < ApplicationController
before_action :find_or_create_namespace, only: :apply
before_action :record_user_for_group_only_trials_experiment, only: :select
feature_category :purchase
def new
end
......
......@@ -3,6 +3,8 @@
class UnsubscribesController < ApplicationController
skip_before_action :authenticate_user!
feature_category :users
def show
@user = get_user
end
......
......@@ -3,6 +3,8 @@
class UsernamesController < ApplicationController
skip_before_action :authenticate_user!, only: [:suggest]
feature_category :users
def suggest
if validate_params
username = ::User.username_suggestion(params[:name])
......
......@@ -24,19 +24,19 @@ RSpec.describe "Every controller" do
let_it_be(:routes_without_category) 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', 'Projects::MergeRequestsController')
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',
'Projects::MergeRequestsController')
"#{controller}##{action}"
end.compact
end
it "has feature categories" do
routes_without_category.map { |x| x.split('#') }.group_by(&:first).each do |controller, actions|
puts controller
puts actions.map { |x| ":#{x.last}" }.sort.join(', ')
puts ''
end
expect(routes_without_category).to be_empty, "#{routes_without_category} did not have a category"
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