dependabot-common 0.253.0 → 0.254.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: e33e7c4c1aa5bd36b0efa81b3a427012da0bfe76036df7d3ab232f7ef22ad6fa
4
- data.tar.gz: 73d202071035da3cc4c3b81dd69b740dc10ee1acb0f03d47daca39f8a483d07a
3
+ metadata.gz: cf205c21f19217f308e953e1e19e56366b4ae2235a6cb105f0b0c96a45654693
4
+ data.tar.gz: '058f62ee7de2253b6eb44011a7bbbf8da613ca2f8e98c393229093ac75d23e98'
5
5
  SHA512:
6
- metadata.gz: ae1bd08cf3fb1a9a2cbcfee3128655310a114aa4f1525716efcf330aea9ddcc3ae6d25186e1129a4ce3f399827accad03c8ce1848d8bf137c390f1c53d1ff947
7
- data.tar.gz: ee68112308238c31e141af0eca5097df87d957e7f733f76034cb407aab6589c79e1f2fa2575a4798dbbcf7f0878128bb5dd6853e7998603589c449a77347663a
6
+ metadata.gz: 972a03d3e7e8cac3368c7379edccef965578d0528c9a5bd9668a16af6e96ad15af8f8dbf251b2883c83cac98aa12fd933f87bbaf46ec85c0cc6868ca35706ebd
7
+ data.tar.gz: c304a257424d6c8f2dc6dafd3922214406a019b586458085f330a3c87d4851fac2a48744abfb658ed0891e3abb22ea66d71db714f9dca96bfa05875c7662e882
@@ -176,7 +176,7 @@ module Dependabot
176
176
  base_commit: String,
177
177
  commit_message: String,
178
178
  files: T::Array[Dependabot::DependencyFile],
179
- author_details: T.nilable(T::Hash[String, String])
179
+ author_details: T.nilable(T::Hash[Symbol, String])
180
180
  )
181
181
  .returns(T.untyped)
182
182
  end
@@ -246,7 +246,7 @@ module Dependabot
246
246
  sig do
247
247
  params(
248
248
  branch_name: String,
249
- author_name: String,
249
+ author_name: T.nilable(String),
250
250
  base_commit: String,
251
251
  commit_message: String,
252
252
  files: T::Array[Dependabot::DependencyFile]
@@ -53,6 +53,8 @@ module Dependabot
53
53
  @dependency = dependency
54
54
  @credentials = credentials
55
55
  @suggested_changelog_url = suggested_changelog_url
56
+ # strip fragment from URL, if present
57
+ @suggested_changelog_url = @suggested_changelog_url&.split("#")&.first
56
58
 
57
59
  @new_version = T.let(nil, T.nilable(String))
58
60
  @changelog_from_suggested_url = T.let(nil, T.untyped)
@@ -127,16 +129,7 @@ module Dependabot
127
129
  suggested_source_client = github_client_for_source(T.must(suggested_source))
128
130
  tmp_files = T.unsafe(suggested_source_client).contents(suggested_source&.repo, opts)
129
131
 
130
- filename = T.must(T.must(suggested_changelog_url).split("/").last).split("#").first
131
-
132
- # If the suggested source points to a specific directory
133
- # then we will receive a hash for just the changelog file
134
- if suggested_source&.directory && tmp_files[:name] == filename
135
- return @changelog_from_suggested_url = tmp_files
136
- end
137
-
138
- # Otherwise we will get back an array of hashes representing the files
139
- # in the root directory and we need to find the changelog
132
+ filename = T.must(T.must(suggested_changelog_url).split("/").last)
140
133
  @changelog_from_suggested_url =
141
134
  tmp_files.find { |f| f.name == filename }
142
135
  rescue Octokit::NotFound, Octokit::UnavailableForLegalReasons
@@ -1,4 +1,4 @@
1
- # typed: strict
1
+ # typed: strong
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "sorbet-runtime"
@@ -1,4 +1,4 @@
1
- # typed: strict
1
+ # typed: strong
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "sorbet-runtime"
@@ -134,7 +134,7 @@ module Dependabot
134
134
  base_commit,
135
135
  commit_message,
136
136
  files,
137
- author
137
+ T.must(author)
138
138
  )
139
139
  end
140
140
 
@@ -197,12 +197,11 @@ module Dependabot
197
197
 
198
198
  sig { void }
199
199
  def create_commit
200
- author = author_details&.slice(:name, :email, :date)
201
- author = nil unless author&.any?
200
+ author_name = author_details&.fetch(:name)
202
201
 
