dependabot-go_modules 0.287.0 → 0.288.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: e17c95675b770b60d44e3296b0ced8d6e4e74a22f9b4e264d96331f4d6c6066e
4
- data.tar.gz: 1a18f8998dbbbf023607e93b9e851e5d948f506e68c8f7741f20822a9c3962f9
3
+ metadata.gz: b267cabad46955a645484485605bf621d6561c247b8bddab7c052e53b331a41b
4
+ data.tar.gz: 6a8205ace0d3cf167c9154911d964edebe68fb15f0def3618df42bbb1419134e
5
5
  SHA512:
6
- metadata.gz: 1ee3f7c954aa84740562c1d4dede902c9ac3a3a29a7d3b8be212f964fcb78c70af62b8719a141f0ff6303802a81a1cd60d682c4b94c663952adb557a7e658acc
7
- data.tar.gz: 16c1e9e0eb93b13ee31c958a321e8e1179d9e8d09eb541513b4a31ad0d7243df8c6984e5167062dc9cd55b8499ca8b1163242e277bc1d7d07b8f351779f1d8aa
6
+ metadata.gz: ed4c18e0ba2c17be27172eeda96ca31cdfb037fc4c29ad99d61be823a28302b864239bb884f10e631c008ca3d3025bbb4f8990be506e48f993bb44d5f91764f1
7
+ data.tar.gz: bb088cba1d36502c75291a1918755923e8d77e39dc0dd943d0ff0d03501634d60434cd5ca472314021d7fa7d2c3e81e926170e8b7702a0f37f7574e6a4ffe6e9
@@ -12,6 +12,8 @@ require "dependabot/errors"
12
12
  require "dependabot/file_parsers"
13
13
  require "dependabot/file_parsers/base"
14
14
  require "dependabot/go_modules/version"
15
+ require "dependabot/go_modules/language"
16
+ require "dependabot/go_modules/package_manager"
15
17
 
16
18
  module Dependabot
17
19
  module GoModules
@@ -31,8 +33,50 @@ module Dependabot
31
33
  dependency_set.dependencies
32
34
  end
33
35
 
36
+ sig { returns(Ecosystem) }
37
+ def ecosystem
38
+ @ecosystem ||= T.let(begin
39
+ set_gotoolchain_env
40
+ Ecosystem.new(
41
+ name: ECOSYSTEM,
42
+ package_manager: package_manager,
43
+ language: language
44
+ )
45
+ end, T.nilable(Dependabot::Ecosystem))
46
+ end
47
+
34
48
  private
35
49
 
50
+ sig { returns(Ecosystem::VersionManager) }
51
+ def package_manager
52
+ @package_manager ||= T.let(
53
+ PackageManager.new(T.must(go_toolchain_version)),
54
+ T.nilable(Dependabot::GoModules::PackageManager)
55
+ )
56
+ end
57
+
58
+ sig { returns(T.nilable(Ecosystem::VersionManager)) }
59
+ def language
60
+ @language ||= T.let(begin
61
+ Language.new(go_version)
62
+ end, T.nilable(Dependabot::GoModules::Language))
63
+ end
64
+
65
+ sig { returns(String) }
66
+ def go_version
67
+ @go_version ||= T.let(T.must(go_mod&.content&.match(/^go\s(\d+\.\d+(.\d+)*)/)&.captures&.first),
68
+ T.nilable(String))
69
+ end
70
+
71
+ sig { returns(T.nilable(String)) }
72
+ def go_toolchain_version
73
+ @go_toolchain_version ||= T.let(begin
74
+ # Checks version based on the GOTOOLCHAIN in ENV
75
+ version = SharedHelpers.run_shell_command("go version")
76
+ version.match(/go\s*(\d+\.\d+(.\d+)*)/)&.captures&.first
77
+ end, T.nilable(String))
78
+ end
79
+
36
80
  # set GOTOOLCHAIN=local+auto if go version >= 1.21
37
81
  sig { void }
38
82
  def set_gotoolchain_env
@@ -0,0 +1,25 @@
1
+ # typed: strong
2
+ # frozen_string_literal: true
3
+
4
+ require "sorbet-runtime"
5
+ require "dependabot/ecosystem"
6
+ require "dependabot/go_modules/version"
7
+ require "dependabot/go_modules/requirement"
8
+
9
+ module Dependabot
10
+ module GoModules
11
+ LANGUAGE = "go"
12
+
13
+ class Language < Dependabot::Ecosystem::VersionManager
14
+ extend T::Sig
15
+
16
+ sig { params(raw_version: String).void }
17
+ def initialize(raw_version)
18
+ super(
19
+ LANGUAGE,
20
+ Version.new(raw_version)
21
+ )
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,42 @@
1
+ # typed: strong
2
+ # frozen_string_literal: true
3
+
4
+ require "sorbet-runtime"
5
+ require "dependabot/ecosystem"
6
+ require "dependabot/go_modules/version"
7
+ require "dependabot/go_modules/requirement"
8
+
9
+ module Dependabot
10
+ module GoModules
11
+ ECOSYSTEM = "go"
12
+ PACKAGE_MANAGER = "go_modules"
13
+ SUPPORTED_GO_VERSIONS = T.let([].freeze, T::Array[Dependabot::Version])
14
+
15
+ # When a version is going to be unsupported, it will be added here
16
+ DEPRECATED_GO_VERSIONS = T.let([].freeze, T::Array[Dependabot::Version])
17
+
18
+ class PackageManager < Dependabot::Ecosystem::VersionManager
19
+ extend T::Sig
20
+
21
+ sig { params(raw_version: String).void }
22
+ def initialize(raw_version)
23
+ super(
24
+ PACKAGE_MANAGER,
25
+ Version.new(raw_version),
26
+ DEPRECATED_GO_VERSIONS,
27
+ SUPPORTED_GO_VERSIONS
28
+ )
29
+ end
30
+
31
+ sig { returns(T::Boolean) }
32
+ def deprecated?
33
+ false
34
+ end
35
+
36
+ sig { returns(T::Boolean) }
37
+ def unsupported?
38
+ false
39
+ end
40
+ end
41
+ end
42
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-go_modules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.287.0
4
+ version: 0.288.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-11-19 00:00:00.000000000 Z
11
+ date: 2024-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dependabot-common
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.287.0
19
+ version: 0.288.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.287.0
26
+ version: 0.288.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -254,8 +254,10 @@ files:
254
254
  - lib/dependabot/go_modules/file_parser.rb
255
255
  - lib/dependabot/go_modules/file_updater.rb
256
256
  - lib/dependabot/go_modules/file_updater/go_mod_updater.rb
257
+ - lib/dependabot/go_modules/language.rb
257
258
  - lib/dependabot/go_modules/metadata_finder.rb
258
259
  - lib/dependabot/go_modules/native_helpers.rb
260
+ - lib/dependabot/go_modules/package_manager.rb
259
261
  - lib/dependabot/go_modules/path_converter.rb
260
262
  - lib/dependabot/go_modules/replace_stubber.rb
261
263
  - lib/dependabot/go_modules/requirement.rb
@@ -268,7 +270,7 @@ licenses:
268
270
  - MIT
269
271
  metadata:
270
272
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
271
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.287.0
273
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.288.0
272
274
  post_install_message:
273
275
  rdoc_options: []
274
276
  require_paths: