dependabot-common 0.292.0 → 0.293.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependabot/errors.rb +10 -22
- data/lib/dependabot/workspace/change_attempt.rb +1 -6
- data/lib/dependabot/workspace/git.rb +8 -15
- data/lib/dependabot.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b4d27736af7c39344d1d7b96954789a59840fc8babfb779a4b88e267170f1db
|
4
|
+
data.tar.gz: d61444a31fafe63b7704284f8c0d67b3ac1a8cac53284221c21fa32bdd1dc799
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49f0a7dd758a5329ead57e18df49bf954fa2220582695cc9fed271d60eb9642fe72bc9154663454533c7703436733a6622635c43f54b0578736c17e4a20e5631
|
7
|
+
data.tar.gz: 6e43c31f3902f35f53e2edaec282519c8c97fba6a0db1e36a2e39513d16d5882d9fb33d4a66f7515280c957309593b69af6d12624a23c399e71ca90c1a67ffbd
|
data/lib/dependabot/errors.rb
CHANGED
@@ -149,11 +149,6 @@ module Dependabot
|
|
149
149
|
"error-type": "git_dependencies_not_reachable",
|
150
150
|
"error-detail": { "dependency-urls": error.dependency_urls }
|
151
151
|
}
|
152
|
-
when Dependabot::UnresolvableVersionError
|
153
|
-
{
|
154
|
-
"error-type": "unresolvable_version",
|
155
|
-
"error-detail": { dependencies: error.dependencies }
|
156
|
-
}
|
157
152
|
when Dependabot::NotImplemented
|
158
153
|
{
|
159
154
|
"error-type": "not_implemented",
|
@@ -171,6 +166,7 @@ module Dependabot
|
|
171
166
|
|
172
167
|
# rubocop:disable Lint/RedundantCopDisableDirective
|
173
168
|
# rubocop:disable Metrics/CyclomaticComplexity
|
169
|
+
# rubocop:disable Metrics/AbcSize
|
174
170
|
sig { params(error: StandardError).returns(T.nilable(T::Hash[Symbol, T.untyped])) }
|
175
171
|
def self.updater_error_details(error)
|
176
172
|
case error
|
@@ -184,6 +180,14 @@ module Dependabot
|
|
184
180
|
"error-type": "dependency_file_not_evaluatable",
|
185
181
|
"error-detail": { message: error.message }
|
186
182
|
}
|
183
|
+
when Dependabot::DependencyFileNotParseable
|
184
|
+
{
|
185
|
+
"error-type": "dependency_file_not_parseable",
|
186
|
+
"error-detail": {
|
187
|
+
message: error.message,
|
188
|
+
"file-path": error.file_path
|
189
|
+
}
|
190
|
+
}
|
187
191
|
when Dependabot::GitDependenciesNotReachable
|
188
192
|
{
|
189
193
|
"error-type": "git_dependencies_not_reachable",
|
@@ -299,6 +303,7 @@ module Dependabot
|
|
299
303
|
# rubocop:enable Metrics/MethodLength
|
300
304
|
# rubocop:enable Metrics/CyclomaticComplexity
|
301
305
|
# rubocop:enable Lint/RedundantCopDisableDirective
|
306
|
+
# rubocop:enable Metrics/AbcSize
|
302
307
|
|
303
308
|
class DependabotError < StandardError
|
304
309
|
extend T::Sig
|
@@ -671,23 +676,6 @@ module Dependabot
|
|
671
676
|
end
|
672
677
|
end
|
673
678
|
|
674
|
-
class UnresolvableVersionError < DependabotError
|
675
|
-
extend T::Sig
|
676
|
-
|
677
|
-
sig { returns(T::Array[String]) }
|
678
|
-
attr_reader :dependencies
|
679
|
-
|
680
|
-
sig { params(dependencies: T::Array[String]).void }
|
681
|
-
def initialize(dependencies)
|
682
|
-
@dependencies = dependencies
|
683
|
-
|
684
|
-
msg = "Unable to determine semantic version from tags or commits for dependencies. " \
|
685
|
-
"Dependencies must have a tag or commit that references a semantic version. " \
|
686
|
-
"Affected dependencies: #{@dependencies.join(', ')}"
|
687
|
-
super(msg)
|
688
|
-
end
|
689
|
-
end
|
690
|
-
|
691
679
|
class GitDependenciesNotReachable < DependabotError
|
692
680
|
extend T::Sig
|
693
681
|
|
@@ -8,9 +8,6 @@ module Dependabot
|
|
8
8
|
class ChangeAttempt
|
9
9
|
extend T::Sig
|
10
10
|
|
11
|
-
sig { returns(T.nilable(String)) }
|
12
|
-
attr_reader :diff
|
13
|
-
|
14
11
|
sig { returns(T.nilable(StandardError)) }
|
15
12
|
attr_reader :error
|
16
13
|
|
@@ -28,15 +25,13 @@ module Dependabot
|
|
28
25
|
workspace: Dependabot::Workspace::Base,
|
29
26
|
id: String,
|
30
27
|
memo: T.nilable(String),
|
31
|
-
diff: T.nilable(String),
|
32
28
|
error: T.nilable(StandardError)
|
33
29
|
).void
|
34
30
|
end
|
35
|
-
def initialize(workspace, id:, memo:,
|
31
|
+
def initialize(workspace, id:, memo:, error: nil)
|
36
32
|
@workspace = workspace
|
37
33
|
@id = id
|
38
34
|
@memo = memo
|
39
|
-
@diff = diff
|
40
35
|
@error = error
|
41
36
|
end
|
42
37
|
|
@@ -56,9 +56,9 @@ module Dependabot
|
|
56
56
|
return nil if changed_files(ignored_mode: "no").empty?
|
57
57
|
|
58
58
|
debug("store_change - before: #{current_commit}")
|
59
|
-
sha
|
59
|
+
sha = commit(memo)
|
60
60
|
|
61
|
-
change_attempts << ChangeAttempt.new(self, id: sha, memo: memo
|
61
|
+
change_attempts << ChangeAttempt.new(self, id: sha, memo: memo)
|
62
62
|
ensure
|
63
63
|
debug("store_change - after: #{current_commit}")
|
64
64
|
end
|
@@ -73,8 +73,8 @@ module Dependabot
|
|
73
73
|
def capture_failed_change_attempt(memo = nil, error = nil)
|
74
74
|
return nil if changed_files(ignored_mode: "matching").empty? && error.nil?
|
75
75
|
|
76
|
-
sha
|
77
|
-
change_attempts << ChangeAttempt.new(self, id: sha, memo: memo,
|
76
|
+
sha = stash(memo)
|
77
|
+
change_attempts << ChangeAttempt.new(self, id: sha, memo: memo, error: error)
|
78
78
|
end
|
79
79
|
|
80
80
|
private
|
@@ -112,7 +112,7 @@ module Dependabot
|
|
112
112
|
).strip
|
113
113
|
end
|
114
114
|
|
115
|
-
sig { params(memo: T.nilable(String)).returns(
|
115
|
+
sig { params(memo: T.nilable(String)).returns(String) }
|
116
116
|
def stash(memo = nil)
|
117
117
|
msg = memo || "workspace change attempt"
|
118
118
|
run_shell_command("git add --all --force .")
|
@@ -122,19 +122,12 @@ module Dependabot
|
|
122
122
|
allow_unsafe_shell_command: true
|
123
123
|
)
|
124
124
|
|
125
|
-
|
126
|
-
diff = run_shell_command(
|
127
|
-
"git stash show --patch #{sha}",
|
128
|
-
fingerprint: "git stash show --patch <sha>"
|
129
|
-
)
|
130
|
-
|
131
|
-
[sha, diff]
|
125
|
+
last_stash_sha
|
132
126
|
end
|
133
127
|
|
134
|
-
sig { params(memo: T.nilable(String)).returns(
|
128
|
+
sig { params(memo: T.nilable(String)).returns(String) }
|
135
129
|
def commit(memo = nil)
|
136
130
|
run_shell_command("git add #{path}")
|
137
|
-
diff = run_shell_command("git diff --cached .")
|
138
131
|
|
139
132
|
msg = memo || "workspace change"
|
140
133
|
run_shell_command(
|
@@ -143,7 +136,7 @@ module Dependabot
|
|
143
136
|
allow_unsafe_shell_command: true
|
144
137
|
)
|
145
138
|
|
146
|
-
|
139
|
+
head_sha
|
147
140
|
end
|
148
141
|
|
149
142
|
sig { params(sha: String).returns(String) }
|
data/lib/dependabot.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.
|
4
|
+
version: 0.293.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-codecommit
|
@@ -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.
|
618
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.293.0
|
619
619
|
post_install_message:
|
620
620
|
rdoc_options: []
|
621
621
|
require_paths:
|