gooddata 0.6.46 → 0.6.47
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -0
- data/CHANGELOG.md +5 -0
- data/gooddata.gemspec +1 -1
- data/lib/gooddata/goodzilla/goodzilla.rb +4 -4
- data/lib/gooddata/helpers/global_helpers_params.rb +1 -1
- data/lib/gooddata/models/blueprint/project_blueprint.rb +3 -3
- data/lib/gooddata/models/metadata/label.rb +1 -1
- data/lib/gooddata/models/project_creator.rb +1 -1
- data/lib/gooddata/rest/client.rb +1 -1
- data/lib/gooddata/rest/connection.rb +5 -5
- data/lib/gooddata/version.rb +1 -1
- data/spec/environment/default.rb +1 -0
- data/spec/unit/rest/polling_spec.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fe4a380bfb3c6a8bf88999a27ca7dc61a18f637
|
4
|
+
data.tar.gz: e01f91a9f40a36ce9e64f3018b033616882fc94f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acc255529450901f5896fb15178d078fe69ff99ee9d1f54b1f29999780ed9857a7214ed34c47fcfe081f905c955bc2581e3db0bfbc18d7144c0cb4695c3fd33b
|
7
|
+
data.tar.gz: 9041e3486768a8b493009f8c710a20170ba14717e68b3870eef4480eefae83c8ed60acce69cc0eedab8ea7d15d9b6281f42952520861d91efe13c86029dcaa21
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# GoodData Ruby SDK Changelog
|
2
2
|
|
3
|
+
## 0.6.47
|
4
|
+
- Support for GD_MAX_RETRY environment variable for external manual override of maximum retry attempts
|
5
|
+
- Updated dependencies (gems)
|
6
|
+
- Do not log params if JSON parsing fails
|
7
|
+
|
3
8
|
## 0.6.46
|
4
9
|
- Fixed transfer_label_types, use target client for lookup
|
5
10
|
|
data/gooddata.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
s.add_development_dependency 'redcarpet', '~> 3.1', '>= 3.1.1' if RUBY_PLATFORM != 'java'
|
36
36
|
s.add_development_dependency 'rspec', '~> 3.4', '>= 3.4.0'
|
37
37
|
s.add_development_dependency 'rspec-expectations', '~> 3.4', '>= 3.4.0'
|
38
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
38
|
+
s.add_development_dependency 'rubocop', '~> 0.45', '>= 0.45.0'
|
39
39
|
s.add_development_dependency 'ruby-debug-ide', '~> 0.4' if !ENV['TRAVIS_BUILD'] && RUBY_VERSION >= '2.0.0'
|
40
40
|
s.add_development_dependency 'simplecov', '~> 0.10', '>= 0.10.0'
|
41
41
|
s.add_development_dependency 'webmock', '~> 1.21', '>= 1.21.0'
|
@@ -146,10 +146,10 @@ module GoodData
|
|
146
146
|
ids = GoodData::SmallGoodZilla.get_ids(metric)
|
147
147
|
interpolated_ids = ids.zip(Array(interpolate_ids(options, ids)))
|
148
148
|
|
149
|
-
metric = interpolated[:facts].reduce(metric) { |
|
150
|
-
metric = interpolated[:attributes].reduce(metric) { |
|
151
|
-
metric = interpolated[:metrics].reduce(metric) { |
|
152
|
-
metric = interpolated_ids.reduce(metric) { |
|
149
|
+
metric = interpolated[:facts].reduce(metric) { |acc, elem| acc.sub("#\"#{elem[0]}\"", "[#{elem[1]}]") }
|
150
|
+
metric = interpolated[:attributes].reduce(metric) { |acc, elem| acc.sub("@\"#{elem[0]}\"", "[#{elem[1]}]") }
|
151
|
+
metric = interpolated[:metrics].reduce(metric) { |acc, elem| acc.sub("?\"#{elem[0]}\"", "[#{elem[1]}]") }
|
152
|
+
metric = interpolated_ids.reduce(metric) { |acc, elem| acc.gsub("![#{elem[0]}]", "[#{elem[1]}]") }
|
153
153
|
metric
|
154
154
|
end
|
155
155
|
|
@@ -70,7 +70,7 @@ module GoodData
|
|
70
70
|
parsed_data_params = JSON.parse(data_params)
|
71
71
|
parsed_hidden_data_params = JSON.parse(hidden_data_params)
|
72
72
|
rescue JSON::ParserError => e
|
73
|
-
raise e.class, "Error reading json from '#{key}' or '#{hidden_key}'
|
73
|
+
raise e.class, "Error reading json from '#{key}' or '#{hidden_key}', reason: #{e.message}"
|
74
74
|
end
|
75
75
|
|
76
76
|
# Add the nil on ENCODED_HIDDEN_PARAMS_KEY
|
@@ -308,7 +308,7 @@ module GoodData
|
|
308
308
|
#
|
309
309
|
# @return [Array<Hash>]
|
310
310
|
def attributes
|
311
|
-
datasets.reduce([]) { |
|
311
|
+
datasets.reduce([]) { |acc, elem| acc.concat(elem.attributes) }
|
312
312
|
end
|
313
313
|
|
314
314
|
# Returns list of attributes and anchors from all the datasets in a blueprint
|
@@ -718,8 +718,8 @@ module GoodData
|
|
718
718
|
def validate
|
719
719
|
errors = []
|
720
720
|
errors.concat validate_references
|
721
|
-
errors.concat datasets.reduce([]) { |
|
722
|
-
errors.concat datasets.reduce([]) { |
|
721
|
+
errors.concat datasets.reduce([]) { |acc, elem| acc.concat(elem.validate) }
|
722
|
+
errors.concat datasets.reduce([]) { |acc, elem| acc.concat(elem.validate_gd_data_type_errors) }
|
723
723
|
errors
|
724
724
|
rescue
|
725
725
|
raise GoodData::ValidationError
|
@@ -51,7 +51,7 @@ module GoodData
|
|
51
51
|
offset: 0,
|
52
52
|
order: 'asc'
|
53
53
|
}
|
54
|
-
params = default_params.merge(url_or_params).map { |x, v| "#{x}=#{CGI.escape(v.to_s)}" }.reduce { |
|
54
|
+
params = default_params.merge(url_or_params).map { |x, v| "#{x}=#{CGI.escape(v.to_s)}" }.reduce { |acc, elem| "#{acc}&#{elem}" }
|
55
55
|
final_url = "#{uri}/validElements?#{params}"
|
56
56
|
end
|
57
57
|
|
@@ -63,7 +63,7 @@ module GoodData
|
|
63
63
|
next
|
64
64
|
end
|
65
65
|
end
|
66
|
-
if (errors.
|
66
|
+
if (!errors.empty?) && (errors.length == replaced_maqls.length)
|
67
67
|
messages = errors.map { |e| GoodData::Helpers.interpolate_error_messages(e.data['wTaskStatus']['messages']) }
|
68
68
|
fail "Unable to migrate LDM, reason(s): \n #{messages.join("\n")}"
|
69
69
|
end
|
data/lib/gooddata/rest/client.rb
CHANGED
@@ -329,7 +329,7 @@ module GoodData
|
|
329
329
|
fail ExecutionLimitExceeded, "The time limit #{time_limit} secs for polling on #{link} is over"
|
330
330
|
end
|
331
331
|
sleep sleep_interval
|
332
|
-
GoodData::Rest::Client.retryable(:tries =>
|
332
|
+
GoodData::Rest::Client.retryable(:tries => ConnectionHelper::GD_MAX_RETRY, :refresh_token => proc { connection.refresh_token }) do
|
333
333
|
response = get(link, process: process)
|
334
334
|
end
|
335
335
|
end
|
@@ -288,7 +288,7 @@ module GoodData
|
|
288
288
|
end
|
289
289
|
end
|
290
290
|
|
291
|
-
GoodData::Rest::Connection.retryable(:tries =>
|
291
|
+
GoodData::Rest::Connection.retryable(:tries => ConnectionHelper::GD_MAX_RETRY, :refresh_token => proc { refresh_token }) do
|
292
292
|
if where.is_a?(IO) || where.is_a?(StringIO)
|
293
293
|
b.call(where)
|
294
294
|
else
|
@@ -486,7 +486,7 @@ module GoodData
|
|
486
486
|
RestClient::Request.execute(raw)
|
487
487
|
end
|
488
488
|
|
489
|
-
GoodData::Rest::Connection.retryable(:tries =>
|
489
|
+
GoodData::Rest::Connection.retryable(:tries => ConnectionHelper::GD_MAX_RETRY, :refresh_token => proc { refresh_token }) do
|
490
490
|
b.call
|
491
491
|
end
|
492
492
|
end
|
@@ -543,7 +543,7 @@ module GoodData
|
|
543
543
|
end
|
544
544
|
|
545
545
|
def process_response(options = {}, &block)
|
546
|
-
retries = options[:tries] ||
|
546
|
+
retries = options[:tries] || ConnectionHelper::GD_MAX_RETRY
|
547
547
|
process = options[:process]
|
548
548
|
dont_reauth = options[:dont_reauth]
|
549
549
|
options = options.reject { |k, _| [:process, :dont_reauth].include?(k) }
|
@@ -594,7 +594,7 @@ module GoodData
|
|
594
594
|
end
|
595
595
|
|
596
596
|
def scrub_params(params, keys)
|
597
|
-
keys = keys.reduce([]) { |
|
597
|
+
keys = keys.reduce([]) { |acc, elem| acc.concat([elem.to_s, elem.to_sym]) }
|
598
598
|
|
599
599
|
new_params = GoodData::Helpers.deep_dup(params)
|
600
600
|
GoodData::Helpers.hash_dfs(new_params) do |k, _key|
|
@@ -700,7 +700,7 @@ module GoodData
|
|
700
700
|
method = :get
|
701
701
|
GoodData.logger.debug "#{method}: #{url}"
|
702
702
|
|
703
|
-
GoodData::Rest::Connection.retryable(:tries =>
|
703
|
+
GoodData::Rest::Connection.retryable(:tries => ConnectionHelper::GD_MAX_RETRY, :refresh_token => proc { refresh_token }) do
|
704
704
|
raw = {
|
705
705
|
:method => method,
|
706
706
|
:url => url,
|
data/lib/gooddata/version.rb
CHANGED
data/spec/environment/default.rb
CHANGED
@@ -12,6 +12,7 @@ module GoodData
|
|
12
12
|
module Environment
|
13
13
|
module ConnectionHelper
|
14
14
|
set_const :GD_PROJECT_TOKEN, ENV["GD_PROJECT_TOKEN"]
|
15
|
+
set_const :GD_MAX_RETRY, (ENV["GD_MAX_RETRY"] && ENV["GD_MAX_RETRY"].to_i) || 3
|
15
16
|
|
16
17
|
set_const :DEFAULT_USERNAME, "tomas.korcak+gem_tester@gooddata.com"
|
17
18
|
set_const :TEST_USERNAME, "john.doe@gooddata.com"
|
@@ -75,7 +75,7 @@ describe 'Behavior during polling and retries' do
|
|
75
75
|
|
76
76
|
it 'should make 1 additional request when hitting 500' do
|
77
77
|
expect do
|
78
|
-
@client.get('/internal_error')
|
78
|
+
@client.get('/internal_error', :tries => 3)
|
79
79
|
end.to raise_error(RestClient::InternalServerError)
|
80
80
|
expect(a_request(:get, "#{@server}/internal_error")).to have_been_made.times(3)
|
81
81
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gooddata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kolesnikov
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2016-
|
14
|
+
date: 2016-11-30 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -173,20 +173,20 @@ dependencies:
|
|
173
173
|
requirements:
|
174
174
|
- - "~>"
|
175
175
|
- !ruby/object:Gem::Version
|
176
|
-
version: '0.
|
176
|
+
version: '0.45'
|
177
177
|
- - ">="
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version: 0.
|
179
|
+
version: 0.45.0
|
180
180
|
type: :development
|
181
181
|
prerelease: false
|
182
182
|
version_requirements: !ruby/object:Gem::Requirement
|
183
183
|
requirements:
|
184
184
|
- - "~>"
|
185
185
|
- !ruby/object:Gem::Version
|
186
|
-
version: '0.
|
186
|
+
version: '0.45'
|
187
187
|
- - ">="
|
188
188
|
- !ruby/object:Gem::Version
|
189
|
-
version: 0.
|
189
|
+
version: 0.45.0
|
190
190
|
- !ruby/object:Gem::Dependency
|
191
191
|
name: ruby-debug-ide
|
192
192
|
requirement: !ruby/object:Gem::Requirement
|