dependabot-go_modules 0.95.25 → 0.95.26

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: 59ec76e75b74a62b20d96ed119fd443443a3f1ac0740e3e27deb9c34694638da
4
- data.tar.gz: 8d770eb582770df000d04fb3303581a7267c28b44b75d8a070f91b07307fb312
3
+ metadata.gz: d54e469ee31cc468868cfa5b743ac1d2b6df2ad6e2af37a603bf66661aff2b35
4
+ data.tar.gz: 9c9179464611bc65b40d0791ad587608b51ff53472e796ce4aa393389c9832f4
5
5
  SHA512:
6
- metadata.gz: a361222fc3547f64e34fc7c68a25d9b11344c40f0f001ef612285e947508b97aa05c76a3386cbc80485423c974561b17b7c64d43849d9af942d3c7a4d5c91df5
7
- data.tar.gz: 06c92db8c9a0a51a8154cc4d653948b72166fa8b79f408469bebe0a4c1839f8b6da41a635321998d821c797f2737049b5a366a41b843abe5b2100467725b76b1
6
+ metadata.gz: 984a513f7e6c7bf1fd5760c68d3503f8b8dd1625d4b95ea28227eb6b7e7a87f3dfbb15c64ddac5099f0722fb23f23901b717b782d68ec5749a80abc7ac5fc1a1
7
+ data.tar.gz: 9db5a2b3d466af33e4e6617f40519809c62137ea719eea615525dc29b4af1bc1afa018b724d3bf1b932ca1b5ed5e77faf7985d1062ee2c81918686f811a0e2b8
@@ -88,6 +88,7 @@ module Dependabot
88
88
  end
89
89
  end
90
90
 
91
+ # rubocop:disable Metrics/AbcSize
91
92
  def handle_parser_error(path, stderr)
92
93
  case stderr
93
94
  when /go: .*: unknown revision/
@@ -99,11 +100,17 @@ module Dependabot
99
100
  when /go: errors parsing go.mod/
100
101
  msg = stderr.gsub(path.to_s, "").strip
101
102
  raise Dependabot::DependencyFileNotParseable.new(go_mod.path, msg)
103
+ when /go: finding .*/
104
+ msg = stderr.lines.grep(/go: finding/).first.strip
105
+ match = /go: finding (?<require>\S+)/.match(msg)
106
+ msg = "could not resolve dependency #{match[:require]}" if match
107
+ raise Dependabot::DependencyFileNotResolvable.new, msg
102
108
  else
103
109
  msg = stderr.gsub(path.to_s, "").strip
104
110
  raise Dependabot::DependencyFileNotParseable.new(go_mod.path, msg)
105
111
  end
106
112
  end
113
+ # rubocop:enable Metrics/AbcSize
107
114
 
108
115
  def rev_identifier?(dep)
109
116
  dep["Version"]&.match?(GIT_VERSION_REGEX)
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "dependabot/shared_helpers"
4
+ require "dependabot/errors"
4
5
  require "dependabot/go_modules/file_updater"
5
6
  require "dependabot/go_modules/native_helpers"
6
7
 
@@ -51,9 +52,10 @@ module Dependabot
51
52
  File.write("go.sum", go_sum.content)
52
53
  File.write("main.go", dummy_main_go)
53
54
 
54
- `GO111MODULE=on go get -d`
55
- unless $CHILD_STATUS.success?
56
- raise Dependabot::DependencyFileNotParseable, go_sum.path
55
+ command = "GO111MODULE=on go get -d"
56
+ _, stderr, status = Open3.capture3(command)
57
+ unless status.success?
58
+ handle_subprocess_error(go_sum.path, stderr)
57
59
  end
58
60
 
59
61
  File.read("go.sum")
@@ -63,6 +65,19 @@ module Dependabot
63
65
 
64
66
  private
65
67
 
68
+ def handle_subprocess_error(path, stderr)
69
+ case stderr
70
+ when /go: finding .*/
71
+ msg = stderr.lines.grep(/go: finding/).first.strip
72
+ match = /go: finding (?<require>\S+)/.match(msg)
73
+ msg = "could not resolve dependency #{match[:require]}" if match
74
+ raise Dependabot::DependencyFileNotResolvable.new, msg
75
+ else
76
+ msg = stderr.gsub(path.to_s, "").strip
77
+ raise Dependabot::DependencyFileNotParseable.new(go_mod.path, msg)
78
+ end
79
+ end
80
+
66
81
  def dummy_main_go
67
82
  lines = ["package main", "import ("]
68
83
  dependencies.each do |dep|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-go_modules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.95.25
4
+ version: 0.95.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.95.25
19
+ version: 0.95.26
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.95.25
26
+ version: 0.95.26
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement