dependabot-common 0.117.9 → 0.117.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependabot/pull_request_creator/labeler.rb +25 -12
- data/lib/dependabot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2a9d6ee089d6bb1c3e08a6858d924b995e13bfa7238746ccd8c55d217517185
|
4
|
+
data.tar.gz: 67048f550cf7595808e21d0cdf4864bf662140706261b3843f19bc480028c5c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3211d6c6f5da2b379377cf28552d5173ccda7285bad50e1a85c433a0202655cd414ca21d80b521f925092faa22d1eb64ddb9066d91384f8d19e5399b9c8fcc7
|
7
|
+
data.tar.gz: '087ea4164b328bb0ed195b8a4f44c0c92358b1e763d186f22008f704097a59d16403c8d304cd503c1697631f5c022c7b143d69d10f27ccd458f384050199907c'
|
@@ -6,6 +6,8 @@ module Dependabot
|
|
6
6
|
class PullRequestCreator
|
7
7
|
class Labeler
|
8
8
|
DEPENDENCIES_LABEL_REGEX = %r{^[^/]*dependenc[^/]+$}i.freeze
|
9
|
+
DEFAULT_DEPENDENCIES_LABEL = "dependencies"
|
10
|
+
DEFAULT_SECURITY_LABEL = "security"
|
9
11
|
|
10
12
|
@package_manager_labels = {}
|
11
13
|
|
@@ -170,12 +172,18 @@ module Dependabot
|
|
170
172
|
if custom_labels then custom_labels & labels
|
171
173
|
else
|
172
174
|
[
|
173
|
-
|
175
|
+
default_dependencies_label,
|
174
176
|
label_language? ? language_label : nil
|
175
177
|
].compact
|
176
178
|
end
|
177
179
|
end
|
178
180
|
|
181
|
+
# Find the exact match first and then fallback to *dependenc* label
|
182
|
+
def default_dependencies_label
|
183
|
+
labels.find { |l| l == DEFAULT_DEPENDENCIES_LABEL } ||
|
184
|
+
labels.find { |l| l.match?(DEPENDENCIES_LABEL_REGEX) }
|
185
|
+
end
|
186
|
+
|
179
187
|
def dependencies_label_exists?
|
180
188
|
labels.any? { |l| l.match?(DEPENDENCIES_LABEL_REGEX) }
|
181
189
|
end
|
@@ -260,7 +268,12 @@ module Dependabot
|
|
260
268
|
self.class.label_details_for_package_manager(package_manager).
|
261
269
|
fetch(:name)
|
262
270
|
|
263
|
-
@labels = [
|
271
|
+
@labels = [
|
272
|
+
*@labels,
|
273
|
+
DEFAULT_DEPENDENCIES_LABEL,
|
274
|
+
DEFAULT_SECURITY_LABEL,
|
275
|
+
langauge_name
|
276
|
+
].uniq
|
264
277
|
end
|
265
278
|
|
266
279
|
def create_dependencies_label
|
@@ -292,44 +305,44 @@ module Dependabot
|
|
292
305
|
|
293
306
|
def create_github_dependencies_label
|
294
307
|
github_client_for_source.add_label(
|
295
|
-
source.repo,
|
308
|
+
source.repo, DEFAULT_DEPENDENCIES_LABEL, "0366d6",
|
296
309
|
description: "Pull requests that update a dependency file",
|
297
310
|
accept: "application/vnd.github.symmetra-preview+json"
|
298
311
|
)
|
299
|
-
@labels = [*@labels,
|
312
|
+
@labels = [*@labels, DEFAULT_DEPENDENCIES_LABEL].uniq
|
300
313
|
rescue Octokit::UnprocessableEntity => e
|
301
314
|
raise unless e.errors.first.fetch(:code) == "already_exists"
|
302
315
|
|
303
|
-
@labels = [*@labels,
|
316
|
+
@labels = [*@labels, DEFAULT_DEPENDENCIES_LABEL].uniq
|
304
317
|
end
|
305
318
|
|
306
319
|
def create_gitlab_dependencies_label
|
307
320
|
gitlab_client_for_source.create_label(
|
308
|
-
source.repo,
|
321
|
+
source.repo, DEFAULT_DEPENDENCIES_LABEL, "#0366d6",
|
309
322
|
description: "Pull requests that update a dependency file"
|
310
323
|
)
|
311
|
-
@labels = [*@labels,
|
324
|
+
@labels = [*@labels, DEFAULT_DEPENDENCIES_LABEL].uniq
|
312
325
|
end
|
313
326
|
|
314
327
|
def create_github_security_label
|
315
328
|
github_client_for_source.add_label(
|
316
|
-
source.repo,
|
329
|
+
source.repo, DEFAULT_SECURITY_LABEL, "ee0701",
|
317
330
|
description: "Pull requests that address a security vulnerability",
|
318
331
|
accept: "application/vnd.github.symmetra-preview+json"
|
319
332
|
)
|
320
|
-
@labels = [*@labels,
|
333
|
+
@labels = [*@labels, DEFAULT_SECURITY_LABEL].uniq
|
321
334
|
rescue Octokit::UnprocessableEntity => e
|
322
335
|
raise unless e.errors.first.fetch(:code) == "already_exists"
|
323
336
|
|
324
|
-
@labels = [*@labels,
|
337
|
+
@labels = [*@labels, DEFAULT_SECURITY_LABEL].uniq
|
325
338
|
end
|
326
339
|
|
327
340
|
def create_gitlab_security_label
|
328
341
|
gitlab_client_for_source.create_label(
|
329
|
-
source.repo,
|
342
|
+
source.repo, DEFAULT_SECURITY_LABEL, "#ee0701",
|
330
343
|
description: "Pull requests that address a security vulnerability"
|
331
344
|
)
|
332
|
-
@labels = [*@labels,
|
345
|
+
@labels = [*@labels, DEFAULT_SECURITY_LABEL].uniq
|
333
346
|
end
|
334
347
|
|
335
348
|
def create_github_language_label
|
data/lib/dependabot/version.rb
CHANGED
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.117.
|
4
|
+
version: 0.117.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-codecommit
|