diff --git a/common/lib/dependabot/pull_request_creator.rb b/common/lib/dependabot/pull_request_creator.rb index b18a2b41018..99ed4729170 100644 --- a/common/lib/dependabot/pull_request_creator.rb +++ b/common/lib/dependabot/pull_request_creator.rb @@ -13,6 +13,18 @@ class PullRequestCreator require "dependabot/pull_request_creator/branch_namer" require "dependabot/pull_request_creator/labeler" + # Dependabot programmatically creates PRs which often include a large + # number of links to objects on `github.com`. GitHub hydrates these into + # rich links that leave a 'mention' on target Issues/Pull Requests. + # + # Due to the volume and nature of Dependabot PRs, these mentions are not + # useful and can overwhelm maintainers, so we use a redirection service + # to avoid enrichment. + # + # If you wish to disable this behaviour when using Dependabot Core directly, + # pass a nil value when initialising this class. + DEFAULT_GITHUB_REDIRECTION_SERVICE = "github-redirect.dependabot.com" + class RepoNotFound < StandardError; end class RepoArchived < StandardError; end @@ -46,7 +58,7 @@ def initialize(source:, base_commit:, dependencies:, files:, credentials:, reviewers: nil, assignees: nil, milestone: nil, branch_name_separator: "/", branch_name_prefix: "dependabot", label_language: false, automerge_candidate: false, - github_redirection_service: "github-redirect.dependabot.com", + github_redirection_service: DEFAULT_GITHUB_REDIRECTION_SERVICE, custom_headers: nil, require_up_to_date_base: false, provider_metadata: {}, message: nil) @dependencies = dependencies diff --git a/common/lib/dependabot/pull_request_creator/message_builder.rb b/common/lib/dependabot/pull_request_creator/message_builder.rb index 59730e5df75..0c73092c683 100644 --- a/common/lib/dependabot/pull_request_creator/message_builder.rb +++ b/common/lib/dependabot/pull_request_creator/message_builder.rb @@ -25,7 +25,7 @@ class MessageBuilder def initialize(source:, dependencies:, files:, credentials:, pr_message_header: nil, pr_message_footer: nil, commit_message_options: {}, vulnerabilities_fixed: {}, - github_redirection_service: nil) + github_redirection_service:) @dependencies = dependencies @files = files @source = source