Commit d994607e authored by Thong Kuah's avatar Thong Kuah Committed by Kamil Trzciński

Allowlist cross-db modification instances

- This was modifying external_pull_requests table within a Project
transaction

- This was modifying the ci_pipelines table within
ApplicationRecord.transaction.
parent 87616fca
......@@ -32,8 +32,10 @@ module Security
end
def execute
ApplicationRecord.transaction do
TASKS.each { |task| execute_task(task) }
::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification.allow_cross_database_modification_within_transaction(url: 'URL TODO') do
ApplicationRecord.transaction do
TASKS.each { |task| execute_task(task) }
end
end
@finding_maps.map(&:vulnerability_id)
......
......@@ -14,8 +14,10 @@ module Gitlab
# It also adds some logic around Group Labels/Milestones for edge cases.
class ObjectBuilder < Base::ObjectBuilder
def self.build(*args)
::Project.transaction do
super
::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification.allow_cross_database_modification_within_transaction(url: 'URL TODO') do
::Project.transaction do
super
end
end
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