embulk-input-jira 0.2.0 → 0.2.1
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/CHANGELOG.md +4 -0
- data/embulk-input-jira.gemspec +1 -1
- data/lib/embulk/input/jira_api/client.rb +7 -1
- data/spec/embulk/input/jira_api/client_spec.rb +21 -0
- 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: 181af26d320ff8928233a96f78cc1a9f9e0faa7a
|
4
|
+
data.tar.gz: 841813e803c60a42370e6521aa156eef4af31ea5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc9d76289551d9fb6910e8b4c432a2d6b0add274dba2422f77bb9a8e3366bd114e8de03284e2b8b52989f75cde6dfd5ed9711f371f06cf453177ca1a643e5e24
|
7
|
+
data.tar.gz: e0eabdbfb55acb230083482f41639c5ce8fff37c1a4a9943ab32822f1ff4766d4a9900e24a912bd761ab3dbaddbef02b332f7496a0c94174d346c06607e66378
|
data/CHANGELOG.md
CHANGED
data/embulk-input-jira.gemspec
CHANGED
@@ -62,7 +62,13 @@ module Embulk
|
|
62
62
|
if title
|
63
63
|
# (a)
|
64
64
|
Embulk.logger.warn "JIRA returns HTML: #{html}"
|
65
|
-
|
65
|
+
case title
|
66
|
+
when "Atlassian Cloud Notifications - Page Unavailable"
|
67
|
+
# a.k.a. HTTP 503
|
68
|
+
raise title
|
69
|
+
when "Unauthorized (401)"
|
70
|
+
raise Embulk::ConfigError.new("JIRA returns error: #{title}")
|
71
|
+
end
|
66
72
|
else
|
67
73
|
# (b)
|
68
74
|
count += 1
|
@@ -123,5 +123,26 @@ describe Embulk::Input::JiraApi::Client do
|
|
123
123
|
expect(Timeout).to receive(:timeout).with(wait).exactly(retry_times).times
|
124
124
|
expect { subject }.to raise_error(Timeout::Error)
|
125
125
|
end
|
126
|
+
|
127
|
+
describe "invalid JSON response" do
|
128
|
+
let(:block) { proc{ MultiJson.load("<title>#{title}</title>")} }
|
129
|
+
before { allow(Embulk.logger).to receive(:warn) }
|
130
|
+
|
131
|
+
context "Unauthorized" do
|
132
|
+
let(:title) { "Unauthorized (401)" }
|
133
|
+
|
134
|
+
it do
|
135
|
+
expect { subject }.to raise_error(Embulk::ConfigError)
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
context "Unavailable" do
|
140
|
+
let(:title) { "Atlassian Cloud Notifications - Page Unavailable"}
|
141
|
+
|
142
|
+
it do
|
143
|
+
expect { subject }.to raise_error(StandardError, title)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
126
147
|
end
|
127
148
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-input-jira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- uu59
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-04-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|