203
202
  codecommit_client_for_source.create_commit(
204
203
  branch_name,
205
- author,
204
+ author_name,
206
205
  base_commit,
207
206
  commit_message,
208
207
  files
@@ -1,6 +1,7 @@
1
1
  # typed: strict
2
2
  # frozen_string_literal: true
3
3
 
4
+ require "time"
4
5
  require "pathname"
5
6
  require "sorbet-runtime"
6
7
 
@@ -126,7 +127,7 @@ module Dependabot
126
127
 
127
128
  truncate_pr_message(msg)
128
129
  rescue StandardError => e
129
- Dependabot.logger.error("Error while generating PR message: #{e.message}")
130
+ suppress_error("PR message", e)
130
131
  suffixed_pr_message_header + prefixed_pr_message_footer
131
132
  end
132
133
 
@@ -161,7 +162,7 @@ module Dependabot
161
162
  message += "\n\n" + T.must(message_trailers) if message_trailers
162
163
  message
163
164
  rescue StandardError => e
164
- Dependabot.logger.error("Error while generating commit message: #{e.message}")
165
+ suppress_error("commit message", e)
165
166
  message = commit_subject
166
167
  message += "\n\n" + T.must(message_trailers) if message_trailers
167
168
  message
@@ -275,7 +276,7 @@ module Dependabot
275
276
  def pr_name_prefix
276
277
  pr_name_prefixer.pr_name_prefix
277
278
  rescue StandardError => e
278
- Dependabot.logger.error("Error while generating PR name: #{e.message}")
279
+ suppress_error("PR name", e)
279
280
  ""
280
281
  end
281
282
 
@@ -735,9 +736,9 @@ module Dependabot
735
736
  # Return an empty string if no valid ignore conditions after filtering
736
737
  return "" if valid_ignore_conditions.empty?
737
738
 
738
- # Sort them by updated_at (or created_at if updated_at is nil), taking the latest 20
739
+ # Sort them by updated_at, taking the latest 20
739
740
  sorted_ignore_conditions = valid_ignore_conditions.sort_by do |ic|
740
- ic["updated_at"].nil? ? T.must(ic["created_at"]) : T.must(ic["updated_at"])
741
+ ic["updated-at"].nil? ? Time.at(0).iso8601 : T.must(ic["updated-at"])
741
742
  end.last(20)
742
743
 
743
744
  # Map each condition to a row string
@@ -883,6 +884,12 @@ module Dependabot
883
884
  T.nilable(String)
884
885
  )
885
886
  end
887
+
888
+ sig { params(method: String, err: StandardError).void }
889
+ def suppress_error(method, err)
890
+ Dependabot.logger.error("Error while generating #{method}: #{err.message}")
891
+ Dependabot.logger.error(err.backtrace&.join("\n"))
892
+ end
886
893
  end
887
894
  end
888
895
  end
data/lib/dependabot.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Dependabot
5
- VERSION = "0.253.0"
5
+ VERSION = "0.254.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.253.0
4
+ version: 0.254.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-04-18 00:00:00.000000000 Z
11
+ date: 2024-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-codecommit
@@ -298,14 +298,14 @@ dependencies:
298
298
  requirements:
299
299
  - - "~>"
300
300
  - !ruby/object:Gem::Version
301
- version: 1.8.0
301
+ version: 1.9.2
302
302
  type: :development
303
303
  prerelease: false
304
304
  version_requirements: !ruby/object:Gem::Requirement
305
305
  requirements:
306
306
  - - "~>"
307
307
  - !ruby/object:Gem::Version
308
- version: 1.8.0
308
+ version: 1.9.2
309
309
  - !ruby/object:Gem::Dependency
310
310
  name: gpgme
311
311
  requirement: !ruby/object:Gem::Requirement
@@ -382,56 +382,56 @@ dependencies:
382
382
  requirements:
383
383
  - - "~>"
384
384
  - !ruby/object:Gem::Version
385
- version: 1.58.0
385
+ version: 1.63.2
386
386
  type: :development
387
387
  prerelease: false
388
388
  version_requirements: !ruby/object:Gem::Requirement
389
389
  requirements:
390
390
  - - "~>"
391
391
  - !ruby/object:Gem::Version
392
- version: 1.58.0
392
+ version: 1.63.2
393
393
  - !ruby/object:Gem::Dependency
394
394
  name: rubocop-performance
395
395
  requirement: !ruby/object:Gem::Requirement
396
396
  requirements:
397
397
  - - "~>"
398
398
  - !ruby/object:Gem::Version
399
- version: 1.19.0
399
+ version: 1.21.0
400
400
  type: :development
401
401
  prerelease: false
402
402
  version_requirements: !ruby/object:Gem::Requirement
403
403
  requirements:
404
404
  - - "~>"
405
405
  - !ruby/object:Gem::Version
406
- version: 1.19.0
406
+ version: 1.21.0
407
407
  - !ruby/object:Gem::Dependency
408
408
  name: rubocop-rspec
409
409
  requirement: !ruby/object:Gem::Requirement
410
410
  requirements:
411
411
  - - "~>"
412
412
  - !ruby/object:Gem::Version
413
- version: 2.27.1
413
+ version: 2.29.1
414
414
  type: :development
415
415
  prerelease: false
416
416
  version_requirements: !ruby/object:Gem::Requirement
417
417
  requirements:
418
418
  - - "~>"
419
419
  - !ruby/object:Gem::Version
420
- version: 2.27.1
420
+ version: 2.29.1
421
421
  - !ruby/object:Gem::Dependency
422
422
  name: rubocop-sorbet
423
423
  requirement: !ruby/object:Gem::Requirement
424
424
  requirements:
425
425
  - - "~>"
426
426
  - !ruby/object:Gem::Version
427
- version: 0.7.3
427
+ version: 0.8.1
428
428
  type: :development
429
429
  prerelease: false
430
430
  version_requirements: !ruby/object:Gem::Requirement
431
431
  requirements:
432
432
  - - "~>"
433
433
  - !ruby/object:Gem::Version
434
- version: 0.7.3
434
+ version: 0.8.1
435
435
  - !ruby/object:Gem::Dependency
436
436
  name: turbo_tests
437
437
  requirement: !ruby/object:Gem::Requirement
@@ -583,7 +583,7 @@ licenses:
583
583
  - Nonstandard
584
584
  metadata:
585
585
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
586
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.253.0
586
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.254.0
587
587
  post_install_message:
588
588
  rdoc_options: []
589
589
  require_paths: