embulk-input-jira 0.2.0 → 0.2.1

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
  SHA1:
3
- metadata.gz: 872b8270d7250ff40e24e1491202fef465084ddb
4
- data.tar.gz: 451f8c9d3b7ad30be10558f0ee47af795e6b5250
3
+ metadata.gz: 181af26d320ff8928233a96f78cc1a9f9e0faa7a
4
+ data.tar.gz: 841813e803c60a42370e6521aa156eef4af31ea5
5
5
  SHA512:
6
- metadata.gz: 8f8ee9cdf16fc5706b5e18bc45dcf8cb4c4550bf602893b9470905beb5e4a25c3b762a952497b7658e8f65afddf8e6a5cd706ea7705abcd476001ffadc973893
7
- data.tar.gz: b2ecfb499d5b18b965682009c9f8c2e049b9f1dd47911786e2a6ffdf7da97d00daaa1ff328f32fbfecbcc34c653d4267e3239db43e3473f928f86c88c3ec9ace
6
+ metadata.gz: fc9d76289551d9fb6910e8b4c432a2d6b0add274dba2422f77bb9a8e3366bd114e8de03284e2b8b52989f75cde6dfd5ed9711f371f06cf453177ca1a643e5e24
7
+ data.tar.gz: e0eabdbfb55acb230083482f41639c5ce8fff37c1a4a9943ab32822f1ff4766d4a9900e24a912bd761ab3dbaddbef02b332f7496a0c94174d346c06607e66378
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.1 - 2016-04-13
2
+
3
+ * [fixed] Fix to retry when JIRA returns 503 reponse [#45](https://github.com/treasure-data/embulk-input-jira/pull/45)
4
+
1
5
  ## 0.2.0 - 2016-03-28
2
6
 
3
7
  **Embulk 0.8.7+ is required since this version**
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "embulk-input-jira"
3
- spec.version = "0.2.0"
3
+ spec.version = "0.2.1"
4
4
  spec.authors = ["uu59", "yoshihara"]
5
5
  spec.summary = "Jira input plugin for Embulk"
6
6
  spec.description = "Loads records from Jira."
@@ -62,7 +62,13 @@ module Embulk
62
62
  if title
63
63
  # (a)
64
64
  Embulk.logger.warn "JIRA returns HTML: #{html}"
65
- raise Embulk::ConfigError.new("JIRA returns error: #{title}")
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.0
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-03-28 00:00:00.000000000 Z
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