Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-10-05 06:08:14 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-10-05 06:08:14 +0300
commitfdb5a6d73c634c2545cd2cb70cdc0a3b1458c712 (patch)
tree53443e41b232b4aa7ec000e265df5dd2152b94cf /lib
parentf11cce04caba6363b1e8d33989e5671819d1d502 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/api/helpers.rb2
-rw-r--r--lib/gitlab/metrics/web_transaction.rb17
-rw-r--r--lib/gitlab/shell.rb28
-rw-r--r--lib/sidebars/projects/menus/deployments_menu.rb2
4 files changed, 16 insertions, 33 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index db08bc6c63a..56b157f662a 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -412,7 +412,7 @@ module API
end
def require_pages_enabled!
- not_found! unless user_project.pages_available?
+ not_found! unless ::Gitlab::Pages.enabled?
end
def require_pages_config_enabled!
diff --git a/lib/gitlab/metrics/web_transaction.rb b/lib/gitlab/metrics/web_transaction.rb
index f3c1e6897af..ad635a9e376 100644
--- a/lib/gitlab/metrics/web_transaction.rb
+++ b/lib/gitlab/metrics/web_transaction.rb
@@ -9,7 +9,7 @@ module Gitlab
# etc.
class WebTransaction < Transaction
THREAD_KEY = :_gitlab_metrics_transaction
- BASE_LABEL_KEYS = %i[controller action feature_category].freeze
+ BASE_LABEL_KEYS = %i[controller action feature_category endpoint_id].freeze
CONTROLLER_KEY = 'action_controller.instance'
ENDPOINT_KEY = 'api.endpoint'
@@ -95,7 +95,13 @@ module Gitlab
action = "#{action}.#{suffix}"
end
- { controller: controller.class.name, action: action, feature_category: feature_category }
+ {
+ controller: controller.class.name,
+ action: action,
+ feature_category: feature_category,
+ # inline endpoint_id_for_action as not all controllers extend ApplicationController
+ endpoint_id: "#{controller.class.name}##{controller.action_name}"
+ }
end
def labels_from_endpoint
@@ -112,7 +118,12 @@ module Gitlab
if route
path = endpoint_paths_cache[route.request_method][route.path]
- { controller: 'Grape', action: "#{route.request_method} #{path}", feature_category: feature_category }
+ {
+ controller: 'Grape',
+ action: "#{route.request_method} #{path}",
+ feature_category: feature_category,
+ endpoint_id: API::Base.endpoint_id_for_route(route)
+ }
end
end
diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb
index 87f4d3bb9bd..b47e0b1d396 100644
--- a/lib/gitlab/shell.rb
+++ b/lib/gitlab/shell.rb
@@ -14,10 +14,6 @@ module Gitlab
class Shell
Error = Class.new(StandardError)
- PERMITTED_ACTIONS = %w[
- mv_repository remove_repository repository_exists?
- ].freeze
-
class << self
# Retrieve GitLab Shell secret token
#
@@ -102,30 +98,6 @@ module Gitlab
false
end
- # Removes a repository from file system.
- # Given the underlying implementation removes the name
- # passed as second argument on the passed storage.
- #
- # @example Remove a repository
- # remove_repository("/path/to/storage", "gitlab/gitlab-ci")
- #
- # @param [String] storage project's storage path
- # @param [String] disk_path current project path on disk
- #
- # @deprecated
- def remove_repository(storage, disk_path)
- return false if disk_path.empty?
-
- Gitlab::Git::Repository.new(storage, "#{disk_path}.git", nil, nil).remove
-
- true
- rescue StandardError => e
- Gitlab::AppLogger.warn("Repository does not exist: #{e} at: #{disk_path}.git")
- Gitlab::ErrorTracking.track_exception(e, path: disk_path, storage: storage)
-
- false
- end
-
# Check if repository exists on disk
#
# @example Check if repository exists
diff --git a/lib/sidebars/projects/menus/deployments_menu.rb b/lib/sidebars/projects/menus/deployments_menu.rb
index ff2f833763a..e2ebb347077 100644
--- a/lib/sidebars/projects/menus/deployments_menu.rb
+++ b/lib/sidebars/projects/menus/deployments_menu.rb
@@ -85,7 +85,7 @@ module Sidebars
end
def pages_menu_item
- unless context.project.pages_available? && context.current_user&.can?(:update_pages, context.project)
+ unless ::Gitlab::Pages.enabled? && context.current_user&.can?(:update_pages, context.project)
return ::Sidebars::NilMenuItem.new(item_id: :pages)
end