dependabot-rust_toolchain 0.328.0 → 0.331.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: 23a023f76f1af824c52ce5e524d315143232bb4366a159ac0c91e5acf05dbaff
4
- data.tar.gz: 4f84cb53af1f32bc8c7b02fe919d259eba26f398645e68ecdfe8fe57463b3aea
3
+ metadata.gz: 2148ce002bc0aa6ca37b608b45ad445511f2873ced7746dedc2573d70d72c426
4
+ data.tar.gz: 14c98e7fbcaf63aaef5e0714c7c5536418ea865ed8d40d3981f40ed796326b93
5
5
  SHA512:
6
- metadata.gz: 58895d0554d951e087e2a888e6add7ec67dc3b0665987175ac42bb9cbbe89cdcd5edc4373872694dfda66cbbfaade8041373febd3eec95362abbc9a097db5d77
7
- data.tar.gz: 8e506993d4308aab1eefc6ffb9eb16f20e85506e44d45c2fe27175a2e6d815d1699e6f0f8e788f42577fa2a4fbc4271a9dbe5c2ce17be7305a6aaaa889193f44
6
+ metadata.gz: d0ea3f704001f6a27d8c298728f6258d6b0a8b608202fd4de0afedb90f8704b0b4a966f0562232b154dad0b7fec42f877f0a88d303d529d8d55e1e87f02f71a3
7
+ data.tar.gz: 486fbf3aecb8bfa033e186808368318662b95beeaf4d77e14b577ef93614b49a38f60df552e0a466840d64b31559f36cf2b60fb9c98a6ce05eb34bf629de5219
@@ -59,32 +59,12 @@ module Dependabot
59
59
  current_channel = current_version.channel
60
60
  return [] unless current_channel
61
61
 
62
- current_type = current_channel.channel_type
63
-
64
- # There are no updates for channels
65
- # i.e. "stable", "beta", "nightly"
66
- return [] if current_type == ChannelType::Stability
62
+ return [] if stability_channel_without_updates?(current_channel)
67
63
 
68
64
  is_current_major_minor = major_minor_format?(current_version.to_s)
69
65
 
70
- channel_matched_releases = releases.filter_map do |release|
71
- release_rust_version = T.cast(release.version, Dependabot::RustToolchain::Version)
72
- release_channel = release_rust_version.channel
73
- next unless release_channel
74
-
75
- # Check that the release version is in the same channel type
76
- next unless release_channel.channel_type == current_type
77
-
78
- next release unless release_channel.channel_type == ChannelType::Version
79
-
80
- # For version channels, we need to ensure that the version format matches
81
- is_release_major_minor = major_minor_format?(release_rust_version.to_s)
82
- case [is_current_major_minor, is_release_major_minor]
83
- in [true, true] | [false, false]
84
- release
85
- else
86
- nil
87
- end
66
+ channel_matched_releases = releases.select do |release|
67
+ compatible_release?(release, current_channel, is_current_major_minor)
88
68
  end
89
69
 
90
70
  channel_matched_releases.uniq do |release|
@@ -92,6 +72,60 @@ module Dependabot
92
72
  end
93
73
  end
94
74
 
75
+ sig { params(channel: T.untyped).returns(T::Boolean) }
76
+ def stability_channel_without_updates?(channel)
77
+ channel.channel_type == ChannelType::Stability
78
+ end
79
+
80
+ sig do
81
+ params(
82
+ release: Dependabot::Package::PackageRelease,
83
+ current_channel: T.untyped,
84
+ is_current_major_minor: T::Boolean
85
+ )
86
+ .returns(T::Boolean)
87
+ end
88
+ def compatible_release?(release, current_channel, is_current_major_minor)
89
+ release_rust_version = T.cast(release.version, Dependabot::RustToolchain::Version)
90
+ release_channel = release_rust_version.channel
91
+ return false unless release_channel
92
+
93
+ return false unless matching_channel_type?(release_channel, current_channel)
94
+ return false unless matching_dated_stability?(release_channel, current_channel)
95
+ return true unless version_channel?(release_channel)
96
+
97
+ matching_version_format?(release_rust_version, is_current_major_minor)
98
+ end
99
+
100
+ sig { params(release_channel: T.untyped, current_channel: T.untyped).returns(T::Boolean) }
101
+ def matching_channel_type?(release_channel, current_channel)
102
+ release_channel.channel_type == current_channel.channel_type
103
+ end
104
+
105
+ sig { params(release_channel: T.untyped, current_channel: T.untyped).returns(T::Boolean) }
106
+ def matching_dated_stability?(release_channel, current_channel)
107
+ return true unless current_channel.channel_type == ChannelType::DatedStability
108
+
109
+ release_channel.stability == current_channel.stability
110
+ end
111
+
112
+ sig { params(channel: T.untyped).returns(T::Boolean) }
113
+ def version_channel?(channel)
114
+ channel.channel_type == ChannelType::Version
115
+ end
116
+
117
+ sig do
118
+ params(
119
+ release_version: Dependabot::RustToolchain::Version,
120
+ is_current_major_minor: T::Boolean
121
+ )
122
+ .returns(T::Boolean)
123
+ end
124
+ def matching_version_format?(release_version, is_current_major_minor)
125
+ is_release_major_minor = major_minor_format?(release_version.to_s)
126
+ is_current_major_minor == is_release_major_minor
127
+ end
128
+
95
129
  # Check if a version string is in major.minor format (e.g., "1.72" vs "1.72.0")
96
130
  sig { params(version_string: String).returns(T::Boolean) }
97
131
  def major_minor_format?(version_string)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-rust_toolchain
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.328.0
4
+ version: 0.331.0
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.328.0
18
+ version: 0.331.0
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.328.0
25
+ version: 0.331.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: debug
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -259,7 +259,7 @@ licenses:
259
259
  - MIT
260
260
  metadata:
261
261
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
262
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.328.0
262
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.331.0
263
263
  rdoc_options: []
264
264
  require_paths:
265
265
  - lib