Class: Dependabot::PullRequestCreator
- Inherits:
-
Object
- Object
- Dependabot::PullRequestCreator
- Defined in:
- lib/dependabot/pull_request_creator.rb,
lib/dependabot/pull_request_creator/github.rb,
lib/dependabot/pull_request_creator/gitlab.rb,
lib/dependabot/pull_request_creator/labeler.rb,
lib/dependabot/pull_request_creator/branch_namer.rb,
lib/dependabot/pull_request_creator/commit_signer.rb,
lib/dependabot/pull_request_creator/message_builder.rb
Defined Under Namespace
Classes: BranchNamer, CommitSigner, Github, Gitlab, Labeler, MessageBuilder, NoHistoryInCommon, RepoArchived, RepoNotFound
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_separator ⇒ Object
readonly
Returns the value of attribute branch_name_separator.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#custom_labels ⇒ Object
readonly
Returns the value of attribute custom_labels.
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#milestone ⇒ Object
readonly
Returns the value of attribute milestone.
-
#pr_message_footer ⇒ Object
readonly
Returns the value of attribute pr_message_footer.
-
#reviewers ⇒ Object
readonly
Returns the value of attribute reviewers.
-
#signature_key ⇒ Object
readonly
Returns the value of attribute signature_key.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#vulnerabilities_fixed ⇒ Object
readonly
Returns the value of attribute vulnerabilities_fixed.
Instance Method Summary collapse
- #check_dependencies_have_previous_version ⇒ Object
- #create ⇒ Object
-
#initialize(source:, base_commit:, dependencies:, files:, credentials:, pr_message_footer: nil, custom_labels: nil, author_details: nil, signature_key: nil, reviewers: nil, assignees: nil, milestone: nil, vulnerabilities_fixed: {}, branch_name_separator: "/", label_language: false) ⇒ PullRequestCreator
constructor
A new instance of PullRequestCreator.
Constructor Details
#initialize(source:, base_commit:, dependencies:, files:, credentials:, pr_message_footer: nil, custom_labels: nil, author_details: nil, signature_key: nil, reviewers: nil, assignees: nil, milestone: nil, vulnerabilities_fixed: {}, branch_name_separator: "/", label_language: false) ⇒ PullRequestCreator
Returns a new instance of PullRequestCreator.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/dependabot/pull_request_creator.rb', line 22 def initialize(source:, base_commit:, dependencies:, files:, credentials:, pr_message_footer: nil, custom_labels: nil, author_details: nil, signature_key: nil, reviewers: nil, assignees: nil, milestone: nil, vulnerabilities_fixed: {}, branch_name_separator: "/", label_language: false) @dependencies = dependencies @source = source @base_commit = base_commit @files = files @credentials = credentials @pr_message_footer = @author_details = @signature_key = signature_key @custom_labels = custom_labels @reviewers = reviewers @assignees = assignees @milestone = milestone @vulnerabilities_fixed = vulnerabilities_fixed @branch_name_separator = branch_name_separator @label_language = label_language check_dependencies_have_previous_version end |
Instance Attribute Details
#assignees ⇒ Object (readonly)
Returns the value of attribute assignees.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def assignees @assignees end |
#author_details ⇒ Object (readonly)
Returns the value of attribute author_details.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def @author_details end |
#base_commit ⇒ Object (readonly)
Returns the value of attribute base_commit.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def base_commit @base_commit end |
#branch_name_separator ⇒ Object (readonly)
Returns the value of attribute branch_name_separator.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def branch_name_separator @branch_name_separator end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def credentials @credentials end |
#custom_labels ⇒ Object (readonly)
Returns the value of attribute custom_labels.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def custom_labels @custom_labels end |
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def dependencies @dependencies end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def files @files end |
#milestone ⇒ Object (readonly)
Returns the value of attribute milestone.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def milestone @milestone end |
#pr_message_footer ⇒ Object (readonly)
Returns the value of attribute pr_message_footer.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def @pr_message_footer end |
#reviewers ⇒ Object (readonly)
Returns the value of attribute reviewers.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def reviewers @reviewers end |
#signature_key ⇒ Object (readonly)
Returns the value of attribute signature_key.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def signature_key @signature_key end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def source @source end |
#vulnerabilities_fixed ⇒ Object (readonly)
Returns the value of attribute vulnerabilities_fixed.
17 18 19 |
# File 'lib/dependabot/pull_request_creator.rb', line 17 def vulnerabilities_fixed @vulnerabilities_fixed end |
Instance Method Details
#check_dependencies_have_previous_version ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/dependabot/pull_request_creator.rb', line 47 def check_dependencies_have_previous_version return if library? && dependencies.all? { |d| requirements_changed?(d) } return if dependencies.all?(&:previous_version) raise "Dependencies must have a previous version or changed " \ "requirement to have a pull request created for them!" end |
#create ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/dependabot/pull_request_creator.rb', line 55 def create case source.provider when "github" then github_creator.create when "gitlab" then gitlab_creator.create else raise "Unsupported provider #{source.provider}" end end |