gooddata 2.0.0-java → 2.0.1-java
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/.gdc-ii-config.yaml +17 -0
- data/.travis.yml +49 -39
- data/CHANGELOG.md +14 -0
- data/Jenkinsfile +1 -14
- data/SDK_VERSION +1 -1
- data/bin/run_brick.rb +12 -28
- data/bin/run_smoke_tests.sh +4 -0
- data/lib/gooddata/bricks/middleware/context_manager.rb +1 -0
- data/lib/gooddata/bricks/middleware/logger_middleware.rb +9 -7
- data/lib/gooddata/connection.rb +3 -6
- data/lib/gooddata/core/logging.rb +1 -27
- data/lib/gooddata/core/{splunk_logger.rb → splunk_logger_decorator.rb} +6 -2
- data/lib/gooddata/helpers/global_helpers.rb +1 -1
- data/lib/gooddata/lcm/lcm2.rb +1 -1
- data/lib/gooddata/rest/connection.rb +30 -29
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 28bd0cc29052ece07bb8eb9abfa0e1034bfa78da004bfd439832274c662faecc
|
|
4
|
+
data.tar.gz: b383f1201f65f1e58aa94148a783481825b40fb093bf17bc17eaf4ae88df490b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9fce66e49b9823b0e2301bd6c29453b47522ce7ebaf234fd34f48c4245e5aeeab8ba201a4e629628a2e9364f668345f91e1f348c64792d7b87f1494726b66614
|
|
7
|
+
data.tar.gz: 94a17567a2dea77d431abd89c7ce7cd1754f08bbe847f87621eb0a5eb838b08ce7021ea12ca7b1240ea71f53b025386aa6e3a9a5d8294c9c5dd3a9ed8c6c45c0
|
data/.gdc-ii-config.yaml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
microservices:
|
|
2
|
+
lcm-bricks:
|
|
3
|
+
docker:
|
|
4
|
+
dockerfile: './Dockerfile'
|
|
5
|
+
argumentsFromFiles:
|
|
6
|
+
BRICKS_VERSION: 'VERSION'
|
|
7
|
+
|
|
8
|
+
integratedTests:
|
|
9
|
+
- env: bash
|
|
10
|
+
path: .
|
|
11
|
+
vault:
|
|
12
|
+
GD_SPEC_PASSWORD: secret/v1/ruby/test/bia_encryption_key
|
|
13
|
+
command: ./bin/run_smoke_tests.sh
|
|
14
|
+
image: harbor.intgdc.com/staging/lcm-bricks:GIT_REV
|
|
15
|
+
repo_mount_dir: /src
|
|
16
|
+
microservices:
|
|
17
|
+
- lcm-bricks
|
data/.travis.yml
CHANGED
|
@@ -20,41 +20,41 @@ jobs:
|
|
|
20
20
|
stage: before-merge
|
|
21
21
|
script: |
|
|
22
22
|
git remote add upstream https://github.com/gooddata/gooddata-ruby.git
|
|
23
|
-
git fetch upstream
|
|
24
|
-
bundle exec pronto run -c upstream/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
23
|
+
git fetch upstream develop
|
|
24
|
+
bundle exec pronto run -c upstream/develop --exit-code
|
|
25
|
+
|
|
26
|
+
- name: unit tests
|
|
27
|
+
stage: before-merge
|
|
28
|
+
script: bundle exec rake test:unit
|
|
29
|
+
rvm:
|
|
30
|
+
- 2.2
|
|
31
|
+
- 2.3
|
|
32
|
+
- 2.4
|
|
33
|
+
- 2.5
|
|
34
|
+
- jruby-1.7.19
|
|
35
|
+
- jruby-9.1.5
|
|
36
|
+
- jruby-9.1.7
|
|
37
|
+
- jruby-9.1.14
|
|
38
|
+
|
|
39
|
+
- name: sdk integration (vcr) tests - base
|
|
40
|
+
stage: before-merge
|
|
41
|
+
script: bundle exec rake test:sdk
|
|
42
|
+
env: VCR_RECORD_MODE=none
|
|
43
|
+
rvm: 2.3
|
|
44
|
+
|
|
45
|
+
- name: sdk integration (vcr) tests - project
|
|
46
|
+
stage: before-merge
|
|
47
|
+
script: bundle exec rake test:project
|
|
48
|
+
env: VCR_RECORD_MODE=none
|
|
49
|
+
rvm: 2.3
|
|
50
|
+
|
|
51
|
+
- name: lcm integration (vcr) tests - e2e
|
|
52
|
+
stage: before-merge
|
|
53
|
+
script: bundle exec rspec spec/lcm/integration/lcm_end_to_end_spec.rb
|
|
54
|
+
env:
|
|
55
|
+
- VCR_RECORD_MODE=none
|
|
56
|
+
- GD_ENV=development
|
|
57
|
+
rvm: 2.3
|
|
58
58
|
|
|
59
59
|
# AFTER MERGE
|
|
60
60
|
# staging 1
|
|
@@ -200,10 +200,20 @@ jobs:
|
|
|
200
200
|
- stage: gem-release
|
|
201
201
|
name: deploy JRuby gem
|
|
202
202
|
rvm: jruby-9.1.14
|
|
203
|
-
script:
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
script: |
|
|
204
|
+
echo -e "---\n:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
|
|
205
|
+
chmod 0600 ~/.gem/credentials
|
|
206
|
+
bundle exec rake gem:release
|
|
207
|
+
- &gem-smoke-test
|
|
208
|
+
stage: gem-release
|
|
209
|
+
name: smoke test MRI gem
|
|
210
|
+
rvm: 2.3
|
|
211
|
+
script: |
|
|
212
|
+
gem install gooddata
|
|
213
|
+
ruby -e "require 'gooddata';GoodData.version"
|
|
214
|
+
- <<: *gem-smoke-test
|
|
215
|
+
name: smoke test JRuby gem
|
|
216
|
+
rvm: jruby-9.1.14
|
|
207
217
|
|
|
208
218
|
notifications:
|
|
209
219
|
email:
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
# GoodData Ruby SDK Changelog
|
|
2
|
+
## 2.0.1
|
|
3
|
+
- Fix pronto branch
|
|
4
|
+
- Fix requiring version.rb
|
|
5
|
+
- TMA-693 fixed problem with logout after timeout
|
|
6
|
+
- fixup! TMA-807: splunk in k8s
|
|
7
|
+
- Revert "Revert "TMA-807: splunkLogger in bricks forwards messages to RemoteSyslogLogger""
|
|
8
|
+
- TMA-807: splunk in k8s
|
|
9
|
+
- Deploy jruby gem automatically
|
|
10
|
+
- Fix code style issue
|
|
11
|
+
- Revert "Fix splunk test"
|
|
12
|
+
- Revert "TMA-807: splunkLogger in bricks forwards messages to RemoteSyslogLogger"
|
|
13
|
+
- Fix splunk test
|
|
14
|
+
- TMA-807: splunkLogger in bricks forwards messages to RemoteSyslogLogger
|
|
15
|
+
|
|
2
16
|
## 2.0.0
|
|
3
17
|
|
|
4
18
|
This is a major version release because the method `.release_info` has been hard-deprecated.
|
data/Jenkinsfile
CHANGED
|
@@ -5,17 +5,4 @@
|
|
|
5
5
|
@Library('pipelines-shared-libs')
|
|
6
6
|
import com.gooddata.pipeline.Pipeline
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
'microservices': [
|
|
10
|
-
'lcm-bricks': [
|
|
11
|
-
'docker': [
|
|
12
|
-
'dockerfile': './Dockerfile',
|
|
13
|
-
'arguments': [
|
|
14
|
-
'BRICKS_VERSION': { readFile('./VERSION').trim() }
|
|
15
|
-
]
|
|
16
|
-
]
|
|
17
|
-
]
|
|
18
|
-
]
|
|
19
|
-
]
|
|
20
|
-
|
|
21
|
-
Pipeline.get(this, config).run()
|
|
8
|
+
Pipeline.resolve(this).run()
|
data/SDK_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.0.
|
|
1
|
+
2.0.1
|
data/bin/run_brick.rb
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
require 'remote_syslog_logger'
|
|
4
3
|
require_relative '../lib/gooddata'
|
|
5
4
|
|
|
6
5
|
DEFAULT_BRICK = 'hello_world_brick'
|
|
@@ -9,34 +8,19 @@ HIDDEN_BRICK_PARAMS_PREFIX = 'HIDDEN_BRICK_PARAM_'
|
|
|
9
8
|
|
|
10
9
|
brick_type = !ARGV.empty? ? ARGV[0] : DEFAULT_BRICK
|
|
11
10
|
|
|
12
|
-
syslog_node = ENV['NODE_NAME']
|
|
13
|
-
log = RemoteSyslogLogger.new(syslog_node, 514, :program => "ruby_#{brick_type}", :facility => 'local2')
|
|
14
|
-
|
|
15
|
-
log.info "action=#{brick_type}_execution status=init"
|
|
16
|
-
|
|
17
11
|
def get_brick_params(prefix)
|
|
18
12
|
ENV.select { |k,| k.to_s.match(/^#{prefix}.*/) }.map { |k, v| [k.slice(prefix.length..-1), v] }.to_h
|
|
19
13
|
end
|
|
20
14
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
log.info "action=#{brick_type}_execution status=start commit_hash=#{commit_hash} execution_id=#{execution_id}"
|
|
34
|
-
@brick_result = brick_pipeline.call(params)
|
|
35
|
-
log.info "action=#{brick_type}_execution status=finished"
|
|
36
|
-
rescue NoMethodError => e
|
|
37
|
-
log.info "action=#{brick_type}_execution status=error Invalid brick type '#{brick_type}', #{e.message}"
|
|
38
|
-
raise e
|
|
39
|
-
rescue StandardError => e
|
|
40
|
-
log.info "action=#{brick_type}_execution status=error #{e.message}"
|
|
41
|
-
raise e
|
|
42
|
-
end
|
|
15
|
+
brick_pipeline = GoodData::Bricks::Pipeline.send("#{brick_type}_pipeline")
|
|
16
|
+
normal_params = get_brick_params(BRICK_PARAM_PREFIX)
|
|
17
|
+
hidden_params = get_brick_params(HIDDEN_BRICK_PARAMS_PREFIX)
|
|
18
|
+
params = normal_params.merge(hidden_params)
|
|
19
|
+
|
|
20
|
+
params['values_to_mask'] = hidden_params.values
|
|
21
|
+
commit_hash = ENV['GOODDATA_RUBY_COMMIT'] || ''
|
|
22
|
+
execution_id = ENV['GDC_EXECUTION_ID']
|
|
23
|
+
params['gooddata_ruby_commit'] = commit_hash
|
|
24
|
+
params['GDC_LOG_DIRECTORY'] = ENV['GDC_LOG_DIRECTORY'] || '/tmp/'
|
|
25
|
+
params['GDC_EXECUTION_ID'] = execution_id
|
|
26
|
+
brick_pipeline.call(params)
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
|
6
6
|
|
|
7
7
|
require 'logger'
|
|
8
|
-
require 'gooddata/core/
|
|
8
|
+
require 'gooddata/core/splunk_logger_decorator'
|
|
9
9
|
|
|
10
10
|
require 'gooddata/extensions/true'
|
|
11
11
|
require 'gooddata/extensions/false'
|
|
@@ -13,6 +13,8 @@ require 'gooddata/extensions/integer'
|
|
|
13
13
|
require 'gooddata/extensions/string'
|
|
14
14
|
require 'gooddata/extensions/nil'
|
|
15
15
|
|
|
16
|
+
require 'remote_syslog_logger'
|
|
17
|
+
|
|
16
18
|
using TrueExtensions
|
|
17
19
|
using FalseExtensions
|
|
18
20
|
using IntegerExtensions
|
|
@@ -47,20 +49,20 @@ module GoodData
|
|
|
47
49
|
params['GDC_LOGGER'] = logger
|
|
48
50
|
GoodData.logging_http_on if params['HTTP_LOGGING'] && params['HTTP_LOGGING'].to_b
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
if params['SPLUNK_LOGGING'] && params['SPLUNK_LOGGING'].to_b
|
|
52
|
+
unless params['NO_SPLUNK_LOGGING'] && params['NO_SPLUNK_LOGGING'].to_b
|
|
52
53
|
GoodData.logger.info "Statistics collecting is turned ON. All the data is anonymous."
|
|
53
|
-
|
|
54
|
+
# NODE_NAME is set up by k8s execmgr
|
|
55
|
+
syslog_node = ENV['NODE_NAME']
|
|
56
|
+
splunk_file_logger = syslog_node ? RemoteSyslogLogger.new(syslog_node, 514, program: "lcm_ruby_brick", facility: 'local2') : Logger.new(STDOUT)
|
|
57
|
+
splunk_logger = SplunkLoggerDecorator.new splunk_file_logger
|
|
54
58
|
splunk_logger.level = params['SPLUNK_LOG_LEVEL'] || GoodData::DEFAULT_SPLUNKLOG_LEVEL
|
|
55
59
|
splunk_logger = splunk_logger.extend(ContextLoggerDecorator)
|
|
56
60
|
splunk_logger.context_source = GoodData.gd_logger
|
|
57
61
|
values_to_mask = params['values_to_mask'] || []
|
|
58
62
|
values_to_mask.concat MaskLoggerDecorator.extract_values params
|
|
59
63
|
splunk_logger = MaskLoggerDecorator.new(splunk_logger, values_to_mask) if values_to_mask.any?
|
|
60
|
-
|
|
61
|
-
splunk_logger = NilLogger.new
|
|
64
|
+
GoodData.splunk_logging_on splunk_logger
|
|
62
65
|
end
|
|
63
|
-
GoodData.splunk_logging_on splunk_logger
|
|
64
66
|
|
|
65
67
|
# Initialize context: Execution ID
|
|
66
68
|
GoodData.gd_logger.execution_id = params['GDC_EXECUTION_ID'] || SecureRandom.urlsafe_base64(16)
|
data/lib/gooddata/connection.rb
CHANGED
|
@@ -42,12 +42,9 @@ module GoodData
|
|
|
42
42
|
Rest::Client.disconnect
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
def with_connection(options = nil, second_options = nil, third_options = {}, &
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
rescue Exception => e # rubocop:disable RescueException
|
|
49
|
-
GoodData.logger.error(e.message)
|
|
50
|
-
raise e
|
|
45
|
+
def with_connection(options = nil, second_options = nil, third_options = {}, &block)
|
|
46
|
+
client = connect(options, second_options, third_options)
|
|
47
|
+
block.call(client)
|
|
51
48
|
ensure
|
|
52
49
|
disconnect
|
|
53
50
|
end
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
require 'rest-client'
|
|
8
8
|
|
|
9
9
|
require_relative 'nil_logger'
|
|
10
|
-
require_relative '
|
|
10
|
+
require_relative 'splunk_logger_decorator'
|
|
11
11
|
require_relative 'gd_logger'
|
|
12
12
|
|
|
13
13
|
module GoodData
|
|
@@ -21,7 +21,6 @@ module GoodData
|
|
|
21
21
|
|
|
22
22
|
DEFAULT_SPLUNKLOG_LEVEL = Logger::INFO
|
|
23
23
|
DEFAULT_SPLUNKLOG_OUTPUT = STDERR
|
|
24
|
-
DEFAULT_SPLUNKLOGGER_CLASS = SplunkLogger
|
|
25
24
|
|
|
26
25
|
class << self
|
|
27
26
|
attr_accessor :logger, :rest_logger, :gd_logger
|
|
@@ -46,12 +45,6 @@ module GoodData
|
|
|
46
45
|
@logger
|
|
47
46
|
end
|
|
48
47
|
|
|
49
|
-
# Turn logging on
|
|
50
|
-
#
|
|
51
|
-
# ### Example
|
|
52
|
-
#
|
|
53
|
-
# GoodData.logging_off
|
|
54
|
-
#
|
|
55
48
|
def logging_off
|
|
56
49
|
@logger = NilLogger.new
|
|
57
50
|
end
|
|
@@ -60,24 +53,12 @@ module GoodData
|
|
|
60
53
|
!@logger.instance_of?(NilLogger)
|
|
61
54
|
end
|
|
62
55
|
|
|
63
|
-
# Turn logging on with HTTP included
|
|
64
|
-
#
|
|
65
|
-
# ### Example
|
|
66
|
-
#
|
|
67
|
-
# GoodData.logging_http_on
|
|
68
|
-
#
|
|
69
56
|
def logging_http_on(level = DEFAULT_RESTLOG_LEVEL, output = DEFAULT_RESTLOG_OUTPUT, klass = DEFAULT_RESTLOGGER_CLASS)
|
|
70
57
|
@rest_logger = klass.new(output)
|
|
71
58
|
@rest_logger.level = level
|
|
72
59
|
@rest_logger
|
|
73
60
|
end
|
|
74
61
|
|
|
75
|
-
# Turn logging on
|
|
76
|
-
#
|
|
77
|
-
# ### Example
|
|
78
|
-
#
|
|
79
|
-
# GoodData.logging_http_off
|
|
80
|
-
#
|
|
81
62
|
def logging_http_off
|
|
82
63
|
@rest_logger = NilLogger.new
|
|
83
64
|
end
|
|
@@ -86,17 +67,10 @@ module GoodData
|
|
|
86
67
|
!@rest_logger.instance_of?(NilLogger)
|
|
87
68
|
end
|
|
88
69
|
|
|
89
|
-
# Turn splunk logging on
|
|
90
70
|
def splunk_logging_on(logger)
|
|
91
71
|
gd_logger.logging_on :splunk, logger
|
|
92
72
|
end
|
|
93
73
|
|
|
94
|
-
# Turn splunk logging off
|
|
95
|
-
#
|
|
96
|
-
# ### Example
|
|
97
|
-
#
|
|
98
|
-
# GoodData.logging_splunk_off
|
|
99
|
-
#
|
|
100
74
|
def splunk_logging_off
|
|
101
75
|
gd_logger.logging_off :splunk
|
|
102
76
|
end
|
|
@@ -6,7 +6,11 @@ require 'logger'
|
|
|
6
6
|
|
|
7
7
|
module GoodData
|
|
8
8
|
# Logger that process given message to format readable by splunk
|
|
9
|
-
class
|
|
9
|
+
class SplunkLoggerDecorator < Logger
|
|
10
|
+
def initialize(logger = Logger)
|
|
11
|
+
@logger = logger
|
|
12
|
+
end
|
|
13
|
+
|
|
10
14
|
def hash_to_string(hash)
|
|
11
15
|
hash.map { |pair| " #{pair[0]}=#{pair[1]}" }.join ""
|
|
12
16
|
end
|
|
@@ -17,7 +21,7 @@ module GoodData
|
|
|
17
21
|
def add(severity, message = nil, progname = nil)
|
|
18
22
|
message = hash_to_string(message) if message.is_a? Hash
|
|
19
23
|
progname = hash_to_string(progname) if progname.is_a? Hash
|
|
20
|
-
|
|
24
|
+
@logger.add(severity, message, progname) unless (progname && progname.chomp == '') || (message && message.chomp == '')
|
|
21
25
|
end
|
|
22
26
|
end
|
|
23
27
|
end
|
|
@@ -33,7 +33,7 @@ module GoodData
|
|
|
33
33
|
include Hashie::Extensions::DeepMerge
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
set_const :GD_MAX_RETRY, (ENV['GD_MAX_RETRY'] && ENV['GD_MAX_RETRY'].to_i) ||
|
|
36
|
+
set_const :GD_MAX_RETRY, (ENV['GD_MAX_RETRY'] && ENV['GD_MAX_RETRY'].to_i) || 12
|
|
37
37
|
|
|
38
38
|
class << self
|
|
39
39
|
def error(msg)
|
data/lib/gooddata/lcm/lcm2.rb
CHANGED
|
@@ -369,7 +369,7 @@ module GoodData
|
|
|
369
369
|
def run_action(action, params)
|
|
370
370
|
begin
|
|
371
371
|
GoodData.gd_logger.start_action action, GoodData.gd_logger
|
|
372
|
-
GoodData.
|
|
372
|
+
GoodData.gd_logger.info("Running #{action.name} action ...")
|
|
373
373
|
params.clear_filters
|
|
374
374
|
# Check if all required parameters were passed
|
|
375
375
|
BaseAction.check_params(action.const_get('PARAMS'), params)
|
|
@@ -57,7 +57,6 @@ module GoodData
|
|
|
57
57
|
Timeout::Error
|
|
58
58
|
]
|
|
59
59
|
|
|
60
|
-
RETRIES_ON_TOO_MANY_REQUESTS_ERROR = 12
|
|
61
60
|
RETRY_TIME_INITIAL_VALUE = 1
|
|
62
61
|
RETRY_TIME_COEFFICIENT = 1.5
|
|
63
62
|
RETRYABLE_ERRORS << Net::ReadTimeout if Net.const_defined?(:ReadTimeout)
|
|
@@ -86,11 +85,10 @@ module GoodData
|
|
|
86
85
|
|
|
87
86
|
# Retry block if exception thrown
|
|
88
87
|
def retryable(options = {}, &_block)
|
|
89
|
-
opts = { :tries =>
|
|
88
|
+
opts = { :tries => 12, :on => RETRYABLE_ERRORS }.merge(options)
|
|
90
89
|
|
|
91
90
|
retry_exception = opts[:on]
|
|
92
91
|
retries = opts[:tries]
|
|
93
|
-
too_many_requests_tries = RETRIES_ON_TOO_MANY_REQUESTS_ERROR
|
|
94
92
|
|
|
95
93
|
unless retry_exception.is_a?(Array)
|
|
96
94
|
retry_exception = [retry_exception]
|
|
@@ -102,17 +100,23 @@ module GoodData
|
|
|
102
100
|
rescue RestClient::Unauthorized, RestClient::Forbidden => e # , RestClient::Unauthorized => e
|
|
103
101
|
raise e unless options[:refresh_token]
|
|
104
102
|
raise e if options[:dont_reauth]
|
|
103
|
+
|
|
105
104
|
options[:refresh_token].call # (dont_reauth: true)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
if (retries -= 1) > 0
|
|
106
|
+
retry
|
|
107
|
+
else
|
|
108
|
+
fail e
|
|
109
|
+
end
|
|
110
|
+
rescue RestClient::TooManyRequests, RestClient::ServiceUnavailable, *retry_exception => e
|
|
111
|
+
GoodData.logger.warn "#{e.message}, retrying in #{retry_time} seconds"
|
|
109
112
|
sleep retry_time
|
|
110
113
|
retry_time *= RETRY_TIME_COEFFICIENT
|
|
111
114
|
# 10 requests with 1.5 coefficent should take ~ 3 mins to finish
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
if (retries -= 1) > 0
|
|
116
|
+
retry
|
|
117
|
+
else
|
|
118
|
+
fail e
|
|
119
|
+
end
|
|
116
120
|
end
|
|
117
121
|
yield
|
|
118
122
|
end
|
|
@@ -212,9 +216,14 @@ module GoodData
|
|
|
212
216
|
|
|
213
217
|
begin
|
|
214
218
|
clear_session_id
|
|
215
|
-
delete(url, :x_gdc_authsst => sst_token) if url
|
|
219
|
+
delete(url, :x_gdc_authsst => sst_token, :tries => 0) if url
|
|
216
220
|
rescue RestClient::Unauthorized
|
|
217
|
-
|
|
221
|
+
begin
|
|
222
|
+
refresh_token
|
|
223
|
+
delete(url, :x_gdc_authsst => sst_token, :tries => 0) if url
|
|
224
|
+
rescue RestClient::Unauthorized
|
|
225
|
+
GoodData.logger.info 'Already disconnected'
|
|
226
|
+
end
|
|
218
227
|
end
|
|
219
228
|
|
|
220
229
|
@auth = nil
|
|
@@ -337,20 +346,15 @@ module GoodData
|
|
|
337
346
|
profile method.to_s.upcase, uri, request_id, stats_on do
|
|
338
347
|
b = proc do
|
|
339
348
|
params = fresh_request_params(request_id).merge(options)
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
@server[uri].post(payload, params)
|
|
350
|
-
end
|
|
351
|
-
rescue RestClient::Exception => e
|
|
352
|
-
log_error(e, uri, params, options)
|
|
353
|
-
raise e
|
|
349
|
+
case method
|
|
350
|
+
when :get
|
|
351
|
+
@server[uri].get(params, &user_block)
|
|
352
|
+
when :put
|
|
353
|
+
@server[uri].put(payload, params)
|
|
354
|
+
when :delete
|
|
355
|
+
@server[uri].delete(params)
|
|
356
|
+
when :post
|
|
357
|
+
@server[uri].post(payload, params)
|
|
354
358
|
end
|
|
355
359
|
end
|
|
356
360
|
process_response(options, &b)
|
|
@@ -589,9 +593,6 @@ ERR
|
|
|
589
593
|
fail "Unsupported response content type '%s':\n%s" % [content_type, response.to_str[0..127]]
|
|
590
594
|
end
|
|
591
595
|
result
|
|
592
|
-
rescue RestClient::Exception => e
|
|
593
|
-
GoodData.logger.error "Response: #{e.response}"
|
|
594
|
-
raise $ERROR_INFO
|
|
595
596
|
end
|
|
596
597
|
|
|
597
598
|
def profile(method, path, request_id, stats_on, &block)
|
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: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: java
|
|
6
6
|
authors:
|
|
7
7
|
- Pavel Kolesnikov
|
|
@@ -14,7 +14,7 @@ authors:
|
|
|
14
14
|
autorequire:
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
|
-
date: 2019-02-
|
|
17
|
+
date: 2019-02-25 00:00:00.000000000 Z
|
|
18
18
|
dependencies:
|
|
19
19
|
- !ruby/object:Gem::Dependency
|
|
20
20
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -474,6 +474,7 @@ executables:
|
|
|
474
474
|
- release.sh
|
|
475
475
|
- rollout.sh
|
|
476
476
|
- run_brick.rb
|
|
477
|
+
- run_smoke_tests.sh
|
|
477
478
|
- test_projects_cleanup.rb
|
|
478
479
|
- user_filters.sh
|
|
479
480
|
- users.sh
|
|
@@ -486,6 +487,7 @@ files:
|
|
|
486
487
|
- ".document"
|
|
487
488
|
- ".editorconfig"
|
|
488
489
|
- ".flayignore"
|
|
490
|
+
- ".gdc-ii-config.yaml"
|
|
489
491
|
- ".gitignore"
|
|
490
492
|
- ".pronto.yml"
|
|
491
493
|
- ".rspec"
|
|
@@ -520,6 +522,7 @@ files:
|
|
|
520
522
|
- bin/release.sh
|
|
521
523
|
- bin/rollout.sh
|
|
522
524
|
- bin/run_brick.rb
|
|
525
|
+
- bin/run_smoke_tests.sh
|
|
523
526
|
- bin/test_projects_cleanup.rb
|
|
524
527
|
- bin/user_filters.sh
|
|
525
528
|
- bin/users.sh
|
|
@@ -597,7 +600,7 @@ files:
|
|
|
597
600
|
- lib/gooddata/core/nil_logger.rb
|
|
598
601
|
- lib/gooddata/core/project.rb
|
|
599
602
|
- lib/gooddata/core/rest.rb
|
|
600
|
-
- lib/gooddata/core/
|
|
603
|
+
- lib/gooddata/core/splunk_logger_decorator.rb
|
|
601
604
|
- lib/gooddata/core/user.rb
|
|
602
605
|
- lib/gooddata/data/data.rb
|
|
603
606
|
- lib/gooddata/data/guesser.rb
|