dependabot-common 0.362.0 → 0.363.0

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: e954f8150ee22e565d732b1d6144a2d6bb8ff66ea574264721f27d243ed5ab05
4
- data.tar.gz: e6e93fd3f2acd820f9b8e2479dd60869ea2f4141d0a0cf5a05d6ef9262ac8951
3
+ metadata.gz: b04a10a34f26b5eb05c6a7e6c789fdda3bde3d118ab31eb1862e725f81aa930e
4
+ data.tar.gz: d8877825b52d5f928171490bf935afc2cf2b8272d39bb5d47244b57d3c4c62f8
5
5
  SHA512:
6
- metadata.gz: 36a4b41db9cd89b1e82424525594e489992c8a58a56de02e2bfadc425a90abbe2610725c79f888e11bcb6a0d2ad9a1ce6260b6367f4d4679aac885fb53a2fa0c
7
- data.tar.gz: 95dd669d3d28b2cc8edb23922eb59e580c561ed8021cd84cf067d8d74f1c22aa2b00fdcb299ba57b89e59d7d32528d3401cfb7f39e03806763f164074163019b
6
+ metadata.gz: 66c72eb2bc6a5890de1573e828b0bf6f5f8c826c4e80d5d8c1eae0f49ac5803a2b5e1c3e8273ce9be624e32f78f854f661c03a0cea3da5423b558f69329553f3
7
+ data.tar.gz: 9a8004bb292cebee846bc91ba9fe96d1e0ab632d8bb73522377ec1b98c88a2d99e6408f46792e3b19940d62bffbd109dbae34c7ca1e4b359b90df05bb198942a
@@ -296,9 +296,9 @@ module Dependabot
296
296
  title: pr_name,
297
297
  description: pr_description,
298
298
  targets: [
299
- repository_name: source.unscoped_repo,
300
- source_reference: target_branch,
301
- destination_reference: source_branch
299
+ { repository_name: source.unscoped_repo,
300
+ source_reference: target_branch,
301
+ destination_reference: source_branch }
302
302
  ]
303
303
  )
304
304
  end
@@ -27,8 +27,8 @@ module Dependabot
27
27
  sig do
28
28
  params(
29
29
  dependency_name: String,
30
- versions: T.any(NilClass, T::Array[String]),
31
- update_types: T.any(NilClass, T::Array[String])
30
+ versions: T.nilable(T::Array[String]),
31
+ update_types: T.nilable(T::Array[String])
32
32
  ).void
33
33
  end
34
34
  def initialize(dependency_name:, versions: nil, update_types: nil)
@@ -52,6 +52,13 @@ module Dependabot
52
52
  message: error.message
53
53
  }
54
54
  }
55
+ when Dependabot::RefNamespaceConflictError
56
+ {
57
+ "error-type": "file_fetcher_error",
58
+ "error-detail": {
59
+ message: error.message
60
+ }
61
+ }
55
62
  when Dependabot::DirectoryNotFound
