Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The PR MessageBuilder requires a github_redirection_service to be specified #3301

Merged
merged 2 commits into from
Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion common/lib/dependabot/pull_request_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down