dependabot-nuget 0.320.0 → 0.320.1

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: 01f128d072d32926e6e96f7b22267731024c29c8f5612e4c5bff9d9cbcfc697f
4
- data.tar.gz: 1bbbd11f11bc330310bdf5414c5bd9f848b59910f4111756fb525df6a75391a9
3
+ metadata.gz: 1831ce64cfdb9602329ea6a8ae506041eafc346b8ad8bef67afcd0f049a2ca93
4
+ data.tar.gz: be1476e3b56bfa67e803fb9d70eb4ec82113af256995d0e44d7fd5dd0335331b
5
5
  SHA512:
6
- metadata.gz: d17cb789e99b9849e649a0961df43bb9dd74e7840fe4cb35542d4be6cc88ac045aa3445431443d1a8b98d0bf0baef2ac9f4bef50d74bde66a2af04ab711a234c
7
- data.tar.gz: 733bdc56ef1a9617f6a16b90fdcbf4fcd522e6d86a3f3f4fcbf3f40981135dbd873b85397a06de97710c7794e4dd30158ff1ef1e2e3fb5282c7488109b992754
6
+ metadata.gz: 6767882035faa57a63a97a0b25b9e3db46061bc1c23b9befd230985435e0560d3f913c1c86ba5ebe4f9c4c81b4adcc2d90548b7a6047dede4644c363dfbc44eb
7
+ data.tar.gz: 5233059c5c248a2f54b39ca1f8819f96ddc7b4d81701135a98403f7965000aeffbd8407680d582bf7449bb543df38568f21cb45d1a895f2d220177cdea1b5b0b
@@ -30,7 +30,7 @@ internal static class CloneCommand
30
30
  var apiHandler = new HttpApiHandler(apiUrl.ToString(), jobId);
31
31
  var logger = new OpenTelemetryLogger();
32
32
  var gitCommandHandler = new ShellGitCommandHandler(logger);
33
- var worker = new CloneWorker(jobId, apiHandler, gitCommandHandler);
33
+ var worker = new CloneWorker(jobId, apiHandler, gitCommandHandler, logger);
34
34
  var exitCode = await worker.RunAsync(jobPath, repoContentsPath);
35
35
  setExitCode(exitCode);
36
36
  }, JobPathOption, RepoContentsPathOption, ApiUrlOption, JobIdOption);
@@ -12,12 +12,14 @@ public class CloneWorker
12
12
  private readonly string _jobId;
13
13
  private readonly IApiHandler _apiHandler;
14
14
  private readonly IGitCommandHandler _gitCommandHandler;
15
+ private readonly ILogger _logger;
15
16
 
16
- public CloneWorker(string jobId, IApiHandler apiHandler, IGitCommandHandler gitCommandHandler)
17
+ public CloneWorker(string jobId, IApiHandler apiHandler, IGitCommandHandler gitCommandHandler, ILogger logger)
17
18
  {
18
19
  _jobId = jobId;
19
20
  _apiHandler = apiHandler;
20
21
  _gitCommandHandler = gitCommandHandler;
22
+ _logger = logger;
21
23
  }
22
24
 
23
25
  // entrypoint for cli
@@ -89,7 +91,7 @@ public class CloneWorker
89
91
 
90
92
  private async Task ReportError(JobErrorBase error)
91
93
  {
92
- await _apiHandler.RecordUpdateJobError(error);
94
+ await _apiHandler.RecordUpdateJobError(error, _logger);
93
95
  await _apiHandler.MarkAsProcessed(new("unknown"));
94
96
  }
95
97
 
@@ -9,8 +9,10 @@ public interface IApiHandler
9
9
 
10
10
  public static class IApiHandlerExtensions
11
11
  {
12
- public static async Task RecordUpdateJobError(this IApiHandler handler, JobErrorBase error)
12
+ public static async Task RecordUpdateJobError(this IApiHandler handler, JobErrorBase error, ILogger logger)
13
13
  {
14
+ var errorReport = error.GetReport();
15
+ logger.Error(errorReport);
14
16
  await handler.PostAsJson("record_update_job_error", error);
15
17
  if (error is UnknownError unknown)
16
18
  {
@@ -109,7 +109,7 @@ public class RunWorker
109
109
 
110
110
  if (error is not null)
111
111
  {
112
- await _apiHandler.RecordUpdateJobError(error);
112
+ await _apiHandler.RecordUpdateJobError(error, _logger);
113
113
  }
114
114
 
115
115
  await _apiHandler.MarkAsProcessed(new(baseCommitSha));
@@ -155,7 +155,7 @@ public class RunWorker
155
155
 
156
156
  if (error is not null)
157
157
  {
158
- await _apiHandler.RecordUpdateJobError(error);
158
+ await _apiHandler.RecordUpdateJobError(error, _logger);
159
159
  }
160
160
 
161
161
  await _apiHandler.MarkAsProcessed(new(baseCommitSha));
@@ -172,7 +172,7 @@ public class RunWorker
172
172
  if (discoveryResult.Error is not null)
173
173
  {
174
174
  // this is unrecoverable
175
- await _apiHandler.RecordUpdateJobError(discoveryResult.Error);
175
+ await _apiHandler.RecordUpdateJobError(discoveryResult.Error, _logger);
176
176
  return new()
177
177
  {
178
178
  Base64DependencyFiles = [],
@@ -238,7 +238,7 @@ public class RunWorker
238
238
 
239
239
  if (analysisResult.Error is not null)
240
240
  {
241
- await _apiHandler.RecordUpdateJobError(analysisResult.Error);
241
+ await _apiHandler.RecordUpdateJobError(analysisResult.Error, _logger);
242
242
  continue;
243
243
  }
244
244
 
@@ -288,7 +288,7 @@ public class RunWorker
288
288
  var updateResult = await _updaterWorker.RunAsync(repoContentsPath.FullName, updateOperation.ProjectPath, dependency.Name, dependency.Version!, analysisResult.UpdatedVersion, isTransitive: dependency.IsTransitive);
289
289
  if (updateResult.Error is not null)
290
290
  {
291
- await _apiHandler.RecordUpdateJobError(updateResult.Error);
291
+ await _apiHandler.RecordUpdateJobError(updateResult.Error, _logger);
292
292
  }
293
293
  else
294
294
  {
@@ -389,7 +389,7 @@ public class RunWorker
389
389
  switch (message)
390
390
  {
391
391
  case JobErrorBase error:
392
- await _apiHandler.RecordUpdateJobError(error);
392
+ await _apiHandler.RecordUpdateJobError(error, _logger);
393
393
  break;
394
394
  case CreatePullRequest create:
395
395
  await _apiHandler.CreatePullRequest(create);
@@ -37,7 +37,7 @@ internal class CreateSecurityUpdatePullRequestHandler : IUpdateHandler
37
37
  logger.ReportDiscovery(discoveryResult);
38
38
  if (discoveryResult.Error is not null)
39
39
  {
40
- await apiHandler.RecordUpdateJobError(discoveryResult.Error);
40
+ await apiHandler.RecordUpdateJobError(discoveryResult.Error, logger);
41
41
  return;
42
42
  }
43
43
 
@@ -55,7 +55,7 @@ internal class CreateSecurityUpdatePullRequestHandler : IUpdateHandler
55
55
 
56
56
  if (groupedUpdateOperationsToPerform.Count == 0)
57
57
  {
58
- await apiHandler.RecordUpdateJobError(new SecurityUpdateDependencyNotFound());
58
+ await apiHandler.RecordUpdateJobError(new SecurityUpdateDependencyNotFound(), logger);
59
59
  continue;
60
60
  }
61
61
 
@@ -82,11 +82,11 @@ internal class CreateSecurityUpdatePullRequestHandler : IUpdateHandler
82
82
  if (ignoredUpdates.Length > 0)
83
83
  {
84
84
  logger.Error($"Cannot update {dependencyName} because all versions are ignored.");
85
- await apiHandler.RecordUpdateJobError(new SecurityUpdateIgnored(dependencyName));
85
+ await apiHandler.RecordUpdateJobError(new SecurityUpdateIgnored(dependencyName), logger);
86
86
  }
87
87
  else
88
88
  {
89
- await apiHandler.RecordUpdateJobError(new SecurityUpdateNotNeeded(dependencyName));
89
+ await apiHandler.RecordUpdateJobError(new SecurityUpdateNotNeeded(dependencyName), logger);
90
90
  }
91
91
 
92
92
  continue;
@@ -98,14 +98,14 @@ internal class CreateSecurityUpdatePullRequestHandler : IUpdateHandler
98
98
  if (analysisResult.Error is not null)
99
99
  {
100
100
  logger.Error($"Error analyzing {dependency.Name} in {projectPath}: {analysisResult.Error.GetReport()}");
101
- await apiHandler.RecordUpdateJobError(analysisResult.Error);
101
+ await apiHandler.RecordUpdateJobError(analysisResult.Error, logger);
102
102
  return;
103
103
  }
104
104
 
105
105
  if (!analysisResult.CanUpdate)
106
106
  {
107
107
  logger.Info($"No updatable version found for {dependency.Name} in {projectPath}.");
108
- await apiHandler.RecordUpdateJobError(new SecurityUpdateNotFound(dependency.Name, dependency.Version!));
108
+ await apiHandler.RecordUpdateJobError(new SecurityUpdateNotFound(dependency.Name, dependency.Version!), logger);
109
109
  continue;
110
110
  }
111
111
 
@@ -115,7 +115,7 @@ internal class CreateSecurityUpdatePullRequestHandler : IUpdateHandler
115
115
  if (updaterResult.Error is not null)
116
116
  {
117
117
  logger.Error($"Error updating {dependency.Name} in {projectPath}: {updaterResult.Error.GetReport()}");
118
- await apiHandler.RecordUpdateJobError(updaterResult.Error);
118
+ await apiHandler.RecordUpdateJobError(updaterResult.Error, logger);
119
119
  continue;
120
120
  }
121
121
 
@@ -126,7 +126,7 @@ internal class CreateSecurityUpdatePullRequestHandler : IUpdateHandler
126
126
  if (!alreadyHandled)
127
127
  {
128
128
  logger.Error($"Update of {dependency.Name} in {projectPath} not possible.");
129
- await apiHandler.RecordUpdateJobError(new SecurityUpdateNotPossible(dependencyName, analysisResult.UpdatedVersion, analysisResult.UpdatedVersion, []));
129
+ await apiHandler.RecordUpdateJobError(new SecurityUpdateNotPossible(dependencyName, analysisResult.UpdatedVersion, analysisResult.UpdatedVersion, []), logger);
130
130
  return;
131
131
  }
132
132
  }
@@ -152,7 +152,7 @@ internal class CreateSecurityUpdatePullRequestHandler : IUpdateHandler
152
152
  var existingPullRequest = job.GetExistingPullRequestForDependencies(rawDependencies, considerVersions: true);
153
153
  if (existingPullRequest is not null)
154
154
  {
155
- await apiHandler.RecordUpdateJobError(new PullRequestExistsForSecurityUpdate(rawDependencies));
155
+ await apiHandler.RecordUpdateJobError(new PullRequestExistsForSecurityUpdate(rawDependencies), logger);
156
156
  continue;
157
157
  }
158
158
  }
@@ -76,7 +76,7 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
76
76
  logger.ReportDiscovery(discoveryResult);
77
77
  if (discoveryResult.Error is not null)
78
78
  {
79
- await apiHandler.RecordUpdateJobError(discoveryResult.Error);
79
+ await apiHandler.RecordUpdateJobError(discoveryResult.Error, logger);
80
80
  return;
81
81
  }
82
82
 
@@ -110,7 +110,7 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
110
110
  if (analysisResult.Error is not null)
111
111
  {
112
112
  logger.Error($"Error analyzing {dependency.Name} in {projectPath}: {analysisResult.Error.GetReport()}");
113
- await apiHandler.RecordUpdateJobError(analysisResult.Error);
113
+ await apiHandler.RecordUpdateJobError(analysisResult.Error, logger);
114
114
  return;
115
115
  }
116
116
 
@@ -125,7 +125,7 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
125
125
  if (updaterResult.Error is not null)
126
126
  {
127
127
  logger.Error($"Error updating {dependency.Name} in {projectPath}: {updaterResult.Error.GetReport()}");
128
- await apiHandler.RecordUpdateJobError(updaterResult.Error);
128
+ await apiHandler.RecordUpdateJobError(updaterResult.Error, logger);
129
129
  continue;
130
130
  }
131
131
 
@@ -179,7 +179,7 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
179
179
  logger.ReportDiscovery(discoveryResult);
180
180
  if (discoveryResult.Error is not null)
181
181
  {
182
- await apiHandler.RecordUpdateJobError(discoveryResult.Error);
182
+ await apiHandler.RecordUpdateJobError(discoveryResult.Error, logger);
183
183
  return;
184
184
  }
185
185
 
@@ -210,7 +210,7 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
210
210
  if (analysisResult.Error is not null)
211
211
  {
212
212
  logger.Error($"Error analyzing {dependency.Name} in {projectPath}: {analysisResult.Error.GetReport()}");
213
- await apiHandler.RecordUpdateJobError(analysisResult.Error);
213
+ await apiHandler.RecordUpdateJobError(analysisResult.Error, logger);
214
214
  return;
215
215
  }
216
216
 
@@ -224,7 +224,7 @@ internal class GroupUpdateAllVersionsHandler : IUpdateHandler
224
224
  var updaterResult = await updaterWorker.RunAsync(repoContentsPath.FullName, projectPath, dependency.Name, dependency.Version!, analysisResult.UpdatedVersion, dependency.IsTransitive);
225
225
  if (updaterResult.Error is not null)
226
226
  {
227
- await apiHandler.RecordUpdateJobError(updaterResult.Error);
227
+ await apiHandler.RecordUpdateJobError(updaterResult.Error, logger);
228
228
  continue;
229
229
  }
230
230
 
@@ -68,7 +68,7 @@ internal class RefreshGroupUpdatePullRequestHandler : IUpdateHandler
68
68
  logger.ReportDiscovery(discoveryResult);
69
69
  if (discoveryResult.Error is not null)
70
70
  {
71
- await apiHandler.RecordUpdateJobError(discoveryResult.Error);
71
+ await apiHandler.RecordUpdateJobError(discoveryResult.Error, logger);
72
72
  return;
73
73
  }
74
74
 
@@ -102,7 +102,7 @@ internal class RefreshGroupUpdatePullRequestHandler : IUpdateHandler
102
102
  if (analysisResult.Error is not null)
103
103
  {
104
104
  logger.Error($"Error analyzing {dependency.Name} in {projectPath}: {analysisResult.Error.GetReport()}");
105
- await apiHandler.RecordUpdateJobError(analysisResult.Error);
105
+ await apiHandler.RecordUpdateJobError(analysisResult.Error, logger);
106
106
  return;
107
107
  }
108
108
 
@@ -118,7 +118,7 @@ internal class RefreshGroupUpdatePullRequestHandler : IUpdateHandler
118
118
  if (updaterResult.Error is not null)
119
119
  {
120
120
  logger.Error($"Error updating {dependency.Name} in {projectPath}: {updaterResult.Error.GetReport()}");
121
- await apiHandler.RecordUpdateJobError(updaterResult.Error);
121
+ await apiHandler.RecordUpdateJobError(updaterResult.Error, logger);
122
122
  continue;
123
123
  }
124
124
 
@@ -37,7 +37,7 @@ internal class RefreshSecurityUpdatePullRequestHandler : IUpdateHandler
37
37
  if (discoveryResult.Error is not null)
38
38
  {
39
39
  logger.Error($"Reporting error: {discoveryResult.Error.GetReport()}");
40
- await apiHandler.RecordUpdateJobError(discoveryResult.Error);
40
+ await apiHandler.RecordUpdateJobError(discoveryResult.Error, logger);
41
41
  return;
42
42
  }
43
43
 
@@ -100,7 +100,7 @@ internal class RefreshSecurityUpdatePullRequestHandler : IUpdateHandler
100
100
  if (analysisResult.Error is not null)
101
101
  {
102
102
  logger.Error($"Error analyzing {dependency.Name} in {projectPath}: {analysisResult.Error.GetReport()}");
103
- await apiHandler.RecordUpdateJobError(analysisResult.Error);
103
+ await apiHandler.RecordUpdateJobError(analysisResult.Error, logger);
104
104
  return;
105
105
  }
106
106
 
@@ -116,7 +116,7 @@ internal class RefreshSecurityUpdatePullRequestHandler : IUpdateHandler
116
116
  if (updaterResult.Error is not null)
117
117
  {
118
118
  logger.Error($"Error updating {dependency.Name} in {projectPath}: {updaterResult.Error.GetReport()}");
119
- await apiHandler.RecordUpdateJobError(updaterResult.Error);
119
+ await apiHandler.RecordUpdateJobError(updaterResult.Error, logger);
120
120
  continue;
121
121
  }
122
122
 
@@ -36,7 +36,7 @@ internal class RefreshVersionUpdatePullRequestHandler : IUpdateHandler
36
36
  logger.ReportDiscovery(discoveryResult);
37
37
  if (discoveryResult.Error is not null)
38
38
  {
39
- await apiHandler.RecordUpdateJobError(discoveryResult.Error);
39
+ await apiHandler.RecordUpdateJobError(discoveryResult.Error, logger);
40
40
  return;
41
41
  }
42
42
 
@@ -90,7 +90,7 @@ internal class RefreshVersionUpdatePullRequestHandler : IUpdateHandler
90
90
  if (analysisResult.Error is not null)
91
91
  {
92
92
  logger.Error($"Error analyzing {dependency.Name} in {projectPath}: {analysisResult.Error.GetReport()}");
93
- await apiHandler.RecordUpdateJobError(analysisResult.Error);
93
+ await apiHandler.RecordUpdateJobError(analysisResult.Error, logger);
94
94
  return;
95
95
  }
96
96
 
@@ -106,7 +106,7 @@ internal class RefreshVersionUpdatePullRequestHandler : IUpdateHandler
106
106
  if (updaterResult.Error is not null)
107
107
  {
108
108
  logger.Error($"Error updating {dependency.Name} in {projectPath}: {updaterResult.Error.GetReport()}");
109
- await apiHandler.RecordUpdateJobError(updaterResult.Error);
109
+ await apiHandler.RecordUpdateJobError(updaterResult.Error, logger);
110
110
  continue;
111
111
  }
112
112
 
@@ -128,7 +128,7 @@ public class CloneWorkerTests
128
128
  // arrange
129
129
  var testApiHandler = new TestApiHandler();
130
130
  var testGitCommandHandler = new TestGitCommandHandler();
131
- var cloneWorker = new CloneWorker("JOB-ID", testApiHandler, testGitCommandHandler);
131
+ var cloneWorker = new CloneWorker("JOB-ID", testApiHandler, testGitCommandHandler, new TestLogger());
132
132
  using var testDirectory = new TemporaryDirectory();
133
133
  var jobFilePath = Path.Combine(testDirectory.DirectoryPath, "job.json");
134
134
  await File.WriteAllTextAsync(jobFilePath, "not json");
@@ -149,7 +149,7 @@ public class CloneWorkerTests
149
149
  // arrange
150
150
  var testApiHandler = new TestApiHandler();
151
151
  var testGitCommandHandler = new TestGitCommandHandler();
152
- var cloneWorker = new CloneWorker("JOB-ID", testApiHandler, testGitCommandHandler);
152
+ var cloneWorker = new CloneWorker("JOB-ID", testApiHandler, testGitCommandHandler, new TestLogger());
153
153
  using var testDirectory = new TemporaryDirectory();
154
154
  var jobFilePath = Path.Combine(testDirectory.DirectoryPath, "job.json");
155
155
 
@@ -221,7 +221,7 @@ public class CloneWorkerTests
221
221
  // arrange
222
222
  var testApiHandler = new TestApiHandler();
223
223
  testGitCommandHandler ??= new TestGitCommandHandler();
224
- var worker = new CloneWorker("TEST-JOB-ID", testApiHandler, testGitCommandHandler);
224
+ var worker = new CloneWorker("TEST-JOB-ID", testApiHandler, testGitCommandHandler, new TestLogger());
225
225
 
226
226
  // act
227
227
  var job = new Job()
@@ -117,7 +117,7 @@ public class HttpApiHandlerTests
117
117
  var handler = new HttpApiHandler(http.BaseUrl, "TEST-ID");
118
118
 
119
119
  // act
120
- await handler.RecordUpdateJobError(error);
120
+ await handler.RecordUpdateJobError(error, new TestLogger());
121
121
 
122
122
  // assert
123
123
  AssertEx.Equal(expectedEndpoints, actualEndpoints);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-nuget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.320.0
4
+ version: 0.320.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.320.0
18
+ version: 0.320.1
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.320.0
25
+ version: 0.320.1
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rubyzip
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -580,7 +580,7 @@ licenses:
580
580
  - MIT
581
581
  metadata:
582
582
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
583
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.320.0
583
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.320.1
584
584
  rdoc_options: []
585
585
  require_paths:
586
586
  - lib