56
63
  {
57
64
  "error-type": "directory_not_found",
@@ -469,6 +476,8 @@ module Dependabot
469
476
 
470
477
  class InvalidGitAuthToken < DependabotError; end
471
478
 
479
+ class RefNamespaceConflictError < DependabotError; end
480
+
472
481
  #####################
473
482
  # Repo level errors #
474
483
  #####################
@@ -641,20 +641,20 @@ module Dependabot
641
641
  T.unsafe(gitlab_client)
642
642
  .repo_tree(repo, path: path, ref: commit, per_page: 100)
643
643
  .map do |file|
644
- # GitLab API essentially returns the output from `git ls-tree`
645
- type = case file.type
646
- when "blob" then "file"
647
- when "tree" then "dir"
648
- when "commit" then "submodule"
649
- else file.fetch("type")
650
- end
651
-
652
- RepositoryContent.new(
653
- name: file.name,
654
- path: file.path,
655
- type: type,
656
- size: 0 # GitLab doesn't return file size
657
- )
644
+ # GitLab API essentially returns the output from `git ls-tree`
645
+ type = case file.type
646
+ when "blob" then "file"
647
+ when "tree" then "dir"
648
+ when "commit" then "submodule"
649
+ else file.fetch("type")
650
+ end
651
+
652
+ RepositoryContent.new(
653
+ name: file.name,
654
+ path: file.path,
655
+ type: type,
656
+ size: 0 # GitLab doesn't return file size
657
+ )
658
658
  end
659
659
  end
660
660
 
@@ -210,6 +210,8 @@ module Dependabot
210
210
  dependency_file_list(ref)
211
211
  .select { |f| f.type == "file" }
212
212
  .reject { |f| f.name.end_with?(".sh") }
213
+ # JSON files are machine-readable, not useful as changelogs
214
+ .reject { |f| f.name.end_with?(".json") }
213
215
  .reject { |f| f.size > 1_000_000 }
214
216
  .reject { |f| f.size < 100 }
215
217
 
@@ -309,11 +309,11 @@ module Dependabot
309
309
  T.unsafe(bitbucket_client)
310
310
  .compare(T.must(source).repo, previous_tag, new_tag)
311
311
  .map do |commit|
312
- {
313
- message: commit.dig("summary", "raw"),
314
- sha: commit["hash"],
315
- html_url: commit.dig("links", "html", "href")
316
- }
312
+ {
313
+ message: commit.dig("summary", "raw"),
314
+ sha: commit["hash"],
315
+ html_url: commit.dig("links", "html", "href")
316
+ }
317
317
  end
318
318
  rescue Dependabot::Clients::Bitbucket::NotFound,
319
319
  Dependabot::Clients::Bitbucket::Unauthorized,
@@ -330,11 +330,11 @@ module Dependabot
330
330
  .compare(T.must(source).repo, previous_tag, new_tag)
331
331
  .commits
332
332
  .map do |commit|
333
- {
334
- message: commit["message"],
335
- sha: commit["id"],
336
- html_url: "#{T.must(source).url}/commit/#{commit['id']}"
337
- }
333
+ {
334
+ message: commit["message"],
335
+ sha: commit["id"],
336
+ html_url: "#{T.must(source).url}/commit/#{commit['id']}"
337
+ }
338
338
  end
339
339
  rescue Gitlab::Error::NotFound
340
340
  []
@@ -346,11 +346,11 @@ module Dependabot
346
346
  azure_client
347
347
  .compare(previous_tag, new_tag, type)
348
348
  .map do |commit|
349
- {
350
- message: commit["comment"],
351
- sha: commit["commitId"],
352
- html_url: commit["remoteUrl"]
353
- }
349
+ {
350
+ message: commit["comment"],
351
+ sha: commit["commitId"],
352
+ html_url: commit["remoteUrl"]
353
+ }
354
354
  end
355
355
  rescue Dependabot::Clients::Azure::NotFound,
356
356
  Dependabot::Clients::Azure::Unauthorized,
@@ -240,9 +240,9 @@ module Dependabot
240
240
  def filter_ignored_versions(releases)
241
241
  filtered = releases
242
242
  .reject do |release|
243
- ignore_requirements.any? do |r|
244
- r.satisfied_by?(release.version)
245
- end
243
+ ignore_requirements.any? do |r|
244
+ r.satisfied_by?(release.version)
245
+ end
246
246
  end
247
247
  if @raise_on_ignored && filter_lower_versions(filtered).empty? && filter_lower_versions(releases).any?
248
248
  raise Dependabot::AllVersionsIgnored
@@ -277,9 +277,9 @@ module Dependabot
277
277
 
278
278
  releases
279
279
  .select do |release|
280
- reqs.all? do |r|
281
- r.any? { |o| o.satisfied_by?(release.version) }
282
- end
280
+ reqs.all? do |r|
281
+ r.any? { |o| o.satisfied_by?(release.version) }
282
+ end
283
283
  end
284
284
  end
285
285
 
data/lib/dependabot.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Dependabot
5
- VERSION = "0.362.0"
5
+ VERSION = "0.363.0"
6
6
  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.362.0
4
+ version: 0.363.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -147,14 +147,14 @@ dependencies:
147
147
  requirements:
148
148
  - - "<"
149
149
  - !ruby/object:Gem::Version
150
- version: '2.12'
150
+ version: '2.19'
151
151
  type: :runtime
152
152
  prerelease: false
153
153
  version_requirements: !ruby/object:Gem::Requirement
154
154
  requirements:
155
155
  - - "<"
156
156
  - !ruby/object:Gem::Version
157
- version: '2.12'
157
+ version: '2.19'
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: nokogiri
160
160
  requirement: !ruby/object:Gem::Requirement
@@ -357,14 +357,14 @@ dependencies:
357
357
  requirements:
358
358
  - - "~>"
359
359
  - !ruby/object:Gem::Version
360
- version: '1.3'
360
+ version: '2.0'
361
361
  type: :development
362
362
  prerelease: false
363
363
  version_requirements: !ruby/object:Gem::Requirement
364
364
  requirements:
365
365
  - - "~>"
366
366
  - !ruby/object:Gem::Version
367
- version: '1.3'
367
+ version: '2.0'
368
368
  - !ruby/object:Gem::Dependency
369
369
  name: rspec-sorbet
370
370
  requirement: !ruby/object:Gem::Requirement
@@ -615,7 +615,7 @@ licenses:
615
615
  - MIT
616
616
  metadata:
617
617
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
618
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.362.0
618
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.363.0
619
619
  rdoc_options: []
620
620
  require_paths:
621
621
  - lib