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

Add sane limit to PR description limit for Bitbucket cloud #7693

Merged
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
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