Commit d3b7dd23 authored by Dylan Griffith's avatar Dylan Griffith

Move external_pull_requests to CI DB

This feature is tightly linked to CI as it's only useful for CI
pipelines running against external pull requests so it makes sense to
move it to the `ci` database.
parent d027add4
......@@ -11,7 +11,7 @@
# When the mirror is updated and changes are pushed to branches we check
# if there are open pull requests for the source and target branch.
# If so, we create pipelines for external pull requests.
class ExternalPullRequest < ApplicationRecord
class ExternalPullRequest < Ci::ApplicationRecord
include Gitlab::Utils::StrongMemoize
include ShaAttribute
......@@ -40,6 +40,9 @@ class ExternalPullRequest < ApplicationRecord
scope :by_source_branch, ->(branch) { where(source_branch: branch) }
scope :by_source_repository, -> (repository) { where(source_repository: repository) }
# Needed to override Ci::ApplicationRecord as this does not have ci_ table prefix
self.table_name = 'external_pull_requests'
def self.create_or_update_from_params(params)
find_params = params.slice(:project_id, :source_branch, :target_branch)
......
......@@ -200,7 +200,7 @@ experiment_subjects: :gitlab_main
experiment_users: :gitlab_main
external_approval_rules: :gitlab_main
external_approval_rules_protected_branches: :gitlab_main
external_pull_requests: :gitlab_main
external_pull_requests: :gitlab_ci
external_status_checks: :gitlab_main
external_status_checks_protected_branches: :gitlab_main
feature_gates: :gitlab_main
......
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