Commit 16c9a2f4 authored by Thong Kuah's avatar Thong Kuah

Allow callsite in project for cross-database queries

This callsite allow replaces at least one spec allowlist. This callsite
is called ~800 times in our CI for cross-database queries so it likely
affects more than just this one spec.
parent 9e0fc449
...@@ -1789,8 +1789,10 @@ class Project < ApplicationRecord ...@@ -1789,8 +1789,10 @@ class Project < ApplicationRecord
end end
def any_online_runners?(&block) def any_online_runners?(&block)
::Gitlab::Database.allow_cross_joins_across_databases(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/339937') do
online_runners_with_tags.any?(&block) online_runners_with_tags.any?(&block)
end end
end
def valid_runners_token?(token) def valid_runners_token?(token)
self.runners_token && ActiveSupport::SecurityUtils.secure_compare(token, self.runners_token) self.runners_token && ActiveSupport::SecurityUtils.secure_compare(token, self.runners_token)
...@@ -2895,12 +2897,8 @@ class Project < ApplicationRecord ...@@ -2895,12 +2897,8 @@ class Project < ApplicationRecord
update_column(:has_external_issue_tracker, integrations.external_issue_trackers.any?) if Gitlab::Database.read_write? update_column(:has_external_issue_tracker, integrations.external_issue_trackers.any?) if Gitlab::Database.read_write?
end end
def active_runners_with_tags
@active_runners_with_tags ||= active_runners.with_tags
end
def online_runners_with_tags def online_runners_with_tags
@online_runners_with_tags ||= active_runners_with_tags.online @online_runners_with_tags ||= active_runners.with_tags.online
end end
end end
......
...@@ -77,7 +77,6 @@ ...@@ -77,7 +77,6 @@
- "./ee/spec/requests/api/vulnerability_findings_spec.rb" - "./ee/spec/requests/api/vulnerability_findings_spec.rb"
- "./ee/spec/serializers/dashboard_environment_entity_spec.rb" - "./ee/spec/serializers/dashboard_environment_entity_spec.rb"
- "./ee/spec/serializers/dashboard_environments_serializer_spec.rb" - "./ee/spec/serializers/dashboard_environments_serializer_spec.rb"
- "./ee/spec/serializers/dashboard_operations_project_entity_spec.rb"
- "./ee/spec/serializers/ee/build_details_entity_spec.rb" - "./ee/spec/serializers/ee/build_details_entity_spec.rb"
- "./ee/spec/serializers/merge_request_poll_widget_entity_spec.rb" - "./ee/spec/serializers/merge_request_poll_widget_entity_spec.rb"
- "./ee/spec/services/auto_merge/add_to_merge_train_when_pipeline_succeeds_service_spec.rb" - "./ee/spec/services/auto_merge/add_to_merge_train_when_pipeline_succeeds_service_spec.rb"
......
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