Commit d9e89794 authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'remove_redundant_allow_cross_joins_across_databases_call_mr' into 'master'

Remove redundant allow_cross_joins_across_databases call

See merge request gitlab-org/gitlab!84427
parents 9ec47e24 53632102
...@@ -135,9 +135,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo ...@@ -135,9 +135,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
set_pipeline_variables set_pipeline_variables
::Gitlab::Database.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/336891') do @number_of_pipelines = @pipelines.size
@number_of_pipelines = @pipelines.size
end
render render
end end
...@@ -201,17 +199,15 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo ...@@ -201,17 +199,15 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
Gitlab::PollingInterval.set_header(response, interval: 10_000) Gitlab::PollingInterval.set_header(response, interval: 10_000)
::Gitlab::Database.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/336891') do render json: {
render json: { pipelines: PipelineSerializer
pipelines: PipelineSerializer .new(project: @project, current_user: @current_user)
.new(project: @project, current_user: @current_user) .with_pagination(request, response)
.with_pagination(request, response) .represent(@pipelines),
.represent(@pipelines), count: {
count: { all: @pipelines.count
all: @pipelines.count
}
} }
end }
end end
def sast_reports def sast_reports
......
...@@ -1409,9 +1409,7 @@ class MergeRequest < ApplicationRecord ...@@ -1409,9 +1409,7 @@ class MergeRequest < ApplicationRecord
def has_ci? def has_ci?
return false if has_no_commits? return false if has_no_commits?
::Gitlab::Database.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/336891') do !!(head_pipeline_id || all_pipelines.any? || source_project&.ci_integration)
!!(head_pipeline_id || all_pipelines.any? || source_project&.ci_integration)
end
end end
def branch_missing? def branch_missing?
...@@ -1912,9 +1910,7 @@ class MergeRequest < ApplicationRecord ...@@ -1912,9 +1910,7 @@ class MergeRequest < ApplicationRecord
end end
def find_actual_head_pipeline def find_actual_head_pipeline
::Gitlab::Database.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/336891') do all_pipelines.for_sha_or_source_sha(diff_head_sha).first
all_pipelines.for_sha_or_source_sha(diff_head_sha).first
end
end end
def etag_caching_enabled? def etag_caching_enabled?
......
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