Skip to content

Commit

Permalink
Add sane limit to PR description limit for Bitbucket cloud (#7693)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefangr authored Aug 2, 2023
1 parent 6d642b9 commit eece01f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/lib/dependabot/pull_request_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ def message
@pr_message_encoding = Azure::PR_DESCRIPTION_ENCODING if @pr_message_encoding.nil?
when "codecommit"
@pr_message_max_length = Codecommit::PR_DESCRIPTION_MAX_LENGTH if @pr_message_max_length.nil?
when "bitbucket"
@pr_message_max_length = Bitbucket::PR_DESCRIPTION_MAX_LENGTH if @pr_message_max_length.nil?
end

@message = MessageBuilder.new(
Expand Down
3 changes: 3 additions & 0 deletions common/lib/dependabot/pull_request_creator/bitbucket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ class Bitbucket
:files, :commit_message, :pr_description, :pr_name,
:author_details, :labeler, :work_item

# BitBucket Cloud accepts > 1MB characters, but they display poorly in the UI, so limiting to 4x 65,536
PR_DESCRIPTION_MAX_LENGTH = 262_143 # 0 based count

def initialize(source:, branch_name:, base_commit:, credentials:,
files:, commit_message:, pr_description:, pr_name:,
author_details:, labeler: nil, work_item: nil)
Expand Down

0 comments on commit eece01f

Please sign in to comment.