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,9 +32,11 @@ module Security ...@@ -32,9 +32,11 @@ module Security
end end
def execute def execute
::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification.allow_cross_database_modification_within_transaction(url: 'URL TODO') do
ApplicationRecord.transaction do ApplicationRecord.transaction do
TASKS.each { |task| execute_task(task) } TASKS.each { |task| execute_task(task) }
end end
end
@finding_maps.map(&:vulnerability_id) @finding_maps.map(&:vulnerability_id)
end end
......
...@@ -14,10 +14,12 @@ module Gitlab ...@@ -14,10 +14,12 @@ 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)
::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification.allow_cross_database_modification_within_transaction(url: 'URL TODO') do
::Project.transaction do ::Project.transaction do
super super
end end
end end
end
def initialize(klass, attributes) def initialize(klass, attributes)
super super
......
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