dependabot-common 0.169.0 → 0.169.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependabot/pull_request_creator/github.rb +14 -0
- data/lib/dependabot/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3cf73a6aa2da602e4b4ff963280039afae244d61818b695cd4b121d4cca1746
|
4
|
+
data.tar.gz: d447c6a0ea4049e886fa57efd77558e111a33947583bd7d4eac0263af3a48fb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e2b9e0ee7db5cad8bfc0bafa0ab92919a98121de4285c26c4f6fe6e4d5d705543293be971486ccd30df53be14244214fe8ec8396b4443f79c7d5ab12f9e99b0
|
7
|
+
data.tar.gz: 7381b329f5565fc1017ee124acadb183814636513dbe1a15a44e5d3559ac2f2742bbe4cec2bb693c6058b6e41b1bc3c3399fe6a7a61ae5dd5e290a5126ee6727
|
@@ -9,6 +9,8 @@ module Dependabot
|
|
9
9
|
class PullRequestCreator
|
10
10
|
# rubocop:disable Metrics/ClassLength
|
11
11
|
class Github
|
12
|
+
MAX_PR_DESCRIPTION_LENGTH = 65_536 # characters (see #create_pull_request)
|
13
|
+
|
12
14
|
attr_reader :source, :branch_name, :base_commit, :credentials,
|
13
15
|
:files, :pr_description, :pr_name, :commit_message,
|
14
16
|
:author_details, :signature_key, :custom_headers,
|
@@ -347,6 +349,18 @@ module Dependabot
|
|
347
349
|
end
|
348
350
|
|
349
351
|
def create_pull_request
|
352
|
+
# Limit PR description to MAX_PR_DESCRIPTION_LENGTH (65,536) characters
|
353
|
+
# and truncate with message if over. The API limit is 262,144 bytes
|
354
|
+
# (https://github.community/t/maximum-length-for-the-comment-body-in-issues-and-pr/148867/2).
|
355
|
+
# As Ruby strings are UTF-8 encoded, this is a pessimistic limit: it
|
356
|
+
# presumes the case where all characters are 4 bytes.
|
357
|
+
pr_description = @pr_description.dup
|
358
|
+
if pr_description && pr_description.length > MAX_PR_DESCRIPTION_LENGTH
|
359
|
+
truncated_msg = "...\n\n_Description has been truncated_"
|
360
|
+
truncate_length = MAX_PR_DESCRIPTION_LENGTH - truncated_msg.length
|
361
|
+
pr_description = (pr_description[0, truncate_length] + truncated_msg)
|
362
|
+
end
|
363
|
+
|
350
364
|
github_client_for_source.create_pull_request(
|
351
365
|
source.repo,
|
352
366
|
target_branch,
|
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.169.
|
4
|
+
version: 0.169.4
|
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
|
+
date: 2021-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -469,7 +469,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
469
469
|
- !ruby/object:Gem::Version
|
470
470
|
version: 2.7.3
|
471
471
|
requirements: []
|
472
|
-
rubygems_version: 3.2.
|
472
|
+
rubygems_version: 3.2.32
|
473
473
|
signing_key:
|
474
474
|
specification_version: 4
|
475
475
|
summary: Shared code used between Dependabot package managers
|