danger-jira 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jira/gem_version.rb +1 -1
- data/lib/jira/plugin.rb +2 -10
- data/spec/jira_spec.rb +1 -18
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b15d8ebf7429b4cf1c9fca0d0f15e8abfde51d7b
|
4
|
+
data.tar.gz: 07c9a190ac242399f89b967d2078a8f3a909a621
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94222d9d7703e076b6dbcca12e4b05c38799c3323c829cf6010b118fc6edc41a5ea11e08e0a058a3272ae02bc233a354c6494a75c059f59c838f99e77b06b6de
|
7
|
+
data.tar.gz: f872c9f3a63c965998778150d2ddbbcb64f9e95a52575c5eb4caf0ae035a216eca2513f6706ce8437a0ed1ab09bea71c01e96928847ede7b5692557b055ed568
|
data/lib/jira/gem_version.rb
CHANGED
data/lib/jira/plugin.rb
CHANGED
@@ -41,7 +41,7 @@ module Danger
|
|
41
41
|
throw Error("'key' missing - must supply JIRA issue key") if key.nil?
|
42
42
|
throw Error("'url' missing - must supply JIRA installation URL") if url.nil?
|
43
43
|
|
44
|
-
return if skippable && should_skip_jira?
|
44
|
+
return if skippable && should_skip_jira?(search_title: search_title)
|
45
45
|
|
46
46
|
jira_issues = find_jira_issues(
|
47
47
|
key: key,
|
@@ -94,7 +94,7 @@ module Danger
|
|
94
94
|
return jira_issues.uniq
|
95
95
|
end
|
96
96
|
|
97
|
-
def should_skip_jira?(search_title: true
|
97
|
+
def should_skip_jira?(search_title: true)
|
98
98
|
# Consider first occurrence of 'no-jira'
|
99
99
|
regexp = Regexp.new("no-jira", true)
|
100
100
|
|
@@ -104,14 +104,6 @@ module Danger
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
107
|
-
if search_commits
|
108
|
-
git.commits.map do |commit|
|
109
|
-
commit.message.gsub(regexp) do |match|
|
110
|
-
return true unless match.empty?
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
107
|
github.pr_body.gsub(regexp) do |match|
|
116
108
|
return true unless match.empty?
|
117
109
|
end
|
data/spec/jira_spec.rb
CHANGED
@@ -49,24 +49,7 @@ module Danger
|
|
49
49
|
|
50
50
|
it "can find no-jira in pr body" do
|
51
51
|
allow(@jira).to receive_message_chain("github.pr_body").and_return("[no-jira] Ticket doesn't need a jira but [WEB-123] WEB-123")
|
52
|
-
result = @jira.should_skip_jira?(
|
53
|
-
search_title: false,
|
54
|
-
search_commits: false
|
55
|
-
)
|
56
|
-
expect(result).to be(true)
|
57
|
-
end
|
58
|
-
|
59
|
-
it "can find no-jira in commits" do
|
60
|
-
single_commit = Object.new
|
61
|
-
def single_commit.message
|
62
|
-
"Small text change [no-jira]"
|
63
|
-
end
|
64
|
-
commits = [single_commit]
|
65
|
-
allow(@jira).to receive_message_chain("git.commits").and_return(commits)
|
66
|
-
result = @jira.should_skip_jira?(
|
67
|
-
search_title: false,
|
68
|
-
search_commits: true
|
69
|
-
)
|
52
|
+
result = @jira.should_skip_jira?(search_title: false)
|
70
53
|
expect(result).to be(true)
|
71
54
|
end
|
72
55
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-jira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RestlessThinker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|