Class: Dependabot::PullRequestCreator::Gitlab
- Inherits:
-
Object
- Object
- Dependabot::PullRequestCreator::Gitlab
- Defined in:
- lib/dependabot/pull_request_creator/gitlab.rb
Instance Attribute Summary collapse
-
#approvers ⇒ Object
readonly
Returns the value of attribute approvers.
-
#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.
-
#milestone ⇒ Object
readonly
Returns the value of attribute milestone.
-
#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.
-
#target_project_id ⇒ Object
readonly
Returns the value of attribute target_project_id.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, labeler:, approvers:, assignees:, milestone:, target_project_id:) ⇒ Gitlab
constructor
A new instance of Gitlab.
Constructor Details
#initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, labeler:, approvers:, assignees:, milestone:, target_project_id:) ⇒ Gitlab
Returns a new instance of Gitlab.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 16 def initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, labeler:, approvers:, assignees:, milestone:, target_project_id:) @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 @approvers = approvers @assignees = assignees @milestone = milestone @target_project_id = target_project_id end |
Instance Attribute Details
#approvers ⇒ Object (readonly)
Returns the value of attribute approvers.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def approvers @approvers end |
#assignees ⇒ Object (readonly)
Returns the value of attribute assignees.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def assignees @assignees end |
#author_details ⇒ Object (readonly)
Returns the value of attribute author_details.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def @author_details end |
#base_commit ⇒ Object (readonly)
Returns the value of attribute base_commit.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def base_commit @base_commit end |
#branch_name ⇒ Object (readonly)
Returns the value of attribute branch_name.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def branch_name @branch_name end |
#commit_message ⇒ Object (readonly)
Returns the value of attribute commit_message.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def @commit_message end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def credentials @credentials end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def files @files end |
#labeler ⇒ Object (readonly)
Returns the value of attribute labeler.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def labeler @labeler end |
#milestone ⇒ Object (readonly)
Returns the value of attribute milestone.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def milestone @milestone end |
#pr_description ⇒ Object (readonly)
Returns the value of attribute pr_description.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def pr_description @pr_description end |
#pr_name ⇒ Object (readonly)
Returns the value of attribute pr_name.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def pr_name @pr_name end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def source @source end |
#target_project_id ⇒ Object (readonly)
Returns the value of attribute target_project_id.
11 12 13 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 11 def target_project_id @target_project_id end |
Instance Method Details
#create ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/dependabot/pull_request_creator/gitlab.rb', line 36 def create return if branch_exists? && merge_request_exists? if branch_exists? create_commit unless commit_exists? else create_branch create_commit end labeler.create_default_labels_if_required merge_request = create_merge_request return unless merge_request annotate_merge_request(merge_request) merge_request end |