summaryrefslogtreecommitdiff
path: root/app/services
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-10 09:08:55 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-10 09:08:55 +0000
commita2344dbf1942dc3919c55b0684d2566368e03852 (patch)
tree00f92dc8b5e2e2cb732662f5e5e0ffd5f3d2eca0 /app/services
parent213da19cda5309148952ab770e2a9e122fe32e22 (diff)
downloadgitlab-ce-a2344dbf1942dc3919c55b0684d2566368e03852.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services')
-rw-r--r--app/services/ci/pipelines/add_job_service.rb6
-rw-r--r--app/services/git/base_hooks_service.rb8
-rw-r--r--app/services/quick_actions/interpret_service.rb1
3 files changed, 15 insertions, 0 deletions
diff --git a/app/services/ci/pipelines/add_job_service.rb b/app/services/ci/pipelines/add_job_service.rb
index dfbb37cf0dc..1a5c8d0dccf 100644
--- a/app/services/ci/pipelines/add_job_service.rb
+++ b/app/services/ci/pipelines/add_job_service.rb
@@ -18,6 +18,12 @@ module Ci
in_lock("ci:pipelines:#{pipeline.id}:add-job", ttl: LOCK_TIMEOUT, sleep_sec: LOCK_SLEEP, retries: LOCK_RETRIES) do
Ci::Pipeline.transaction do
+ # This is used to reduce the deadlocks when partitioning `ci_builds`
+ # since inserting into this table requires locks on all foreign keys
+ # and we need to lock all the tables in a specific order for the
+ # migration to succeed.
+ Ci::Pipeline.connection.execute('LOCK "ci_pipelines", "ci_stages" IN ROW SHARE MODE;')
+
yield(job)
job.update_older_statuses_retried!
diff --git a/app/services/git/base_hooks_service.rb b/app/services/git/base_hooks_service.rb
index 7158116fde1..acf54dec51b 100644
--- a/app/services/git/base_hooks_service.rb
+++ b/app/services/git/base_hooks_service.rb
@@ -15,6 +15,7 @@ module Git
# Not a hook, but it needs access to the list of changed commits
enqueue_invalidate_cache
+ enqueue_notify_kas
success
end
@@ -77,6 +78,13 @@ module Git
ProjectCacheWorker.perform_async(project.id, file_types, [], false)
end
+ def enqueue_notify_kas
+ return unless Gitlab::Kas.enabled?
+ return unless Feature.enabled?(:notify_kas_on_git_push, project)
+
+ Clusters::Agents::NotifyGitPushWorker.perform_async(project.id)
+ end
+
def pipeline_params
strong_memoize(:pipeline_params) do
{
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb
index e1646cbf643..b5f6bff756b 100644
--- a/app/services/quick_actions/interpret_service.rb
+++ b/app/services/quick_actions/interpret_service.rb
@@ -11,6 +11,7 @@ module QuickActions
include Gitlab::QuickActions::CommitActions
include Gitlab::QuickActions::CommonActions
include Gitlab::QuickActions::RelateActions
+ include Gitlab::QuickActions::WorkItemActions
attr_reader :quick_action_target