Merge branch 'frozen-string-app-controllers-much-more' into 'master'
Enable even more frozen string in app/controllers See merge request gitlab-org/gitlab-ce!21919
This commit is contained in:
commit
4962bee87a
89 changed files with 183 additions and 12 deletions
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module InvalidUTF8ErrorHandler
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::ApplicationController < ApplicationController
|
||||
include CookiesHelper
|
||||
include RoutableActions
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::ArtifactsController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
include RendersBlob
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::AutocompleteSourcesController < Projects::ApplicationController
|
||||
before_action :load_autocomplete_service, except: [:members]
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::AvatarsController < Projects::ApplicationController
|
||||
include SendsBlob
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::BadgesController < Projects::ApplicationController
|
||||
layout 'project_settings'
|
||||
before_action :authorize_admin_project!, only: [:index]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Controller for viewing a file's blame
|
||||
class Projects::BlameController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Controller for viewing a file's blame
|
||||
class Projects::BlobController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::BoardsController < Projects::ApplicationController
|
||||
include BoardsResponses
|
||||
include IssuableCollections
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::BranchesController < Projects::ApplicationController
|
||||
include ActionView::Helpers::SanitizeHelper
|
||||
include SortingHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::BuildArtifactsController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
include RendersBlob
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::BuildsController < Projects::ApplicationController
|
||||
before_action :authorize_read_build!
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::Ci::LintsController < Projects::ApplicationController
|
||||
before_action :authorize_create_pipeline!
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::Clusters::ApplicationsController < Projects::ApplicationController
|
||||
before_action :cluster
|
||||
before_action :application_class, only: [:create]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::ClustersController < Projects::ApplicationController
|
||||
before_action :cluster, except: [:index, :new, :create_gcp, :create_user]
|
||||
before_action :authorize_read_cluster!
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Controller for a specific Commit
|
||||
#
|
||||
# Not to be confused with CommitsController, plural.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "base64"
|
||||
|
||||
class Projects::CommitsController < Projects::ApplicationController
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'addressable/uri'
|
||||
|
||||
class Projects::CompareController < Projects::ApplicationController
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Projects
|
||||
module CycleAnalytics
|
||||
class EventsController < Projects::ApplicationController
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::CycleAnalyticsController < Projects::ApplicationController
|
||||
include ActionView::Helpers::DateHelper
|
||||
include ActionView::Helpers::TextHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::DeployKeysController < Projects::ApplicationController
|
||||
include RepositorySettingsRedirect
|
||||
respond_to :html
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::DeployTokensController < Projects::ApplicationController
|
||||
before_action :authorize_admin_project!
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::DeploymentsController < Projects::ApplicationController
|
||||
before_action :authorize_read_environment!
|
||||
before_action :authorize_read_deployment!
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::DiscussionsController < Projects::ApplicationController
|
||||
include NotesHelper
|
||||
include RendersNotes
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::EnvironmentsController < Projects::ApplicationController
|
||||
layout 'project'
|
||||
before_action :authorize_read_environment!
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Controller for viewing a repository's file structure
|
||||
class Projects::FindFileController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::ForksController < Projects::ApplicationController
|
||||
include ContinueParams
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# This file should be identical in GitLab Community Edition and Enterprise Edition
|
||||
|
||||
class Projects::GitHttpClientController < Projects::ApplicationController
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::GitHttpController < Projects::GitHttpClientController
|
||||
include WorkhorseRequest
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::GraphsController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::GroupLinksController < Projects::ApplicationController
|
||||
layout 'project_settings'
|
||||
before_action :authorize_admin_project!
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::HookLogsController < Projects::ApplicationController
|
||||
include HooksExecution
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::HooksController < Projects::ApplicationController
|
||||
include HooksExecution
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::ImportsController < Projects::ApplicationController
|
||||
include ContinueParams
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::IssuesController < Projects::ApplicationController
|
||||
include RendersNotes
|
||||
include ToggleSubscriptionAction
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::JobsController < Projects::ApplicationController
|
||||
include SendFileUpload
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::LabelsController < Projects::ApplicationController
|
||||
include ToggleSubscriptionAction
|
||||
|
||||
|
@ -138,12 +140,7 @@ class Projects::LabelsController < Projects::ApplicationController
|
|||
end
|
||||
|
||||
def flash_notice_for(label, group)
|
||||
notice = ''.html_safe
|
||||
notice << label.title
|
||||
notice << ' promoted to '
|
||||
notice << view_context.link_to('<u>group label</u>'.html_safe, group_labels_path(group))
|
||||
notice << '.'
|
||||
notice
|
||||
''.html_safe + "#{label.title} promoted to " + view_context.link_to('<u>group label</u>'.html_safe, group_labels_path(group)) + '.'
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::LfsApiController < Projects::GitHttpClientController
|
||||
include LfsRequest
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::LfsLocksApiController < Projects::GitHttpClientController
|
||||
include LfsRequest
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::LfsStorageController < Projects::GitHttpClientController
|
||||
include LfsRequest
|
||||
include WorkhorseRequest
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::MattermostsController < Projects::ApplicationController
|
||||
include TriggersHelper
|
||||
include ActionView::Helpers::AssetUrlHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::MergeRequests::ApplicationController < Projects::ApplicationController
|
||||
before_action :check_merge_requests_available!
|
||||
before_action :merge_request
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::MergeRequests::ConflictsController < Projects::MergeRequests::ApplicationController
|
||||
include IssuableActions
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::MergeRequests::CreationsController < Projects::MergeRequests::ApplicationController
|
||||
include DiffForPath
|
||||
include DiffHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::MergeRequests::DiffsController < Projects::MergeRequests::ApplicationController
|
||||
include DiffForPath
|
||||
include DiffHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationController
|
||||
include ToggleSubscriptionAction
|
||||
include IssuableActions
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::MilestonesController < Projects::ApplicationController
|
||||
include Gitlab::Utils::StrongMemoize
|
||||
include MilestoneActions
|
||||
|
@ -91,12 +93,7 @@ class Projects::MilestonesController < Projects::ApplicationController
|
|||
end
|
||||
|
||||
def flash_notice_for(milestone, group)
|
||||
notice = ''.html_safe
|
||||
notice << milestone.title
|
||||
notice << ' promoted to '
|
||||
notice << view_context.link_to('<u>group milestone</u>'.html_safe, group_milestone_path(group, milestone.iid))
|
||||
notice << '.'
|
||||
notice
|
||||
''.html_safe + "#{milestone.title} promoted to " + view_context.link_to('<u>group milestone</u>'.html_safe, group_milestone_path(group, milestone.iid)) + '.'
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::MirrorsController < Projects::ApplicationController
|
||||
include RepositorySettingsRedirect
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::NetworkController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
include ApplicationHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::NotesController < Projects::ApplicationController
|
||||
include RendersNotes
|
||||
include NotesActions
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::PagesController < Projects::ApplicationController
|
||||
layout 'project_settings'
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::PagesDomainsController < Projects::ApplicationController
|
||||
layout 'project_settings'
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::PipelineSchedulesController < Projects::ApplicationController
|
||||
before_action :schedule, except: [:index, :new, :create]
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::PipelinesController < Projects::ApplicationController
|
||||
before_action :whitelist_query_limiting, only: [:create, :retry]
|
||||
before_action :pipeline, except: [:index, :new, :create, :charts]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::PipelinesSettingsController < Projects::ApplicationController
|
||||
before_action :authorize_admin_pipeline!
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::ProjectMembersController < Projects::ApplicationController
|
||||
include MembershipActions
|
||||
include MembersPresentation
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Projects
|
||||
module Prometheus
|
||||
class MetricsController < Projects::ApplicationController
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::ProtectedBranchesController < Projects::ProtectedRefsController
|
||||
protected
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::ProtectedRefsController < Projects::ApplicationController
|
||||
include RepositorySettingsRedirect
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::ProtectedTagsController < Projects::ProtectedRefsController
|
||||
protected
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Controller for viewing a file's raw
|
||||
class Projects::RawController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::RefsController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
include TreeHelper
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Projects
|
||||
module Registry
|
||||
class ApplicationController < Projects::ApplicationController
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Projects
|
||||
module Registry
|
||||
class RepositoriesController < ::Projects::Registry::ApplicationController
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Projects
|
||||
module Registry
|
||||
class TagsController < ::Projects::Registry::ApplicationController
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::ReleasesController < Projects::ApplicationController
|
||||
# Authorize
|
||||
before_action :require_non_empty_project
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::RepositoriesController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::RunnerProjectsController < Projects::ApplicationController
|
||||
before_action :authorize_admin_build!
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::RunnersController < Projects::ApplicationController
|
||||
before_action :authorize_admin_build!
|
||||
before_action :runner, only: [:edit, :update, :destroy, :pause, :resume, :show]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::ServicesController < Projects::ApplicationController
|
||||
include ServiceParams
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Projects
|
||||
module Settings
|
||||
class CiCdController < Projects::ApplicationController
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Projects
|
||||
module Settings
|
||||
class IntegrationsController < Projects::ApplicationController
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Projects
|
||||
module Settings
|
||||
class RepositoryController < Projects::ApplicationController
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::SnippetsController < Projects::ApplicationController
|
||||
include RendersNotes
|
||||
include ToggleAwardEmoji
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::TagsController < Projects::ApplicationController
|
||||
include SortingHelper
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::TemplatesController < Projects::ApplicationController
|
||||
before_action :authenticate_user!, :get_template_class
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::TodosController < Projects::ApplicationController
|
||||
include Gitlab::Utils::StrongMemoize
|
||||
include TodosActions
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
# Controller for viewing a repository's file structure
|
||||
class Projects::TreeController < Projects::ApplicationController
|
||||
include ExtractsPath
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::TriggersController < Projects::ApplicationController
|
||||
before_action :authorize_admin_build!
|
||||
before_action :authorize_manage_trigger!, except: [:index, :create]
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::UploadsController < Projects::ApplicationController
|
||||
include UploadsActions
|
||||
include WorkhorseRequest
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::VariablesController < Projects::ApplicationController
|
||||
before_action :authorize_admin_build!
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Projects::WikisController < Projects::ApplicationController
|
||||
include PreviewMarkdown
|
||||
include Gitlab::Utils::StrongMemoize
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Sherlock
|
||||
class ApplicationController < ::ApplicationController
|
||||
before_action :find_transaction
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Sherlock
|
||||
class FileSamplesController < Sherlock::ApplicationController
|
||||
def show
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Sherlock
|
||||
class QueriesController < Sherlock::ApplicationController
|
||||
def show
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Sherlock
|
||||
class TransactionsController < Sherlock::ApplicationController
|
||||
def index
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Snippets::NotesController < ApplicationController
|
||||
include NotesActions
|
||||
include ToggleAwardEmoji
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Users
|
||||
class TermsController < ApplicationController
|
||||
include InternalRedirect
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Enable even more frozen string in app/controllers
|
||||
merge_request:
|
||||
author: gfyoung
|
||||
type: performance
|
Loading…
Reference in a new issue