dependabot-common 0.394.0 → 0.395.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: 56fd73092967bcc3c61c5380d818f4802319503d4ef71fe825cc0433e928e6a9
4
- data.tar.gz: c2d55c57dc9a06af239f6f2797c65df21837495afa5c00da8435a0810fd8af30
3
+ metadata.gz: d9566b1a9930f4b53e02d88a9eda5893f794bcd80b37c0a82870dab926432fba
4
+ data.tar.gz: 77aa3094407df4ef7627a53cb584abd0cf1b14a16e690b3ee178c8600dad2dd7
5
5
  SHA512:
6
- metadata.gz: 9051406a2bb191fc74abe230325d756939a54c84588c78c55ddc44e2a03452e2c57952cb8791f1b2f5f3cdfe9317fbabb01aa4ac00da1be8a30d2274bae835eb
7
- data.tar.gz: e11299a8ef1eea997446cc50ea216a0615c54875a7a34ce5482f001be1bf038e0700fba9b5e3425aa6d931da753fac54c48f782365755006310651487cfff192
6
+ metadata.gz: f994b68adbb197b61dfa48006b35b8cd39058d5b482393aa2c56993b86958c32364d7e6869b31b068a8fbc85375883eb33110abd9f5fdc254aff940ae4d98c51
7
+ data.tar.gz: f5bba21d3f012e715c1918f161ce077d1d9f2a0b2ca681e90fd87d9b321d096b710f98902f1ece9e1814c2cdb16d8b89fb68f0d7670aab3b7630e68acaa0cd9c
@@ -8,7 +8,7 @@ require "sorbet-runtime"
8
8
 
9
9
  module Dependabot
10
10
  module Clients
11
- # rubocop:disable Metrics/ClassLength
11
+ # rubocop:disable-next Metrics/ClassLength
12
12
  class Azure
13
13
  extend T::Sig
14
14
  include JsonResponseParser
@@ -550,6 +550,5 @@ module Dependabot
550
550
  sig { returns(Dependabot::Source) }
551
551
  attr_reader :source
552
552
  end
553
- # rubocop:enable Metrics/ClassLength
554
553
  end
555
554
  end
@@ -11,7 +11,7 @@ module Dependabot
11
11
 
12
12
  module TIMEOUTS
13
13
  NO_TIME_OUT = -1 # No timeout
14
- GRARECFULLY_STOP = 5 # 5 seconds for graceful termination
14
+ GRACEFULLY_STOP = 5 # 5 seconds for graceful termination
15
15
  LOCAL = 30 # 30 seconds
16
16
  NETWORK = 120 # 2 minutes
17
17
  LONG_RUNNING = 300 # 5 minutes
@@ -185,8 +185,8 @@ module Dependabot
185
185
  if observation&.dig(:gracefully_stop)
186
186
  message = observation[:reason] || "Terminated by output_observer"
187
187
  # If the observer indicates a graceful stop, terminate the process
188
- # by adjusting the remaining timeout 5 seconds
189
- timeout = [timeout, ((Time.now - last_output_time) + 5).to_i].min
188
+ # by adjusting the remaining timeout
189
+ timeout = [timeout, ((Time.now - last_output_time) + TIMEOUTS::GRACEFULLY_STOP).to_i].min
190
190
  Dependabot.logger.warn("Terminating process due to observer signal: #{message}")
191
191
  end
192
192
  rescue EOFError
@@ -5,7 +5,7 @@ require "sorbet-runtime"
5
5
  require "dependabot/error_details"
6
6
  require "dependabot/utils"
7
7
 
8
- # rubocop:disable Metrics/ModuleLength
8
+ # rubocop:disable-next Metrics/ModuleLength
9
9
  module Dependabot
10
10
  extend T::Sig
11
11
 
@@ -1010,4 +1010,3 @@ module Dependabot
1010
1010
  end
1011
1011
  end
1012
1012
  end
1013
- # rubocop:enable Metrics/ModuleLength
@@ -16,7 +16,7 @@ require "dependabot/clients/bitbucket_with_retries"
16
16
  require "dependabot/clients/gitlab_with_retries"
17
17
  require "dependabot/shared_helpers"
18
18
 
19
- # rubocop:disable Metrics/ClassLength
19
+ # rubocop:disable-next Metrics/ClassLength
20
20
  module Dependabot
21
21
  module FileFetchers
22
22
  class RepositoryContent < T::ImmutableStruct
@@ -1030,4 +1030,3 @@ module Dependabot
1030
1030
  end
1031
1031
  end
1032
1032
  end
1033
- # rubocop:enable Metrics/ClassLength
@@ -36,9 +36,8 @@ module Dependabot
36
36
  return [] unless repo_contents_path && target_directory
37
37
 
38
38
  Dir.chdir(T.must(repo_contents_path)) do
39
- # rubocop:disable Performance/DeletePrefix
39
+ # rubocop:disable-next Performance/DeletePrefix
40
40
  relative_dir = Pathname.new(base_directory).sub(%r{\A/}, "").join(T.must(target_directory))
41
- # rubocop:enable Performance/DeletePrefix
42
41
 
43
42
  status = T.let(
44
43
  SharedHelpers.run_shell_command(
@@ -23,7 +23,7 @@ require "dependabot/package/release_cooldown_options"
23
23
  require "dependabot/update_checkers/cooldown_calculation"
24
24
  require "dependabot/git_cooldown_date_resolver"
25
25
  module Dependabot
26
- # rubocop:disable Metrics/ClassLength
26
+ # rubocop:disable-next Metrics/ClassLength
27
27
  class GitCommitChecker
28
28
  extend T::Sig
29
29
  include Dependabot::GitCooldownDateResolver
@@ -265,6 +265,7 @@ module Dependabot
265
265
 
266
266
  sig { returns(T.nilable(String)) }
267
267
  def local_tag_for_pinned_sha
268
+ return @local_tag_for_pinned_sha if defined?(@local_tag_for_pinned_sha)
268
269
  return unless pinned_ref_looks_like_commit_sha?
269
270
 
270
271
  @local_tag_for_pinned_sha = T.let(
@@ -957,5 +958,4 @@ module Dependabot
957
958
  SourceDetails.from_hash(details) if details
958
959
  end
959
960
  end
960
- # rubocop:enable Metrics/ClassLength
961
961
  end
@@ -24,7 +24,7 @@ module Dependabot
24
24
  const :api_url, T.nilable(String), default: nil
25
25
  end
26
26
 
27
- # rubocop:disable Metrics/ClassLength
27
+ # rubocop:disable-next Metrics/ClassLength
28
28
  class ChangelogFinder
29
29
  extend T::Sig
30
30
 
@@ -653,7 +653,6 @@ module Dependabot
653
653
  )
654
654
  end
655
655
  end
656
- # rubocop:enable Metrics/ClassLength
657
656
  end
658
657
  end
659
658
  end
@@ -132,8 +132,17 @@ module Dependabot
132
132
  type: type,
133
133
  git: type == "git"
134
134
  )
135
+ when Array
136
+ repositories = T.let([], T::Array[Repository])
137
+ value.each do |raw_repository|
138
+ repository_value = T.cast(raw_repository, Object)
139
+ parsed_repository = parse_repository(repository_value, version)
140
+ repositories << parsed_repository if parsed_repository
141
+ end
142
+
143
+ repositories.find(&:git?) || repositories.first
135
144
  else
136
- raise TypeError, "version #{version} repository must be a string or object"
145
+ raise TypeError, "version #{version} repository must be a string, object, or array"
137
146
  end
138
147
  end
139
148
  private_class_method :parse_repository
@@ -12,7 +12,7 @@ require "dependabot/pull_request_creator/commit_signer"
12
12
 
13
13
  module Dependabot
14
14
  class PullRequestCreator
15
- # rubocop:disable Metrics/ClassLength
15
+ # rubocop:disable-next Metrics/ClassLength
16
16
  class Github
17
17
  extend T::Sig
18
18
  include Dependabot::Clients::GithubResourceParser
@@ -634,6 +634,5 @@ module Dependabot
634
634
  end
635
635
  end
636
636
  end
637
- # rubocop:enable Metrics/ClassLength
638
637
  end
639
638
  end
@@ -9,7 +9,7 @@ require "dependabot/credential"
9
9
 
10
10
  module Dependabot
11
11
  class PullRequestCreator
12
- # rubocop:disable Metrics/ClassLength
12
+ # rubocop:disable-next Metrics/ClassLength
13
13
  class Labeler
14
14
  extend T::Sig
15
15
 
@@ -155,9 +155,8 @@ module Dependabot
155
155
  new_version_parts = T.must(version(dep)).split(/[.+]/)
156
156
  old_version_parts = previous_version(dep)&.split(/[.+]/) || []
157
157
  all_parts = new_version_parts.first(3) + old_version_parts.first(3)
158
- # rubocop:disable Performance/RedundantEqualityComparisonBlock
158
+ # rubocop:disable-next Performance/RedundantEqualityComparisonBlock
159
159
  next 0 unless all_parts.all? { |part| part.to_i.to_s == part }
160
- # rubocop:enable Performance/RedundantEqualityComparisonBlock
161
160
  next 1 if new_version_parts[0] != old_version_parts[0]
162
161
  next 2 if new_version_parts[1] != old_version_parts[1]
163
162
 
@@ -556,6 +555,5 @@ module Dependabot
556
555
  Utils.version_class_for_package_manager(package_manager)
557
556
  end
558
557
  end
559
- # rubocop:enable Metrics/ClassLength
560
558
  end
561
559
  end
@@ -14,7 +14,7 @@ require "dependabot/pull_request_creator"
14
14
  require "dependabot/pull_request_creator/message"
15
15
  require "dependabot/notices"
16
16
 
17
- # rubocop:disable Metrics/ClassLength
17
+ # rubocop:disable-next Metrics/ClassLength
18
18
  module Dependabot
19
19
  class PullRequestCreator
20
20
  # MessageBuilder builds PR message for a dependency update
@@ -976,4 +976,3 @@ module Dependabot
976
976
  end
977
977
  end
978
978
  end
979
- # rubocop:enable Metrics/ClassLength
data/lib/dependabot.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Dependabot
5
- VERSION = "0.394.0"
5
+ VERSION = "0.395.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.394.0
4
+ version: 0.395.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.20'
150
+ version: '2.22'
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.20'
157
+ version: '2.22'
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: nokogiri
160
160
  requirement: !ruby/object:Gem::Requirement
@@ -450,19 +450,19 @@ dependencies:
450
450
  - !ruby/object:Gem::Version
451
451
  version: '1.1'
452
452
  - !ruby/object:Gem::Dependency
453
- name: turbo_tests
453
+ name: turbo_tests2
454
454
  requirement: !ruby/object:Gem::Requirement
455
455
  requirements:
456
456
  - - "~>"
457
457
  - !ruby/object:Gem::Version
458
- version: 2.2.5
458
+ version: 3.2.7
459
459
  type: :development
460
460
  prerelease: false
461
461
  version_requirements: !ruby/object:Gem::Requirement
462
462
  requirements:
463
463
  - - "~>"
464
464
  - !ruby/object:Gem::Version
465
- version: 2.2.5
465
+ version: 3.2.7
466
466
  - !ruby/object:Gem::Dependency
467
467
  name: vcr
468
468
  requirement: !ruby/object:Gem::Requirement
@@ -631,7 +631,7 @@ licenses:
631
631
  - MIT
632
632
  metadata:
633
633
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
634
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.394.0
634
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.395.0
635
635
  rdoc_options: []
636
636
  require_paths:
637
637
  - lib