dependabot-common 0.125.1 → 0.125.6
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/lib/dependabot/clients/azure.rb +17 -9
- data/lib/dependabot/shared_helpers.rb +8 -0
- data/lib/dependabot/version.rb +1 -1
- 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: 618ef07c17a9314071f8b63a70e15ecbc2cb748b07fce181baa81c3f48fcf3b1
|
4
|
+
data.tar.gz: 352c0ac8a039035fd0dbcf55caa1edb36aab342d74bb5d220fd92d805a8cc4a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a1bbd24a78e74f7c51fd576d207443e1c236288b0bed818937f6e42faa0cf9cf8ce11c4c1d87c5fd2e7ac281c737b756ab2187b08d8cad2d5c67a0470721f22
|
7
|
+
data.tar.gz: 23688ee80a768545903cdce798ee28397a4474c4cb216ca43efb0d60df79de40b0a74451e824551e954fba159debcf565cc17461a77d56726efb526c5173b1f1
|
@@ -8,6 +8,8 @@ module Dependabot
|
|
8
8
|
class Azure
|
9
9
|
class NotFound < StandardError; end
|
10
10
|
|
11
|
+
MAX_PR_DESCRIPTION_LENGTH = 3999
|
12
|
+
|
11
13
|
#######################
|
12
14
|
# Constructor methods #
|
13
15
|
#######################
|
@@ -154,15 +156,7 @@ module Dependabot
|
|
154
156
|
# rubocop:disable Metrics/ParameterLists
|
155
157
|
def create_pull_request(pr_name, source_branch, target_branch,
|
156
158
|
pr_description, labels, work_item = nil)
|
157
|
-
|
158
|
-
# https://developercommunity.visualstudio.com/content/problem/608770/remove-4000-character-limit-on-pull-request-descri.html
|
159
|
-
azure_max_length = 3999
|
160
|
-
if pr_description.length > azure_max_length
|
161
|
-
truncated_msg = "...\n\n_Description has been truncated_"
|
162
|
-
truncate_length = azure_max_length - truncated_msg.length
|
163
|
-
pr_description = pr_description[0..truncate_length] + truncated_msg
|
164
|
-
end
|
165
|
-
# rubocop:enable Metrics/ParameterLists
|
159
|
+
pr_description = truncate_pr_description(pr_description)
|
166
160
|
|
167
161
|
content = {
|
168
162
|
sourceRefName: "refs/heads/" + source_branch,
|
@@ -178,6 +172,7 @@ module Dependabot
|
|
178
172
|
"/_apis/git/repositories/" + source.unscoped_repo +
|
179
173
|
"/pullrequests?api-version=5.0", content.to_json)
|
180
174
|
end
|
175
|
+
# rubocop:enable Metrics/ParameterLists
|
181
176
|
|
182
177
|
def get(url)
|
183
178
|
response = Excon.get(
|
@@ -230,6 +225,19 @@ module Dependabot
|
|
230
225
|
end
|
231
226
|
end
|
232
227
|
|
228
|
+
def truncate_pr_description(pr_description)
|
229
|
+
# Azure DevOps only support descriptions up to 4000 characters in UTF-16
|
230
|
+
# encoding.
|
231
|
+
# https://developercommunity.visualstudio.com/content/problem/608770/remove-4000-character-limit-on-pull-request-descri.html
|
232
|
+
pr_description = pr_description.dup.force_encoding(Encoding::UTF_16)
|
233
|
+
if pr_description.length > MAX_PR_DESCRIPTION_LENGTH
|
234
|
+
truncated_msg = "...\n\n_Description has been truncated_".dup.force_encoding(Encoding::UTF_16)
|
235
|
+
truncate_length = MAX_PR_DESCRIPTION_LENGTH - truncated_msg.length
|
236
|
+
pr_description = (pr_description[0..truncate_length] + truncated_msg)
|
237
|
+
end
|
238
|
+
pr_description.force_encoding(Encoding::UTF_8)
|
239
|
+
end
|
240
|
+
|
233
241
|
attr_reader :auth_header
|
234
242
|
attr_reader :credentials
|
235
243
|
attr_reader :source
|
@@ -83,6 +83,7 @@ module Dependabot
|
|
83
83
|
Shellwords.join(command_parts)
|
84
84
|
end
|
85
85
|
|
86
|
+
# rubocop:disable Metrics/MethodLength
|
86
87
|
def self.run_helper_subprocess(command:, function:, args:, env: nil,
|
87
88
|
stderr_to_stdout: false,
|
88
89
|
allow_unsafe_shell_command: false)
|
@@ -90,6 +91,12 @@ module Dependabot
|
|
90
91
|
stdin_data = JSON.dump(function: function, args: args)
|
91
92
|
cmd = allow_unsafe_shell_command ? command : escape_command(command)
|
92
93
|
env_cmd = [env, cmd].compact
|
94
|
+
if ENV["DEBUG_FUNCTION"] == function
|
95
|
+
escaped_stdin_data = stdin_data.gsub("\"", "\\\"")
|
96
|
+
puts "$ cd #{Dir.pwd} && echo \"#{escaped_stdin_data}\" | #{env_cmd.join(' ')}"
|
97
|
+
# Pause execution so we can run helpers inside the temporary directory
|
98
|
+
byebug # rubocop:disable Lint/Debugger
|
99
|
+
end
|
93
100
|
stdout, stderr, process = Open3.capture3(*env_cmd, stdin_data: stdin_data)
|
94
101
|
time_taken = Time.now - start
|
95
102
|
|
@@ -129,6 +136,7 @@ module Dependabot
|
|
129
136
|
error_context: error_context
|
130
137
|
)
|
131
138
|
end
|
139
|
+
# rubocop:enable Metrics/MethodLength
|
132
140
|
|
133
141
|
def self.excon_middleware
|
134
142
|
Excon.defaults[:middlewares] +
|
data/lib/dependabot/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dependabot-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.125.
|
4
|
+
version: 0.125.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-codecommit
|
@@ -320,14 +320,14 @@ dependencies:
|
|
320
320
|
requirements:
|
321
321
|
- - "~>"
|
322
322
|
- !ruby/object:Gem::Version
|
323
|
-
version: 0.
|
323
|
+
version: 0.8.0
|
324
324
|
type: :development
|
325
325
|
prerelease: false
|
326
326
|
version_requirements: !ruby/object:Gem::Requirement
|
327
327
|
requirements:
|
328
328
|
- - "~>"
|
329
329
|
- !ruby/object:Gem::Version
|
330
|
-
version: 0.
|
330
|
+
version: 0.8.0
|
331
331
|
- !ruby/object:Gem::Dependency
|
332
332
|
name: vcr
|
333
333
|
requirement: !ruby/object:Gem::Requirement
|