dependabot-bundler 0.164.1 → 0.165.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 +4 -4
- data/helpers/v1/run.rb +5 -0
- data/helpers/v2/run.rb +5 -0
- data/lib/dependabot/bundler/file_parser.rb +2 -0
- data/lib/dependabot/bundler/file_updater/lockfile_updater.rb +1 -0
- data/lib/dependabot/bundler/file_updater.rb +1 -0
- data/lib/dependabot/bundler/native_helpers.rb +36 -10
- data/lib/dependabot/bundler/update_checker/conflicting_dependency_resolver.rb +1 -0
- data/lib/dependabot/bundler/update_checker/force_updater.rb +1 -0
- data/lib/dependabot/bundler/update_checker/latest_version_finder/dependency_source.rb +3 -0
- data/lib/dependabot/bundler/update_checker/shared_bundler_helpers.rb +2 -0
- data/lib/dependabot/bundler/update_checker/version_resolver.rb +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 218f816762d901aa6fcaba4d136b78265732cbd17d757116664c8b3a705d5c8f
|
|
4
|
+
data.tar.gz: c3cdf83a8d4821bf784efee059459cb7031b10b73417abb6240a73e0ee93773c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69df0390f761c7d580261008a007e9054805c867c383046a3206f1e5b7a5c49c39b8d346727be5128e21c22bf368cbbd11869589e0ac538aaa669413337ebac0
|
|
7
|
+
data.tar.gz: 1b7f800c8b40b2c3231ae3ee992d97d3b0422b859ad8acd66960cba2e747c8e1f5b188e41a6565857447b6d9164a856d0e4d38387236c0fcb896f4b1c486a305
|
data/helpers/v1/run.rb
CHANGED
|
@@ -6,6 +6,11 @@ require "json"
|
|
|
6
6
|
$LOAD_PATH.unshift(File.expand_path("./lib", __dir__))
|
|
7
7
|
$LOAD_PATH.unshift(File.expand_path("./monkey_patches", __dir__))
|
|
8
8
|
|
|
9
|
+
trap "HUP" do
|
|
10
|
+
puts JSON.generate(error: "timeout", error_class: "Timeout::Error", trace: [])
|
|
11
|
+
exit 2
|
|
12
|
+
end
|
|
13
|
+
|
|
9
14
|
# Bundler monkey patches
|
|
10
15
|
require "definition_ruby_version_patch"
|
|
11
16
|
require "definition_bundler_version_patch"
|
data/helpers/v2/run.rb
CHANGED
|
@@ -6,6 +6,11 @@ require "json"
|
|
|
6
6
|
$LOAD_PATH.unshift(File.expand_path("./lib", __dir__))
|
|
7
7
|
$LOAD_PATH.unshift(File.expand_path("./monkey_patches", __dir__))
|
|
8
8
|
|
|
9
|
+
trap "HUP" do
|
|
10
|
+
puts JSON.generate(error: "timeout", error_class: "Timeout::Error", trace: [])
|
|
11
|
+
exit 2
|
|
12
|
+
end
|
|
13
|
+
|
|
9
14
|
# Bundler monkey patches
|
|
10
15
|
require "definition_ruby_version_patch"
|
|
11
16
|
require "definition_bundler_version_patch"
|
|
@@ -145,6 +145,7 @@ module Dependabot
|
|
|
145
145
|
NativeHelpers.run_bundler_subprocess(
|
|
146
146
|
bundler_version: bundler_version,
|
|
147
147
|
function: "parsed_gemfile",
|
|
148
|
+
options: options,
|
|
148
149
|
args: {
|
|
149
150
|
gemfile_name: gemfile.name,
|
|
150
151
|
lockfile_name: lockfile&.name,
|
|
@@ -175,6 +176,7 @@ module Dependabot
|
|
|
175
176
|
NativeHelpers.run_bundler_subprocess(
|
|
176
177
|
bundler_version: bundler_version,
|
|
177
178
|
function: "parsed_gemspec",
|
|
179
|
+
options: options,
|
|
178
180
|
args: {
|
|
179
181
|
gemspec_name: file.name,
|
|
180
182
|
lockfile_name: lockfile&.name,
|
|
@@ -6,20 +6,51 @@ require "dependabot/shared_helpers"
|
|
|
6
6
|
module Dependabot
|
|
7
7
|
module Bundler
|
|
8
8
|
module NativeHelpers
|
|
9
|
-
|
|
9
|
+
class BundleCommand
|
|
10
|
+
MAX_SECONDS = 1800
|
|
11
|
+
MIN_SECONDS = 60
|
|
12
|
+
|
|
13
|
+
def initialize(timeout_seconds)
|
|
14
|
+
@timeout_seconds = clamp(timeout_seconds)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def build(script)
|
|
18
|
+
[timeout_command, :bundle, :exec, :ruby, script].compact.join(" ")
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
private
|
|
22
|
+
|
|
23
|
+
attr_reader :timeout_seconds
|
|
24
|
+
|
|
25
|
+
def timeout_command
|
|
26
|
+
"timeout -s HUP #{timeout_seconds}" unless timeout_seconds.zero?
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def clamp(seconds)
|
|
30
|
+
return 0 unless seconds
|
|
31
|
+
|
|
32
|
+
seconds.to_i.clamp(MIN_SECONDS, MAX_SECONDS)
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def self.run_bundler_subprocess(function:, args:, bundler_version:, options: {})
|
|
10
37
|
# Run helper suprocess with all bundler-related ENV variables removed
|
|
11
38
|
bundler_major_version = bundler_version.split(".").first
|
|
39
|
+
helpers_path = versioned_helper_path(bundler_version: bundler_major_version)
|
|
12
40
|
::Bundler.with_original_env do
|
|
41
|
+
command = BundleCommand.
|
|
42
|
+
new(options[:timeout_per_operation_seconds]).
|
|
43
|
+
build(File.join(helpers_path, "run.rb"))
|
|
13
44
|
SharedHelpers.run_helper_subprocess(
|
|
14
|
-
command:
|
|
45
|
+
command: command,
|
|
15
46
|
function: function,
|
|
16
47
|
args: args,
|
|
17
48
|
env: {
|
|
18
49
|
# Bundler will pick the matching installed major version
|
|
19
50
|
"BUNDLER_VERSION" => bundler_version,
|
|
20
|
-
"BUNDLE_GEMFILE" => File.join(
|
|
51
|
+
"BUNDLE_GEMFILE" => File.join(helpers_path, "Gemfile"),
|
|
21
52
|
# Prevent the GEM_HOME from being set to a folder owned by root
|
|
22
|
-
"GEM_HOME" => File.join(
|
|
53
|
+
"GEM_HOME" => File.join(helpers_path, ".bundle")
|
|
23
54
|
}
|
|
24
55
|
)
|
|
25
56
|
rescue SharedHelpers::HelperSubprocessFailed => e
|
|
@@ -31,12 +62,7 @@ module Dependabot
|
|
|
31
62
|
end
|
|
32
63
|
|
|
33
64
|
def self.versioned_helper_path(bundler_version:)
|
|
34
|
-
|
|
35
|
-
File.join(native_helpers_root, native_helper_version)
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def self.helper_path(bundler_version:)
|
|
39
|
-
"bundle exec ruby #{File.join(versioned_helper_path(bundler_version: bundler_version), 'run.rb')}"
|
|
65
|
+
File.join(native_helpers_root, "v#{bundler_version}")
|
|
40
66
|
end
|
|
41
67
|
|
|
42
68
|
def self.native_helpers_root
|
|
@@ -61,6 +61,7 @@ module Dependabot
|
|
|
61
61
|
NativeHelpers.run_bundler_subprocess(
|
|
62
62
|
bundler_version: bundler_version,
|
|
63
63
|
function: "depencency_source_latest_git_version",
|
|
64
|
+
options: options,
|
|
64
65
|
args: {
|
|
65
66
|
dir: tmp_dir,
|
|
66
67
|
gemfile_name: gemfile.name,
|
|
@@ -106,6 +107,7 @@ module Dependabot
|
|
|
106
107
|
NativeHelpers.run_bundler_subprocess(
|
|
107
108
|
bundler_version: bundler_version,
|
|
108
109
|
function: "private_registry_versions",
|
|
110
|
+
options: options,
|
|
109
111
|
args: {
|
|
110
112
|
dir: tmp_dir,
|
|
111
113
|
gemfile_name: gemfile.name,
|
|
@@ -126,6 +128,7 @@ module Dependabot
|
|
|
126
128
|
NativeHelpers.run_bundler_subprocess(
|
|
127
129
|
bundler_version: bundler_version,
|
|
128
130
|
function: "dependency_source_type",
|
|
131
|
+
options: options,
|
|
129
132
|
args: {
|
|
130
133
|
dir: tmp_dir,
|
|
131
134
|
gemfile_name: gemfile.name,
|
|
@@ -167,6 +167,7 @@ module Dependabot
|
|
|
167
167
|
git_specs = NativeHelpers.run_bundler_subprocess(
|
|
168
168
|
bundler_version: bundler_version,
|
|
169
169
|
function: "git_specs",
|
|
170
|
+
options: options,
|
|
170
171
|
args: {
|
|
171
172
|
dir: tmp_dir,
|
|
172
173
|
gemfile_name: gemfile.name,
|
|
@@ -195,6 +196,7 @@ module Dependabot
|
|
|
195
196
|
NativeHelpers.run_bundler_subprocess(
|
|
196
197
|
bundler_version: bundler_version,
|
|
197
198
|
function: "jfrog_source",
|
|
199
|
+
options: options,
|
|
198
200
|
args: {
|
|
199
201
|
dir: dir,
|
|
200
202
|
gemfile_name: gemfile.name,
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dependabot-bundler
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.165.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dependabot
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-11-
|
|
11
|
+
date: 2021-11-08 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.
|
|
19
|
+
version: 0.165.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.
|
|
26
|
+
version: 0.165.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: byebug
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|