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-06-16 00:10:20 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-16 00:10:20 +0300
commitbe522a9abd386ad605786eeb805e12025af0c742 (patch)
tree3f1057f84c7594b42a889281f96fd51fb778e894 /lib
parent0e5ce539275e32cfd7592362e03673807fca9cc7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/api/entities/project_integration_basic.rb2
-rw-r--r--lib/api/helpers/integrations_helpers.rb24
-rw-r--r--lib/gitlab/application_rate_limiter.rb2
-rw-r--r--lib/gitlab/gitaly_client/commit_service.rb26
4 files changed, 53 insertions, 1 deletions
diff --git a/lib/api/entities/project_integration_basic.rb b/lib/api/entities/project_integration_basic.rb
index b7c56d7cca1..d7e111b990e 100644
--- a/lib/api/entities/project_integration_basic.rb
+++ b/lib/api/entities/project_integration_basic.rb
@@ -15,9 +15,11 @@ module API
expose :push_events, documentation: { type: 'boolean' }
expose :issues_events, documentation: { type: 'boolean' }
expose :incident_events, documentation: { type: 'boolean' }
+ expose :alert_events, documentation: { type: 'boolean' }
expose :confidential_issues_events, documentation: { type: 'boolean' }
expose :merge_requests_events, documentation: { type: 'boolean' }
expose :tag_push_events, documentation: { type: 'boolean' }
+ expose :deployment_events, documentation: { type: 'boolean' }
expose :note_events, documentation: { type: 'boolean' }
expose :confidential_note_events, documentation: { type: 'boolean' }
expose :pipeline_events, documentation: { type: 'boolean' }
diff --git a/lib/api/helpers/integrations_helpers.rb b/lib/api/helpers/integrations_helpers.rb
index b5dc72b1576..1c053f8a01a 100644
--- a/lib/api/helpers/integrations_helpers.rb
+++ b/lib/api/helpers/integrations_helpers.rb
@@ -69,6 +69,12 @@ module API
},
{
required: false,
+ name: :alert_channel,
+ type: String,
+ desc: 'The name of the channel to receive alert_events notifications'
+ },
+ {
+ required: false,
name: :confidential_issue_channel,
type: String,
desc: 'The name of the channel to receive confidential_issues_events notifications'
@@ -93,6 +99,12 @@ module API
},
{
required: false,
+ name: :deployment_channel,
+ type: String,
+ desc: 'The name of the channel to receive deployment_events notifications'
+ },
+ {
+ required: false,
name: :pipeline_channel,
type: String,
desc: 'The name of the channel to receive pipeline_events notifications'
@@ -128,6 +140,12 @@ module API
},
{
required: false,
+ name: :alert_events,
+ type: Boolean,
+ desc: 'Enable notifications for alert_events'
+ },
+ {
+ required: false,
name: :confidential_issues_events,
type: Boolean,
desc: 'Enable notifications for confidential_issues_events'
@@ -158,6 +176,12 @@ module API
},
{
required: false,
+ name: :deployment_events,
+ type: Boolean,
+ desc: 'Enable notifications for deployment_events'
+ },
+ {
+ required: false,
name: :pipeline_events,
type: Boolean,
desc: 'Enable notifications for pipeline_events'
diff --git a/lib/gitlab/application_rate_limiter.rb b/lib/gitlab/application_rate_limiter.rb
index a8e74cbd7e6..8d7712951e1 100644
--- a/lib/gitlab/application_rate_limiter.rb
+++ b/lib/gitlab/application_rate_limiter.rb
@@ -45,7 +45,7 @@ module Gitlab
auto_rollback_deployment: { threshold: 1, interval: 3.minutes },
search_rate_limit: { threshold: -> { application_settings.search_rate_limit }, interval: 1.minute },
search_rate_limit_unauthenticated: { threshold: -> { application_settings.search_rate_limit_unauthenticated }, interval: 1.minute },
- gitlab_shell_operation: { threshold: 600, interval: 1.minute },
+ gitlab_shell_operation: { threshold: application_settings.gitlab_shell_operation_limit, interval: 1.minute },
pipelines_create: { threshold: -> { application_settings.pipeline_limit_per_project_user_sha }, interval: 1.minute },
temporary_email_failure: { threshold: 300, interval: 1.day },
permanent_email_failure: { threshold: 5, interval: 1.day },
diff --git a/lib/gitlab/gitaly_client/commit_service.rb b/lib/gitlab/gitaly_client/commit_service.rb
index f7d6b2402e4..b1f3c2ca386 100644
--- a/lib/gitlab/gitaly_client/commit_service.rb
+++ b/lib/gitlab/gitaly_client/commit_service.rb
@@ -159,6 +159,17 @@ module Gitlab
end
[entries, cursor]
+ rescue GRPC::BadStatus => e
+ detailed_error = GitalyClient.decode_detailed_error(e)
+
+ case detailed_error.try(:error)
+ when :path
+ raise Gitlab::Git::Index::IndexError, path_error_message(detailed_error.path)
+ when :resolve_tree
+ raise Gitlab::Git::Index::IndexError, e.details
+ else
+ raise e
+ end
end
def commit_count(ref, options = {})
@@ -608,6 +619,21 @@ module Gitlab
Gitaly::FindChangedPathsRequest.new(repository: @gitaly_repo, requests: commit_requests)
end
+
+ def path_error_message(path_error)
+ case path_error.error_type
+ when :ERROR_TYPE_EMPTY_PATH
+ "You must provide a file path"
+ when :ERROR_TYPE_RELATIVE_PATH_ESCAPES_REPOSITORY
+ "Path cannot include traversal syntax"
+ when :ERROR_TYPE_ABSOLUTE_PATH
+ "Only relative path is accepted"
+ when :ERROR_TYPE_LONG_PATH
+ "Path is too long"
+ else
+ "Unknown path error"
+ end
+ end
end
end
end