dependabot-common 0.207.0 → 0.210.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b710c34eea2e475f47673b31cff9d22aeaa48e43339714996512124ac56f1b0
4
- data.tar.gz: 32c6a5d91c8df286ed5770d2d3e342c5031651b1bf6bd67b5790e860b9048c0e
3
+ metadata.gz: 7369765c3ef555fff544754deaaa6799522339a173a04bfded0c396761dcf01c
4
+ data.tar.gz: 9559d1cfbe38f273223ba271e5efc2257ae48998e52d7792ceaab0ce07d01367
5
5
  SHA512:
6
- metadata.gz: f78eb3fa9a7185d319973d1a597dccc400cf07d4b7f23cfcf9a7ad6b588118bfb51ce67ae0c5a2ed737e9ccb05470599fc688132bd54793bf4514116fea730f5
7
- data.tar.gz: b96befe285f4cbacd6de41c8e02073b6c8c9e05f7c5c412f265638158b38d2f203c061b587985840827c6f11ee37028126ec0f053fc8a700e26088f7dd62853a
6
+ metadata.gz: 8ff7f02f8a6303c8a231ea2a36d46b1539bd188a53bbe6c4cd3be6c3d42ff35004b02e8de392b6adaf20cf589b7796cff504144bdc0112e477b24dada73ea037
7
+ data.tar.gz: eea82aeb98e253cc8a101e1358a21454787d2c3b9ce510b7d39ea84b5c819bfa9a82e5d694e7765072e61fe5ed37018bf13ab72e661082916e48f0445fbd495c
@@ -120,6 +120,8 @@ module Dependabot
120
120
  # rubocop:disable Metrics/ParameterLists
121
121
  def create_pull_request(repo, pr_name, source_branch, target_branch,
122
122
  pr_description, _labels, _work_item = nil)
123
+ reviewers = default_reviewers(repo)
124
+
123
125
  content = {
124
126
  title: pr_name,
125
127
  source: {
@@ -133,6 +135,7 @@ module Dependabot
133
135
  }
134
136
  },
135
137
  description: pr_description,
138
+ reviewers: reviewers,
136
139
  close_source_branch: true
137
140
  }
138
141
 
@@ -141,6 +144,21 @@ module Dependabot
141
144
  end
142
145
  # rubocop:enable Metrics/ParameterLists
143
146
 
147
+ def default_reviewers(repo)
148
+ path = "#{repo}/default-reviewers?pagelen=100&fields=values.uuid,next"
149
+ reviewers_url = base_url + path
150
+
151
+ default_reviewers = paginate({ "next" => reviewers_url })
152
+
153
+ reviewer_data = []
154
+
155
+ default_reviewers.each do |reviewer|
156
+ reviewer_data.append({ uuid: reviewer.fetch("uuid") })
157
+ end
158
+
159
+ reviewer_data
160
+ end
161
+
144
162
  def tags(repo)
145
163
  path = "#{repo}/refs/tags?pagelen=100"
146
164
  response = get(base_url + path)
@@ -15,7 +15,7 @@ require "dependabot/shared_helpers"
15
15
  module Dependabot
16
16
  module FileFetchers
17
17
  class Base
18
- attr_reader :source, :credentials, :repo_contents_path
18
+ attr_reader :source, :credentials, :repo_contents_path, :options
19
19
 
