Skip to content

Commit

Permalink
Merge pull request #3301 from dependabot/brrygrdn/github-redirection-…
Browse files Browse the repository at this point in the history
…service-is-required

The PR MessageBuilder requires a github_redirection_service to be specified
  • Loading branch information
brrygrdn authored Mar 24, 2021
2 parents 742dc57 + 43f533e commit 9e6d16c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
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

0 comments on commit 9e6d16c

Please sign in to comment.