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