20
20
  CLIENT_NOT_FOUND_ERRORS = [
21
21
  Octokit::NotFound,
@@ -42,11 +42,14 @@ module Dependabot
42
42
  # If provided, file _data_ will be loaded from the clone.
43
43
  # Submodules and directory listings are _not_ currently supported
44
44
  # by repo_contents_path and still use an API trip.
45
- def initialize(source:, credentials:, repo_contents_path: nil)
45
+ #
46
+ # options supports custom feature enablement
47
+ def initialize(source:, credentials:, repo_contents_path: nil, options: {})
46
48
  @source = source
47
49
  @credentials = credentials
48
50
  @repo_contents_path = repo_contents_path
49
51
  @linked_paths = {}
52
+ @options = options
50
53
  end
51
54
 
52
55
  def repo
@@ -18,9 +18,7 @@ module Dependabot
18
18
  return [] unless repo_contents_path && vendor_dir
19
19
 
20
20
  Dir.chdir(repo_contents_path) do
21
- relative_dir = Pathname.new(vendor_dir).relative_path_from(
22
- repo_contents_path
23
- )
21
+ relative_dir = Pathname.new(base_directory).sub(%r{\A/}, "").join(vendor_dir)
24
22
 
25
23
  status = SharedHelpers.run_shell_command(
26
24
  "git status --untracked-files all --porcelain v1 #{relative_dir}"
@@ -11,16 +11,17 @@ module Dependabot
11
11
  OBJECT_ID_FOR_BRANCH_DELETE = "0000000000000000000000000000000000000000"
12
12
 
13
13
  attr_reader :source, :files, :base_commit, :old_commit, :credentials,
14
- :pull_request_number
14
+ :pull_request_number, :author_details
15
15
 
16
16
  def initialize(source:, files:, base_commit:, old_commit:,
17
- credentials:, pull_request_number:)
17
+ credentials:, pull_request_number:, author_details: nil)
18
18
  @source = source
19
19
  @files = files
20
20
  @base_commit = base_commit
21
21
  @old_commit = old_commit
22
22
  @credentials = credentials
23
23
  @pull_request_number = pull_request_number
24
+ @author_details = author_details
24
25
  end
25
26
 
26
27
  def update
@@ -74,12 +75,15 @@ module Dependabot
74
75
  end
75
76
 
76
77
  def create_temp_branch
78
+ author = author_details&.slice(:name, :email, :date)
79
+ author = nil unless author&.any?
80
+
77
81
  response = azure_client_for_source.create_commit(
78
82
  temp_branch_name,
79
83
  base_commit,
80
84
  commit_message,
81
85
  files,
82
- nil
86
+ author
83
87
  )
84
88
 
85
89
  JSON.parse(response.body).fetch("refUpdates").first.fetch("newObjectId")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.207.0"
4
+ VERSION = "0.210.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.207.0
4
+ version: 0.210.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-11 00:00:00.000000000 Z
11
+ date: 2022-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -98,20 +98,20 @@ dependencies:
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: '1.7'
101
+ version: '1.11'
102
102
  - - ">="
103
103
  - !ruby/object:Gem::Version
104
- version: 1.7.1
104
+ version: 1.11.0
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '1.7'
111
+ version: '1.11'
112
112
  - - ">="
113
113
  - !ruby/object:Gem::Version
114
- version: 1.7.1
114
+ version: 1.11.0
115
115
  - !ruby/object:Gem::Dependency
116
116
  name: excon
117
117
  requirement: !ruby/object:Gem::Requirement
@@ -284,6 +284,20 @@ dependencies:
284
284
  - - "~>"
285
285
  - !ruby/object:Gem::Version
286
286
  version: '2.0'
287
+ - !ruby/object:Gem::Dependency
288
+ name: parallel_tests
289
+ requirement: !ruby/object:Gem::Requirement
290
+ requirements:
291
+ - - "~>"
292
+ - !ruby/object:Gem::Version
293
+ version: 3.11.1
294
+ type: :development
295
+ prerelease: false
296
+ version_requirements: !ruby/object:Gem::Requirement
297
+ requirements:
298
+ - - "~>"
299
+ - !ruby/object:Gem::Version
300
+ version: 3.11.1
287
301
  - !ruby/object:Gem::Dependency
288
302
  name: rake
289
303
  requirement: !ruby/object:Gem::Requirement
@@ -332,14 +346,14 @@ dependencies:
332
346
  requirements:
333
347
  - - "~>"
334
348
  - !ruby/object:Gem::Version
335
- version: 1.33.0
349
+ version: 1.35.1
336
350
  type: :development
337
351
  prerelease: false
338
352
  version_requirements: !ruby/object:Gem::Requirement
339
353
  requirements:
340
354
  - - "~>"
341
355
  - !ruby/object:Gem::Version
342
- version: 1.33.0
356
+ version: 1.35.1
343
357
  - !ruby/object:Gem::Dependency
344
358
  name: ruby-debug-ide
345
359
  requirement: !ruby/object:Gem::Requirement