dependabot-common 0.180.0 → 0.180.3

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: 5b9c5a80ab154885ed67b6b2eaae39a28c68228c3f6412dd8983b808ffc39261
4
- data.tar.gz: 073dfe0016cba0a6dd41d908e0f76b130cb34f0595c8fccd34c31f6aca3d358a
3
+ metadata.gz: 0b4c1b2ea482de6dfe3ed2f5d528b9d955af8b8003a6b2ee0a525e7684bffb74
4
+ data.tar.gz: 5b3965c5bbb71869e057f04a20e561ba4ccef3b985133dfefb0ed48654d62d41
5
5
  SHA512:
6
- metadata.gz: 3b4317440f509f2991f6dcd82f59727ee7c716a85856de394838ed362a0b18767855297acb9c30b2a312bb7ba8e374570e187034340252464831d8a69e551918
7
- data.tar.gz: 9bdae5742d39d9501eca6ce904fbd9bd02068ebb85d4c7c50ed9b9f27462301b09f770a1fe978a47a9a2600cc6580b703b54bfdc1af7a41ce611deec1de13834
6
+ metadata.gz: ebc82fe32f383fea95e3ae56f56f6d49b3fef6d483e548db131a8a8f02a93bfbf804ab26121b38fe75384aad2d23f53ebefef510bd286c9a5433d88f37ef5522
7
+ data.tar.gz: 2a88f5f5c1c021e7607fbc43b9300ceba2b8f31a1126dfc2f15df60978190d532c7f14e5a615bf86b226e0f0bffd18d8d69903182a4807c5407c18550bbe9bcb
@@ -271,6 +271,7 @@ module Dependabot
271
271
  end
272
272
 
273
273
  def fetch_gitlab_file_list
274
+ branch = default_gitlab_branch
274
275
  gitlab_client.repo_tree(source.repo).map do |file|
275
276
  type = case file.type
276
277
  when "blob" then "file"
@@ -281,8 +282,8 @@ module Dependabot
281
282
  name: file.name,
282
283
  type: type,
283
284
  size: 100, # GitLab doesn't return file size
284
- html_url: "#{source.url}/blob/master/#{file.path}",
285
- download_url: "#{source.url}/raw/master/#{file.path}"
285
+ html_url: "#{source.url}/blob/#{branch}/#{file.path}",
286
+ download_url: "#{source.url}/raw/#{branch}/#{file.path}"
286
287
  )
287
288
  end
288
289
  rescue Gitlab::Error::NotFound
@@ -355,6 +356,11 @@ module Dependabot
355
356
  @default_bitbucket_branch ||=
356
357
  bitbucket_client.fetch_default_branch(source.repo)
357
358
  end
359
+
360
+ def default_gitlab_branch
361
+ @default_gitlab_branch ||=
362
+ gitlab_client.fetch_default_branch(source.repo)
363
+ end
358
364
  end
359
365
  end
360
366
  end
@@ -210,7 +210,7 @@ module Dependabot
210
210
  elsif new_tag
211
211
  "commits/#{new_tag}"
212
212
  else
213
- "commits/master"
213
+ "commits/#{default_gitlab_branch}"
214
214
  end
215
215
  end
216
216
 
@@ -321,6 +321,11 @@ module Dependabot
321
321
  MetadataFinders::Base::PACKAGE_MANAGERS_WITH_RELIABLE_DIRECTORIES.
322
322
  include?(dependency.package_manager)
323
323
  end
324
+
325
+ def default_gitlab_branch
326
+ @default_gitlab_branch ||=
327
+ gitlab_client.fetch_default_branch(source.repo)
328
+ end
324
329
  end
325
330
  end
326
331
  end
@@ -145,26 +145,32 @@ module Dependabot
145
145
  assignee_ids: assignees,
146
146
  labels: labeler.labels_for_pr.join(","),
147
147
  milestone_id: milestone,
148
- target_project_id: target_project_id
148
+ target_project_id: target_project_id,
149
+ reviewer_ids: approvers_hash[:reviewers]
149
150
  )
150
151
  end
151
152
 
152
153
  def annotate_merge_request(merge_request)
153
- add_approvers_to_merge_request(merge_request) if approvers&.any?
154
+ add_approvers_to_merge_request(merge_request)
154
155
  end
155
156
 
156
157
  def add_approvers_to_merge_request(merge_request)
157
- approvers_hash =
158
- approvers.keys.map { |k| [k.to_sym, approvers[k]] }.to_h
158
+ return unless approvers_hash[:approvers] || approvers_hash[:group_approvers]
159
159
 
160
- gitlab_client_for_source.edit_merge_request_approvers(
160
+ gitlab_client_for_source.create_merge_request_level_rule(
161
161
  target_project_id || source.repo,
162
162
  merge_request.iid,
163
- approver_ids: approvers_hash[:approvers],
164
- approver_group_ids: approvers_hash[:group_approvers]
163
+ name: "dependency-updates",
164
+ approvals_required: 1,
165
+ user_ids: approvers_hash[:approvers],
166
+ group_ids: approvers_hash[:group_approvers]
165
167
  )
166
168
  end
167
169
 
170
+ def approvers_hash
171
+ @approvers_hash ||= approvers&.transform_keys(&:to_sym) || {}
172
+ end
173
+
168
174
  def default_branch
169
175
  @default_branch ||=
170
176
  gitlab_client_for_source.project(source.repo).default_branch
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.180.0"
4
+ VERSION = "0.180.3"
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.180.0
4
+ version: 0.180.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-18 00:00:00.000000000 Z
11
+ date: 2022-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -132,28 +132,28 @@ dependencies:
132
132
  requirements:
133
133
  - - '='
134
134
  - !ruby/object:Gem::Version
135
- version: 1.7.0
135
+ version: 1.10.0
136
136
  type: :runtime
137
137
  prerelease: false
138
138
  version_requirements: !ruby/object:Gem::Requirement
139
139
  requirements:
140
140
  - - '='
141
141
  - !ruby/object:Gem::Version
142
- version: 1.7.0
142
+ version: 1.10.0
143
143
  - !ruby/object:Gem::Dependency
144
144
  name: gitlab
145
145
  requirement: !ruby/object:Gem::Requirement
146
146
  requirements:
147
147
  - - '='
148
148
  - !ruby/object:Gem::Version
149
- version: 4.17.0
149
+ version: 4.18.0
150
150
  type: :runtime
151
151
  prerelease: false
152
152
  version_requirements: !ruby/object:Gem::Requirement
153
153
  requirements:
154
154
  - - '='
155
155
  - !ruby/object:Gem::Version
156
- version: 4.17.0
156
+ version: 4.18.0
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: nokogiri
159
159
  requirement: !ruby/object:Gem::Requirement
@@ -298,14 +298,14 @@ dependencies:
298
298
  requirements:
299
299
  - - "~>"
300
300
  - !ruby/object:Gem::Version
301
- version: 1.23.0
301
+ version: 1.26.0
302
302
  type: :development
303
303
  prerelease: false
304
304
  version_requirements: !ruby/object:Gem::Requirement
305
305
  requirements:
306
306
  - - "~>"
307
307
  - !ruby/object:Gem::Version
308
- version: 1.23.0
308
+ version: 1.26.0
309
309
  - !ruby/object:Gem::Dependency
310
310
  name: simplecov
311
311
  requirement: !ruby/object:Gem::Requirement