dependabot-common 0.112.25 → 0.112.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84aafec571e2c6085581e7d37c349ddbe2e676d3ef90aed34c58d892bc6faf56
4
- data.tar.gz: bb4bb9bd139f6bec7aa7284e12b9ca7b4ae338b56ffbd089eae713ec36c02748
3
+ metadata.gz: 8d0cc3dacc3f64a8b5bd86bd99017e5f43fe3494445c01eefa4409975bbe28a2
4
+ data.tar.gz: '08272b00ef4c7a12428fe475eb296a7c5790cf1cdbbdc8c11aae7feeca9d4b4a'
5
5
  SHA512:
6
- metadata.gz: 2029f580d882b6039c8982f8bfc2cf5a696e7d68d601932e42b35cbbc50949ee37caac9c553dbbb60645933713df696f267d613384be02b3c196a7216fd23e3d
7
- data.tar.gz: d7e77735ff896f12c49ab46aa70129fb833fd00b49931002bea7a4f0260969e7d2f1293657b00b01808fb3e2b47a8a70bc2a9a24aa9e65bd2033fb7d84e7b483
6
+ metadata.gz: 8714dbcbd7858505ea3c23942f93e27c1991fb575b599c2e6aa8fe692ff1ac3e5d2640edc4b98c33563e49e9387722f7e49ded95e9cbb58a99c962f959aab465
7
+ data.tar.gz: 8d4f8769368db9659837280b671353a7abbe21587358e840c3d92ac63af7346abfcf87e8ffd0ce5ddff0e65c6d64cab9b10c24812b4f35a45b6ea8d57faff39f
@@ -6,9 +6,13 @@ module Dependabot
6
6
  class PullRequestCreator
7
7
  class MessageBuilder
8
8
  class IssueLinker
9
+ REPO_REGEX = %r{(?<repo>[\w.-]+/(?:(?!\.git|\.\s)[\w.-])+)}.freeze
9
10
  TAG_REGEX = /(?<tag>(?:\#|GH-)\d+)/i.freeze
10
11
  ISSUE_LINK_REGEXS = [
11
- /(?<=[^A-Za-z0-9\[\\]|^)\\*#{TAG_REGEX}(?=[^A-Za-z0-9\-]|$)/.freeze,
12
+ /
13
+ (?:(?<=[^A-Za-z0-9\[\\]|^)\\*#{TAG_REGEX}(?=[^A-Za-z0-9\-]|$))|
14
+ (?:(?<=\s|^)#{REPO_REGEX}#{TAG_REGEX}(?=[^A-Za-z0-9\-]|$))
15
+ /x.freeze,
12
16
  /\[#{TAG_REGEX}\](?=[^A-Za-z0-9\-\(])/.freeze,
13
17
  /\[(?<tag>(?:\#|GH-)?\d+)\]\(\)/i.freeze
14
18
  ].freeze
@@ -28,7 +32,14 @@ module Dependabot
28
32
  match(/(?<tag>(?:\#|GH-)?\d+)/i).
29
33
  named_captures.fetch("tag")
30
34
  number = tag.match(/\d+/).to_s
31
- "[#{tag}](#{source_url}/issues/#{number})"
35
+
36
+ repo = issue_link.
37
+ match("#{REPO_REGEX}#{TAG_REGEX}")&.
38
+ named_captures&.
39
+ fetch("repo", nil)
40
+ source = repo ? "https://github.com/#{repo}" : source_url
41
+
42
+ "[#{repo ? (repo + tag) : tag}](#{source}/issues/#{number})"
32
43
  end
33
44
  end
34
45
  end
@@ -9,7 +9,7 @@ module Dependabot
9
9
  GITHUB_USERNAME = /[a-z0-9]+(-[a-z0-9]+)*/i.freeze
10
10
  GITHUB_REF_REGEX = %r{
11
11
  (?:https?://)?
12
- github\.com/#{GITHUB_USERNAME}/[^/\s]+/
12
+ github\.com/(?<repo>#{GITHUB_USERNAME}/[^/\s]+)/
13
13
  (?:issue|pull)s?/(?<number>\d+)
14
14
  }x.freeze
15
15
 
@@ -76,7 +76,9 @@ module Dependabot
76
76
  ref.gsub("github.com", github_redirection_service || "github.com")
77
77
  if (previous_char.nil? || previous_char.match?(/\s/)) &&
78
78
  (next_char.nil? || next_char.match?(/\s/))
79
- "[##{last_match.named_captures.fetch('number')}]"\
79
+ number = last_match.named_captures.fetch("number")
80
+ repo = last_match.named_captures.fetch("repo")
81
+ "[#{repo}##{number}]"\
80
82
  "(#{sanitized_url})"
81
83
  else
82
84
  sanitized_url
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.112.25"
4
+ VERSION = "0.112.26"
5
5
  end
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.112.25
4
+ version: 0.112.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-30 00:00:00.000000000 Z
11
+ date: 2019-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-ecr