dependabot-common 0.107.24 → 0.107.25
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 836548667e5c3840e61a77220231c79075f0a5dbbfc6fa78f22402de88fe1e40
|
4
|
+
data.tar.gz: a1b099f9fdb11f5ec3eee39e67b473a3f65abd6669df59ad6dcacb0d39793fa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af7569ae3321492da13679f06616f2fe036e166ef6b05f12587d0871f2e275be3a4d8ab835bb4e6d3905b246b53373c11807699c5ffbb1228b086852c1fbf9bf
|
7
|
+
data.tar.gz: f6072253eef36aca76c7be32d883f2c59771252a401cc9f5665a21faa39f12d6f2e6f2fa89a2de7115da24a33af52892a6d0906f40283e0926f1ead3e793b12c
|
@@ -10,6 +10,8 @@ require "dependabot/pull_request_creator"
|
|
10
10
|
module Dependabot
|
11
11
|
class PullRequestCreator
|
12
12
|
class MessageBuilder
|
13
|
+
require_relative "message_builder/issue_linker"
|
14
|
+
|
13
15
|
ANGULAR_PREFIXES = %w(build chore ci docs feat fix perf refactor style
|
14
16
|
test).freeze
|
15
17
|
ESLINT_PREFIXES = %w(Breaking Build Chore Docs Fix New Update
|
@@ -27,9 +29,6 @@ module Dependabot
|
|
27
29
|
see_no_evil sparkles speech_balloon tada truck
|
28
30
|
twisted_rightwards_arrows whale wheelchair
|
29
31
|
white_check_mark wrench zap).freeze
|
30
|
-
ISSUE_TAG_REGEX =
|
31
|
-
/(?<=[^A-Za-z0-9\[\\]|^)\\*(?<tag>(?:\#|GH-)\d+)(?=[^A-Za-z0-9\-]|$)/.
|
32
|
-
freeze
|
33
32
|
GITHUB_REF_REGEX = %r{
|
34
33
|
(?:https?://)?
|
35
34
|
github\.com/[^/\s]+/[^/\s]+/
|
@@ -695,16 +694,9 @@ module Dependabot
|
|
695
694
|
end
|
696
695
|
|
697
696
|
def link_issues(text:, dependency:)
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
end
|
702
|
-
|
703
|
-
updated_text.gsub(/\[(?<tag>(?:\#|GH-)?\d+)\]\(\)/) do |mention|
|
704
|
-
mention = mention.match(/(?<=\[)(.*)(?=\])/).to_s
|
705
|
-
number = mention.match(/\d+/).to_s
|
706
|
-
"[#{mention}](#{source_url(dependency)}/issues/#{number})"
|
707
|
-
end
|
697
|
+
IssueLinker.
|
698
|
+
new(source_url: source_url(dependency)).
|
699
|
+
link_issues(text: text)
|
708
700
|
end
|
709
701
|
|
710
702
|
def fix_relative_links(text:, base_url:)
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "dependabot/pull_request_creator/message_builder"
|
4
|
+
|
5
|
+
module Dependabot
|
6
|
+
class PullRequestCreator
|
7
|
+
class MessageBuilder
|
8
|
+
class IssueLinker
|
9
|
+
TAG_REGEX = /(?<tag>(?:\#|GH-)\d+)/.freeze
|
10
|
+
ISSUE_LINK_REGEXS = [
|
11
|
+
/(?<=[^A-Za-z0-9\[\\]|^)\\*#{TAG_REGEX}(?=[^A-Za-z0-9\-]|$)/.freeze,
|
12
|
+
/\[#{TAG_REGEX}\](?=[^A-Za-z0-9\-\(])/.freeze,
|
13
|
+
/\[(?<tag>(?:\#|GH-)?\d+)\]\(\)/.freeze
|
14
|
+
].freeze
|
15
|
+
|
16
|
+
attr_reader :source_url
|
17
|
+
|
18
|
+
def initialize(source_url:)
|
19
|
+
@source_url = source_url
|
20
|
+
end
|
21
|
+
|
22
|
+
def link_issues(text:)
|
23
|
+
# Loop through each of the issue link regexes, replacing any instances
|
24
|
+
# of them with an absolute link that uses the source URL
|
25
|
+
ISSUE_LINK_REGEXS.reduce(text) do |updated_text, regex|
|
26
|
+
updated_text.gsub(regex) do |issue_link|
|
27
|
+
tag = issue_link.
|
28
|
+
match(/(?<tag>(?:\#|GH-)?\d+)/).
|
29
|
+
named_captures.fetch("tag")
|
30
|
+
number = tag.match(/\d+/).to_s
|
31
|
+
"[#{tag}](#{source_url}/issues/#{number})"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
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.107.
|
4
|
+
version: 0.107.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dependabot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-ecr
|
@@ -343,6 +343,7 @@ files:
|
|
343
343
|
- lib/dependabot/pull_request_creator/gitlab.rb
|
344
344
|
- lib/dependabot/pull_request_creator/labeler.rb
|
345
345
|
- lib/dependabot/pull_request_creator/message_builder.rb
|
346
|
+
- lib/dependabot/pull_request_creator/message_builder/issue_linker.rb
|
346
347
|
- lib/dependabot/pull_request_updater.rb
|
347
348
|
- lib/dependabot/pull_request_updater/github.rb
|
348
349
|
- lib/dependabot/security_advisory.rb
|