Class: Dependabot::PullRequestCreator::Bitbucket
- Inherits:
-
Object
- Object
- Dependabot::PullRequestCreator::Bitbucket
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/pull_request_creator/bitbucket.rb
Constant Summary collapse
- PR_DESCRIPTION_MAX_LENGTH =
BitBucket Cloud accepts > 1MB characters, but they display poorly in the UI, so limiting to 4x 65,536
262_143
Instance Attribute Summary collapse
-
#author_details ⇒ Object
readonly
Returns the value of attribute author_details.
-
#base_commit ⇒ Object
readonly
Returns the value of attribute base_commit.
-
#branch_name ⇒ Object
readonly
Returns the value of attribute branch_name.
-
#commit_message ⇒ Object
readonly
Returns the value of attribute commit_message.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#labeler ⇒ Object
readonly
Returns the value of attribute labeler.
-
#pr_description ⇒ Object
readonly
Returns the value of attribute pr_description.
-
#pr_name ⇒ Object
readonly
Returns the value of attribute pr_name.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#work_item ⇒ Object
readonly
Returns the value of attribute work_item.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, labeler: nil, work_item: nil) ⇒ Bitbucket
constructor
A new instance of Bitbucket.
Constructor Details
#initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, labeler: nil, work_item: nil) ⇒ Bitbucket
Returns a new instance of Bitbucket.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 68 def initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, labeler: nil, work_item: nil) @source = source @branch_name = branch_name @base_commit = base_commit @credentials = credentials @files = files @commit_message = @pr_description = pr_description @pr_name = pr_name @author_details = @labeler = labeler @work_item = work_item end |
Instance Attribute Details
#author_details ⇒ Object (readonly)
Returns the value of attribute author_details.
41 42 43 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 41 def @author_details end |
#base_commit ⇒ Object (readonly)
Returns the value of attribute base_commit.
23 24 25 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 23 def base_commit @base_commit end |
#branch_name ⇒ Object (readonly)
Returns the value of attribute branch_name.
20 21 22 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 20 def branch_name @branch_name end |
#commit_message ⇒ Object (readonly)
Returns the value of attribute commit_message.
32 33 34 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 32 def @commit_message end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
26 27 28 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 26 def credentials @credentials end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
29 30 31 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 29 def files @files end |
#labeler ⇒ Object (readonly)
Returns the value of attribute labeler.
44 45 46 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 44 def labeler @labeler end |
#pr_description ⇒ Object (readonly)
Returns the value of attribute pr_description.
35 36 37 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 35 def pr_description @pr_description end |
#pr_name ⇒ Object (readonly)
Returns the value of attribute pr_name.
38 39 40 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 38 def pr_name @pr_name end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
17 18 19 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 17 def source @source end |
#work_item ⇒ Object (readonly)
Returns the value of attribute work_item.
47 48 49 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 47 def work_item @work_item end |
Instance Method Details
#create ⇒ Object
85 86 87 88 89 90 91 92 93 94 |
# File 'lib/dependabot/pull_request_creator/bitbucket.rb', line 85 def create return if branch_exists? && pull_request_exists? # FIXME: Copied from Azure, but not verified whether this is true # For Bitbucket we create or update a branch in the same request as creating # a commit (so we don't need create or update branch logic here) create_commit create_pull_request end |