dependabot-common 0.107.4 → 0.107.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47f5d087b39f64f30efb22f9c2a46d834e19bd2873a07b62d249ef50df1119ca
4
- data.tar.gz: 9d661293d2d6bb24c8bce9c6f4960d13568083563b2b620d238b15fd8356134a
3
+ metadata.gz: '04941cf855891d3f4b237c9076b0f60ab46501ca6631e980a2bff8da66cac9aa'
4
+ data.tar.gz: c78db2d55328edb6b357b8e2070cc5caf2dbe468a49fb777606f7c557b0a1a92
5
5
  SHA512:
6
- metadata.gz: 749ca3adff30dfd14c63a307b8157ae2af07f1fcc6155f86eb2410cf0e2a8efcc24a2928b61d2299e9ab255b69fae92165b107e73a6ed34ef97bf4d6a0d0b2b5
7
- data.tar.gz: 92e2f03ccbffaae83054de9cf7c07d64c212af99fcb93d81c99159ced3b2cefec860b9d88e75445021c18a042dbcbaf628e59c9ca3f0faf785901035ce7c9295
6
+ metadata.gz: 45a034b06b79a0a173ca1ff7b3acf67266057f02daa1aa566b82c7f72252fb117598505e82ff5df42447cb2c16c8da7a80119e0317c5e16122b1a490e03b0233
7
+ data.tar.gz: b001a3939ca512f456e12d23de584bed03294f7415b6d3262b0db7ac1e8adffd6bf8475f589dee2c50818f04c54800c0b31b37415e35dff7d23c016ea7d96613
@@ -18,7 +18,8 @@ module Dependabot
18
18
  :credentials, :pr_message_footer, :custom_labels,
19
19
  :author_details, :signature_key, :vulnerabilities_fixed,
20
20
  :reviewers, :assignees, :milestone, :branch_name_separator,
21
- :branch_name_prefix, :github_redirection_service
21
+ :branch_name_prefix, :github_redirection_service,
22
+ :custom_headers
22
23
 
23
24
  def initialize(source:, base_commit:, dependencies:, files:, credentials:,
24
25
  pr_message_footer: nil, custom_labels: nil,
@@ -27,7 +28,8 @@ module Dependabot
27
28
  vulnerabilities_fixed: {}, branch_name_separator: "/",
28
29
  branch_name_prefix: "dependabot",
29
30
  label_language: false, automerge_candidate: false,
30
- github_redirection_service: "github-redirect.dependabot.com")
31
+ github_redirection_service: "github-redirect.dependabot.com",
32
+ custom_headers: nil)
31
33
  @dependencies = dependencies
32
34
  @source = source
33
35
  @base_commit = base_commit
@@ -46,6 +48,7 @@ module Dependabot
46
48
  @label_language = label_language
47
49
  @automerge_candidate = automerge_candidate
48
50
  @github_redirection_service = github_redirection_service
51
+ @custom_headers = custom_headers
49
52
 
50
53
  check_dependencies_have_previous_version
51
54
  end
@@ -91,7 +94,8 @@ module Dependabot
91
94
  labeler: labeler,
92
95
  reviewers: reviewers,
93
96
  assignees: assignees,
94
- milestone: milestone
97
+ milestone: milestone,
98
+ custom_headers: custom_headers
95
99
  )
96
100
  end
97
101
 
@@ -11,12 +11,12 @@ module Dependabot
11
11
  class Github
12
12
  attr_reader :source, :branch_name, :base_commit, :credentials,
13
13
  :files, :pr_description, :pr_name, :commit_message,
14
- :author_details, :signature_key,
14
+ :author_details, :signature_key, :custom_headers,
15
15
  :labeler, :reviewers, :assignees, :milestone
16
16
 
17
17
  def initialize(source:, branch_name:, base_commit:, credentials:,
18
18
  files:, commit_message:, pr_description:, pr_name:,
19
- author_details:, signature_key:,
19
+ author_details:, signature_key:, custom_headers:,
20
20
  labeler:, reviewers:, assignees:, milestone:)
21
21
  @source = source
22
22
  @branch_name = branch_name
@@ -28,6 +28,7 @@ module Dependabot
28
28
  @pr_name = pr_name
29
29
  @author_details = author_details
30
30
  @signature_key = signature_key
31
+ @custom_headers = custom_headers
31
32
  @labeler = labeler
32
33
  @reviewers = reviewers
33
34
  @assignees = assignees
@@ -255,14 +256,19 @@ module Dependabot
255
256
  source.branch || default_branch,
256
257
  branch_name,
257
258
  pr_name,
258
- pr_description
259
+ pr_description,
260
+ headers: custom_headers || {}
259
261
  )
260
262
  rescue Octokit::UnprocessableEntity => e
263
+ handle_pr_creation_error(e)
264
+ end
265
+
266
+ def handle_pr_creation_error(error)
261
267
  # Ignore races that we lose
262
- return if e.message.include?("pull request already exists")
268
+ return if error.message.include?("pull request already exists")
263
269
 
264
270
  # Ignore cases where the target branch has been deleted
265
- return if e.message.include?("field: base") &&
271
+ return if error.message.include?("field: base") &&
266
272
  source.branch &&
267
273
  !branch_exists?(source.branch)
268
274
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.107.4"
4
+ VERSION = "0.107.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.107.4
4
+ version: 0.107.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot