dependabot-common 0.275.0 → 0.277.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: ce6f7ca34b993b278be5b0302be3d148289caf89a392531fede5ae9c0166b46d
4
- data.tar.gz: 909a6d70c5f2cdce67ae49af86909e9f8b658bb74c8159c15fdb653b3ce93291
3
+ metadata.gz: a7543d885e4a35814953d8212da1438d0e343d0cf5d7aef83f7f2f02451a5ea3
4
+ data.tar.gz: b71e329381f97b309e9ca8b68c2b60bbf780e8c9a317558eb1f96e3ae3cae75f
5
5
  SHA512:
6
- metadata.gz: 2a8e74f0f9e68a69c8ada97c70e6d1c8167c97f942d0e14fe8675de0282db883473ccedcfdef660b31fd643c8a2f58e1f78424dac6e5530f7770bc33af03fd4b
7
- data.tar.gz: b9234254056f7e3db331b6654a95e2c4c73c41226bdff835a6dbfdf4f0327a6143441945c76d2f2a435a13f8677f5293bce41fe0a2952ec9a93136c0ac368ff4
6
+ metadata.gz: ac4cff3f2fcbcf43df1f6490f3cfa32c4d0f43f98b3409903b3f22ad3f12de3ccea86d4a2f2405daffcf17ed39539c6bfc15b1293a53542907229d1f3f939d4a
7
+ data.tar.gz: 3858ee8214c5afe7b065822afb4d0ce8bf0b9584ae882842efaa2a91ec5c59a8aa6869a9886f4cbbebad4a3c748b680acf45b62388dbbea286e62de6db2c6234
@@ -245,6 +245,12 @@ module Dependabot
245
245
  "error-type": "illformed_requirement",
246
246
  "error-detail": { message: error.message }
247
247
  }
248
+ when RegistryError
249
+ {
250
+ "error-type": "registry_error",
251
+ "error-detail": { status: error.status,
252
+ msg: error.message }
253
+ }
248
254
  when
249
255
  IncompatibleCPU,
250
256
  NetworkUnsafeHTTP
@@ -612,6 +618,19 @@ module Dependabot
612
618
  end
613
619
  end
614
620
 
621
+ class RegistryError < DependabotError
622
+ extend T::Sig
623
+
624
+ sig { returns(Integer) }
625
+ attr_reader :status
626
+
627
+ sig { params(status: Integer, msg: String).void }
628
+ def initialize(status, msg)
629
+ @status = status
630
+ super(msg)
631
+ end
632
+ end
633
+
615
634
  # Useful for JS file updaters, where the registry API sometimes returns
616
635
  # different results to the actual update process
617
636
  class InconsistentRegistryResponse < DependabotError; end
@@ -94,22 +94,6 @@ module Dependabot
94
94
  "Please upgrade to one of the following versions: #{versions_string}#{later_description}."
95
95
  end
96
96
 
97
- # Generates a support notice for the given package manager.
98
- # @param package_manager [PackageManagerBase] The package manager object.
99
- # @return [Notice, nil] The generated notice or nil if no notice is applicable.
100
- sig do
101
- params(
102
- package_manager: PackageManagerBase
103
- ).returns(T.nilable(Notice))
104
- end
105
- def self.generate_support_notice(package_manager)
106
- deprecation_notice = generate_pm_deprecation_notice(package_manager)
107
-
108
- return deprecation_notice if deprecation_notice
109
-
110
- generate_pm_unsupported_notice(package_manager)
111
- end
112
-
113
97
  # Generates a deprecation notice for the given package manager.
114
98
  # @param package_manager [PackageManagerBase] The package manager object.
115
99
  # @return [Notice, nil] The generated deprecation notice or nil if the package manager is not deprecated.
@@ -144,40 +128,6 @@ module Dependabot
144
128
  )
145
129
  end
146
130
 
147
- # Generates an unsupported notice for the given package manager.
148
- # @param package_manager [PackageManagerBase] The package manager object.
149
- # @return [Notice, nil] The generated unsupported notice or nil if the package manager is not unsupported.
150
- sig do
151
- params(
152
- package_manager: PackageManagerBase
153
- ).returns(T.nilable(Notice))
154
- end
155
- def self.generate_pm_unsupported_notice(package_manager)
156
- return nil unless package_manager.unsupported?
157
-
158
- mode = NoticeMode::ERROR
159
- supported_versions_description = generate_supported_versions_description(
160
- package_manager.supported_versions,
161
- package_manager.support_later_versions?
162
- )
163
- notice_type = "#{package_manager.name}_unsupported_error"
164
- title = "Package manager unsupported notice"
165
- description = "Dependabot no longer supports `#{package_manager.name} v#{package_manager.version}`!"
166
-
167
- ## Add the supported versions to the description
168
- description += "\n\n#{supported_versions_description}\n" unless supported_versions_description.empty?
169
-
170
- Notice.new(
171
- mode: mode,
172
- type: notice_type,
173
- package_manager_name: package_manager.name,
174
- title: title,
175
- description: description,
176
- show_in_pr: true,
177
- show_alert: true
178
- )
179
- end
180
-
181
131
  sig { params(notice: Notice).returns(T.nilable(String)) }
182
132
  def self.markdown_from_description(notice)
183
133
  description = notice.description
@@ -55,6 +55,9 @@ module Dependabot
55
55
  # package_manager.deprecated? #=> true
56
56
  sig { returns(T::Boolean) }
57
57
  def deprecated?
58
+ # If the version is unsupported, the unsupported error is getting raised separately.
59
+ return false if unsupported?
60
+
58
61
  deprecated_versions.include?(version)
59
62
  end
60
63
 
@@ -64,12 +67,23 @@ module Dependabot
64
67
  # package_manager.unsupported? #=> false
65
68
  sig { returns(T::Boolean) }
66
69
  def unsupported?
67
- return true if unsupported_versions.include?(version)
70
+ false
71
+ end
68
72
 
69
- supported_versions = self.supported_versions
70
- return version < supported_versions.first if supported_versions.any?
73
+ # Raises an error if the current package manager version is unsupported.
74
+ # If the version is unsupported, it raises a ToolVersionNotSupported error.
75
+ sig { void }
76
+ def raise_if_unsupported!
77
+ return unless unsupported?
71
78
 
72
- false
79
+ # Example: v2.*, v3.*
80
+ supported_versions_message = supported_versions.map { |v| "v#{v}.*" }.join(", ")
81
+
82
+ raise ToolVersionNotSupported.new(
83
+ name,
84
+ version.to_s,
85
+ supported_versions_message
86
+ )
73
87
  end
74
88
 
75
89
  # Indicates if the package manager supports later versions beyond those listed in supported_versions.
data/lib/dependabot.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Dependabot
5
- VERSION = "0.275.0"
5
+ VERSION = "0.277.0"
6
6
  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.275.0
4
+ version: 0.277.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-12 00:00:00.000000000 Z
11
+ date: 2024-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-codecommit
@@ -140,14 +140,14 @@ dependencies:
140
140
  requirements:
141
141
  - - '='
142
142
  - !ruby/object:Gem::Version
143
- version: 4.19.0
143
+ version: 5.0.0
144
144
  type: :runtime
145
145
  prerelease: false
146
146
  version_requirements: !ruby/object:Gem::Requirement
147
147
  requirements:
148
148
  - - '='
149
149
  - !ruby/object:Gem::Version
150
- version: 4.19.0
150
+ version: 5.0.0
151
151
  - !ruby/object:Gem::Dependency
152
152
  name: json
153
153
  requirement: !ruby/object:Gem::Requirement
@@ -185,7 +185,7 @@ dependencies:
185
185
  version: '4.6'
186
186
  - - "<"
187
187
  - !ruby/object:Gem::Version
188
- version: '7.0'
188
+ version: '8.0'
189
189
  type: :runtime
190
190
  prerelease: false
191
191
  version_requirements: !ruby/object:Gem::Requirement
@@ -195,7 +195,7 @@ dependencies:
195
195
  version: '4.6'
196
196
  - - "<"
197
197
  - !ruby/object:Gem::Version
198
- version: '7.0'
198
+ version: '8.0'
199
199
  - !ruby/object:Gem::Dependency
200
200
  name: opentelemetry-sdk
201
201
  requirement: !ruby/object:Gem::Requirement
@@ -600,7 +600,7 @@ licenses:
600
600
  - MIT
601
601
  metadata:
602
602
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
603
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.275.0
603
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.277.0
604
604
  post_install_message:
605
605
  rdoc_options: []
606
606
  require_paths: