Class: Dependabot::PullRequestCreator::Azure
- Inherits:
-
Object
- Object
- Dependabot::PullRequestCreator::Azure
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/pull_request_creator/azure.rb
Constant Summary collapse
- PR_DESCRIPTION_MAX_LENGTH =
Azure DevOps limits PR descriptions to a max of 4,000 characters in UTF-16 encoding: developercommunity.visualstudio.com/content/problem/608770/remove-4000-character-limit-on-pull-request-descri.html
3_999
- PR_DESCRIPTION_ENCODING =
0 based count
Encoding::UTF_16
Instance Attribute Summary collapse
-
#assignees ⇒ Object
readonly
Returns the value of attribute assignees.
-
#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.
-
#reviewers ⇒ Object
readonly
Returns the value of attribute reviewers.
-
#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:, reviewers: nil, assignees: nil, work_item: nil) ⇒ Azure
constructor
A new instance of Azure.
Constructor Details
#initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, labeler:, reviewers: nil, assignees: nil, work_item: nil) ⇒ Azure
Returns a new instance of Azure.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 77 def initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, labeler:, reviewers: nil, assignees: 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 @reviewers = reviewers @assignees = assignees @work_item = work_item end |
Instance Attribute Details
#assignees ⇒ Object (readonly)
Returns the value of attribute assignees.
49 50 51 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 49 def assignees @assignees end |
#author_details ⇒ Object (readonly)
Returns the value of attribute author_details.
40 41 42 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 40 def @author_details end |
#base_commit ⇒ Object (readonly)
Returns the value of attribute base_commit.
22 23 24 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 22 def base_commit @base_commit end |
#branch_name ⇒ Object (readonly)
Returns the value of attribute branch_name.
19 20 21 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 19 def branch_name @branch_name end |
#commit_message ⇒ Object (readonly)
Returns the value of attribute commit_message.
31 32 33 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 31 def @commit_message end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
25 26 27 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 25 def credentials @credentials end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
28 29 30 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 28 def files @files end |
#labeler ⇒ Object (readonly)
Returns the value of attribute labeler.
43 44 45 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 43 def labeler @labeler end |
#pr_description ⇒ Object (readonly)
Returns the value of attribute pr_description.
34 35 36 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 34 def pr_description @pr_description end |
#pr_name ⇒ Object (readonly)
Returns the value of attribute pr_name.
37 38 39 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 37 def pr_name @pr_name end |
#reviewers ⇒ Object (readonly)
Returns the value of attribute reviewers.
46 47 48 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 46 def reviewers @reviewers end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
16 17 18 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 16 def source @source end |
#work_item ⇒ Object (readonly)
Returns the value of attribute work_item.
52 53 54 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 52 def work_item @work_item end |
Instance Method Details
#create ⇒ Object
96 97 98 99 100 101 102 103 104 |
# File 'lib/dependabot/pull_request_creator/azure.rb', line 96 def create return if branch_exists? && pull_request_exists? # For Azure 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 |