gooddata 2.1.6-java → 2.1.7-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 228eeafcac390141795148cdf515ceb289d8b13a43a9d8d9a5edd7c22d093642
4
- data.tar.gz: 1c0058f63ef64dafd429ddb7a9536a2c83c079fdb8045947f7cad9696d43e209
3
+ metadata.gz: 63f952c3c47f2ec63afa90a1b47d9d859506c9463f5b123b9b445e8c76bb23b3
4
+ data.tar.gz: a4b96e6471def8248af6ddc6bcf1dffcb3dbb7b686821ec010ae7ba2684d6041
5
5
  SHA512:
6
- metadata.gz: a609f5476e3a2fae2678843155f44886a9dfd77c8f07349703780bb139e0e83e0f7f5f80223f0af9012a4dfe2573a921687055347da67c0e7d335270160694c3
7
- data.tar.gz: 39c0adb1495ce138d69f960325f820cbc47438bc2e3c108e44556032154526ac9a9adbdb5514f541c688c00079fe1cfe94c47b552c25fe23d420c6c24de80e83
6
+ metadata.gz: 806a086561c697cbefa90efc4f3207723939ec99b983b9fd2f0ab72480bc794b62acf8af053af9aa76a62f779a03d881778e6d52590d98a715e3efbf26abe119
7
+ data.tar.gz: e0ee983afa9c57a18242ba10ed0ea5495a2d5411d89b3d62bb87ffc7a12a9d363cf55638d5ff3f9062b9d7761498360237436b0598c92e9b57e8ffe55a4db40d
@@ -6,10 +6,11 @@ microservices:
6
6
  BRICKS_VERSION: 'VERSION'
7
7
 
8
8
  integratedTests:
9
- - env: bash
9
+ - kind: 'image'
10
+ env: bash
10
11
  path: .
11
12
  vault:
12
- GD_SPEC_PASSWORD: ruby/test/bia_encryption_key
13
+ GD_SPEC_PASSWORD: "$VAULT_SPECIAL_PREFIX/ruby-test-bia-encryption-key"
13
14
  command: ./bin/run_smoke_tests.sh
14
15
  image: harbor.intgdc.com/staging/lcm-bricks:GIT_REV
15
16
  repo_mount_dir: /src
@@ -1,3 +1,6 @@
1
+ all:
2
+ exclude:
3
+ - 'spec/**/*'
1
4
  verbose: true
2
5
  github:
3
6
  slug: gooddata/gooddata-ruby
@@ -1,4 +1,16 @@
1
1
  # GoodData Ruby SDK Changelog
2
+ ## 2.1.7
3
+ - BUGFIX: TMA-1577 Bump brick version to 3.7.9
4
+ - FEATURE: MSF-16279 Allow gooddata-ruby to be installed with Rails 6 apps
5
+ - BUGFIX: TMA-1580 Increase java heap space and logging loading rows
6
+ - BUGFIX: TMA-1577 fix user group cache
7
+ - BUGFIX: TMA-1589 K8s bricks don't propagate errors to execution log
8
+ - BUGFIX: TMA-1571 Users Brick fails when segments_filter is used
9
+ - BUGFIX: TMA-1569 Don't create MUF when all its value is NULL
10
+ - II-603: Start using new NGVault secret paths
11
+ - II-550: Update structure of integrated tests
12
+ - CONFIG: TMA-1555 Separate test results for sdk and project test
13
+
2
14
  ## 2.1.6
3
15
  - FEATURE: TMA-783 Use SST for ADS connection as default
4
16
  - BUGFIX: TMA-1549 Using valid sso provider during testing update users
@@ -1 +1 @@
1
- 2.1.6
1
+ 2.1.7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.7.4
1
+ 3.7.9
@@ -33,7 +33,9 @@ begin
33
33
  params['GDC_EXECUTION_ID'] = execution_id
34
34
  log.info "action=#{brick_type}_execution status=start commit_hash=#{commit_hash} execution_id=#{execution_id}"
35
35
  brick_pipeline.call(params)
36
- rescue StandardError => e
36
+ rescue Exception => e # rubocop:disable RescueException
37
+ execution_log = GoodData.logger
38
+ execution_log.error "Execution failed. Message: #{e.message}. Error: #{e}" unless execution_log.nil?
37
39
  log.info "action=#{brick_type}_execution status=failed commit_hash=#{commit_hash} execution_id=#{execution_id} exception=#{e}"
38
40
  raise
39
41
  end
@@ -1,3 +1,5 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ export JRUBY_OPTS=-J-Xmx2560m
4
+
3
5
  /bin/bash -l -c "bundle exec ./bin/run_brick.rb users_brick"
@@ -54,7 +54,7 @@ Gem::Specification.new do |s|
54
54
 
55
55
  s.add_development_dependency 'sqlite3' if RUBY_PLATFORM != 'java'
56
56
 
57
- s.add_dependency 'activesupport', '> 4.2.9', '< 5.2'
57
+ s.add_dependency 'activesupport', '> 4.2.9', '< 6.1'
58
58
 
59
59
  s.add_dependency 'aws-sdk-s3', '~> 1.16'
60
60
  s.add_dependency 'docile', '~> 1.1'
@@ -45,7 +45,8 @@ module GoodData
45
45
  logger.level = params['GDC_LOG_LEVEL'] || 'info'
46
46
  end
47
47
  GoodData.logger = logger
48
- logger.info('Pipeline starts')
48
+ request_id = params.include?('GDC_REQUEST_ID') ? ", request_id=#{params['GDC_REQUEST_ID']}" : ''
49
+ logger.info("Pipeline starts #{request_id}")
49
50
  params['GDC_LOGGER'] = logger
50
51
  GoodData.logging_http_on if params['HTTP_LOGGING'] && params['HTTP_LOGGING'].to_b
51
52
 
@@ -30,8 +30,8 @@ module GoodData
30
30
 
31
31
  def self.users_brick_pipeline
32
32
  prepare([
33
- DecodeParamsMiddleware,
34
33
  LoggerMiddleware,
34
+ DecodeParamsMiddleware,
35
35
  BenchMiddleware,
36
36
  GoodDataMiddleware,
37
37
  AWSMiddleware,
@@ -42,8 +42,8 @@ module GoodData
42
42
 
43
43
  def self.user_filters_brick_pipeline
44
44
  prepare([
45
- DecodeParamsMiddleware,
46
45
  LoggerMiddleware,
46
+ DecodeParamsMiddleware,
47
47
  BenchMiddleware,
48
48
  GoodDataMiddleware,
49
49
  AWSMiddleware,
@@ -55,8 +55,8 @@ module GoodData
55
55
 
56
56
  def self.release_brick_pipeline
57
57
  prepare([
58
- DecodeParamsMiddleware,
59
58
  LoggerMiddleware,
59
+ DecodeParamsMiddleware,
60
60
  BenchMiddleware,
61
61
  GoodDataMiddleware,
62
62
  AWSMiddleware,
@@ -67,8 +67,8 @@ module GoodData
67
67
 
68
68
  def self.provisioning_brick_pipeline
69
69
  prepare([
70
- DecodeParamsMiddleware,
71
70
  LoggerMiddleware,
71
+ DecodeParamsMiddleware,
72
72
  BenchMiddleware,
73
73
  GoodDataMiddleware,
74
74
  AWSMiddleware,
@@ -79,8 +79,8 @@ module GoodData
79
79
 
80
80
  def self.rollout_brick_pipeline
81
81
  prepare([
82
- DecodeParamsMiddleware,
83
82
  LoggerMiddleware,
83
+ DecodeParamsMiddleware,
84
84
  BenchMiddleware,
85
85
  GoodDataMiddleware,
86
86
  AWSMiddleware,
@@ -92,8 +92,8 @@ module GoodData
92
92
  def self.hello_world_brick_pipeline
93
93
  prepare(
94
94
  [
95
- DecodeParamsMiddleware,
96
95
  LoggerMiddleware,
96
+ DecodeParamsMiddleware,
97
97
  BenchMiddleware,
98
98
  HelloWorldBrick
99
99
  ]
@@ -103,8 +103,8 @@ module GoodData
103
103
  def self.help_brick_pipeline
104
104
  prepare(
105
105
  [
106
- DecodeParamsMiddleware,
107
106
  LoggerMiddleware,
107
+ DecodeParamsMiddleware,
108
108
  BenchMiddleware,
109
109
  HelpBrick
110
110
  ]
@@ -251,7 +251,8 @@ module GoodData
251
251
  project.import_users(users, common_params)
252
252
  end
253
253
  when 'sync_domain_client_workspaces'
254
- domain_clients = domain.clients(:all, data_product)
254
+ all_domain_clients = domain.clients(:all, data_product)
255
+ domain_clients = all_domain_clients
255
256
  if params.segments
256
257
  segment_uris = params.segments.map(&:uri)
257
258
  domain_clients = domain_clients.select { |c| segment_uris.include?(c.segment_uri) }
@@ -262,7 +263,13 @@ module GoodData
262
263
  fail "Client id cannot be empty" if client_id.blank?
263
264
 
264
265
  c = domain_clients.detect { |specific_client| specific_client.id == client_id }
265
- fail "The client \"#{client_id}\" does not exist in data product \"#{data_product.data_product_id}\"" if c.nil?
266
+ if c.nil?
267
+ filtered_client = all_domain_clients.detect { |f_client| f_client.id == client_id }
268
+ fail "The client \"#{client_id}\" does not exist in data product \"#{data_product.data_product_id}\"" if filtered_client.nil?
269
+
270
+ GoodData.logger.info("Client \"#{client_id}\" is not belong to filtered segments")
271
+ next
272
+ end
266
273
 
267
274
  if params.segments && !segment_uris.include?(c.segment_uri)
268
275
  GoodData.logger.info("Client #{client_id} is outside segments_filter #{params.segments}")
@@ -347,7 +354,12 @@ module GoodData
347
354
  tmp = without_check(PARAMS, params) do
348
355
  File.open(data_source.realize(params), 'r:UTF-8')
349
356
  end
350
- data = CSV.read(tmp, headers: true)
357
+
358
+ begin
359
+ data = read_csv_file(tmp)
360
+ rescue Exception => e # rubocop:disable RescueException
361
+ fail "There was an error during loading users from csv file. Message: #{e.message}. Error: #{e}"
362
+ end
351
363
  end
352
364
 
353
365
  data.map do |row|
@@ -387,6 +399,30 @@ module GoodData
387
399
  }
388
400
  end
389
401
  end
402
+
403
+ def read_csv_file(path)
404
+ GoodData.logger.info('Start reading csv file')
405
+ res = []
406
+ row_count = 0
407
+
408
+ CSV.foreach(path, :headers => true) do |row|
409
+ if block_given?
410
+ data = yield row
411
+ else
412
+ data = row
413
+ end
414
+
415
+ if data
416
+ row_count += 1
417
+ res << data
418
+ end
419
+
420
+ GoodData.logger.info("Read #{row_count} rows") if (row_count % 50_000).zero?
421
+ end
422
+
423
+ GoodData.logger.info("Done reading csv file, total #{row_count} rows")
424
+ res
425
+ end
390
426
  end
391
427
  end
392
428
  end
@@ -315,7 +315,7 @@ module GoodData
315
315
  # Invoke action
316
316
  begin
317
317
  out = run_action action, params
318
- rescue => e
318
+ rescue Exception => e # rubocop:disable RescueException
319
319
  errors << {
320
320
  action: action,
321
321
  err: e,
@@ -1611,7 +1611,7 @@ module GoodData
1611
1611
  whitelisted_new_users, whitelisted_users = whitelist_users(new_users.map(&:to_hash), users_list, options[:whitelists])
1612
1612
 
1613
1613
  # First check that if groups are provided we have them set up
1614
- options[:user_groups_cache] = check_groups(new_users.map(&:to_hash).flat_map { |u| u[:user_group] || [] }.uniq, options[:user_groups_cache], options)
1614
+ user_groups_cache = check_groups(new_users.map(&:to_hash).flat_map { |u| u[:user_group] || [] }.uniq, options[:user_groups_cache], options)
1615
1615
 
1616
1616
  # conform the role on list of new users so we can diff them with the users coming from the project
1617
1617
  diffable_new_with_default_role = whitelisted_new_users.map do |u|
@@ -1707,11 +1707,17 @@ module GoodData
1707
1707
  end
1708
1708
  mappings.group_by { |_, g| g }.each do |g, mapping|
1709
1709
  remote_users = mapping.map { |user, _| user }.map { |login| users_lookup[login] && users_lookup[login].uri }.reject(&:nil?)
1710
+ GoodData.logger.info("Assigning users #{remote_users} to group #{g}")
1710
1711
  next if remote_users.empty?
1711
- user_groups(g).set_members(remote_users)
1712
+ existing_group = user_groups(g)
1713
+ if existing_group.nil?
1714
+ GoodData.logger.warn("Group #{g} not found!!!")
1715
+ else
1716
+ existing_group.set_members(remote_users)
1717
+ end
1712
1718
  end
1713
1719
  mentioned_groups = mappings.map(&:last).uniq
1714
- groups_to_cleanup = options[:user_groups_cache].reject { |g| mentioned_groups.include?(g.name) }
1720
+ groups_to_cleanup = user_groups_cache.reject { |g| mentioned_groups.include?(g.name) }
1715
1721
  # clean all groups not mentioned with exception of whitelisted users
1716
1722
  groups_to_cleanup.each do |g|
1717
1723
  g.set_members(whitelist_users(g.members.map(&:to_hash), [], options[:whitelists], :include).first.map { |x| x[:uri] })
@@ -1750,11 +1756,12 @@ module GoodData
1750
1756
  end
1751
1757
 
1752
1758
  def check_groups(specified_groups, user_groups_cache = nil, options = {})
1753
- user_groups_cache = user_groups if user_groups_cache.nil? || user_groups_cache.empty?
1754
- groups = user_groups_cache.map(&:name)
1759
+ current_user_groups = user_groups if user_groups_cache.nil? || user_groups_cache.empty?
1760
+ groups = current_user_groups.map(&:name)
1755
1761
  missing_groups = specified_groups - groups
1756
1762
  if options[:create_non_existing_user_groups]
1757
1763
  missing_groups.each do |g|
1764
+ GoodData.logger.info("Creating group #{g}")
1758
1765
  create_group(name: g, description: g)
1759
1766
  end
1760
1767
  else
@@ -1764,7 +1771,7 @@ module GoodData
1764
1771
  "#{groups.join(',')} and you asked for #{missing_groups.join(',')}"
1765
1772
  end
1766
1773
  end
1767
- user_groups_cache
1774
+ current_user_groups
1768
1775
  end
1769
1776
 
1770
1777
  # Update user
@@ -1778,7 +1785,8 @@ module GoodData
1778
1785
  payload = generate_user_payload(user_uri, 'ENABLED', roles)
1779
1786
  res = client.post(url, payload)
1780
1787
  failure = GoodData::Helpers.get_path(res, %w(projectUsersUpdateResult failed))
1781
- fail ArgumentError, "User #{user_uri} could not be aded. #{failure.first['message']}" unless failure.blank?
1788
+ fail ArgumentError, "User #{user_uri} could not be added. #{failure.first['message']}" unless failure.blank?
1789
+
1782
1790
  res
1783
1791
  end
1784
1792
  alias_method :add_user, :set_user_roles
@@ -199,16 +199,6 @@ module GoodData
199
199
  attr_cache
200
200
  end
201
201
 
202
- def self.create_muf_expression_cache(filters)
203
- filters.reduce({}) do |a, e|
204
- a[e[:login]] = e[:filters].reduce({}) do |h, filter|
205
- h[filter[:label]] = :none
206
- h
207
- end
208
- a
209
- end
210
- end
211
-
212
202
  # Walks over provided labels and picks those that have fewer than certain amount of values
213
203
  # This tries to balance for speed when working with small datasets (like users)
214
204
  # so it precaches the values and still be able to function for larger ones even
@@ -223,9 +213,12 @@ module GoodData
223
213
  # @param lookups_cache e.g. { 'label_uri': { "jirka@gooddata.com": 'value_uri' }}
224
214
  def self.create_expression(filter, labels_cache, lookups_cache, attr_cache, options = {})
225
215
  values = filter[:values]
216
+ # Do not create MUF for label when all its values is NULL (https://jira.intgdc.com/browse/TMA-1361)
217
+ non_null_values = values.select { |value| !value.nil? && value.downcase != 'null' }
218
+ return ['TRUE', []] if non_null_values.empty?
219
+
226
220
  label = labels_cache[filter[:label]]
227
221
  errors = []
228
- muf_expression_cache = options[:muf_expression_cache]
229
222
 
230
223
  element_uris_by_values = Hash[values.map do |v|
231
224
  if lookups_cache.key?(label.uri)
@@ -254,12 +247,7 @@ module GoodData
254
247
  # as the proper MUF can not be constructed yet
255
248
  case options[:type]
256
249
  when :muf
257
- muf_expression_cache[filter[:label]] = :all
258
- if muf_expression_cache.value?(:none) || muf_expression_cache.value?(:restrict)
259
- 'TRUE'
260
- else
261
- '1 <> 1'
262
- end
250
+ '1 <> 1'
263
251
  when :variable
264
252
  nil
265
253
  end
@@ -267,12 +255,10 @@ module GoodData
267
255
  # create a filter that is always true to ensure the user can see all data
268
256
  'TRUE'
269
257
  elsif filter[:over] && filter[:to]
270
- muf_expression_cache[filter[:label]] = :restrict
271
258
  over = attr_cache[filter[:over]]
272
259
  to = attr_cache[filter[:to]]
273
260
  "([#{label.attribute_uri}] IN (#{element_uris.sort.map { |e| '[' + e + ']' }.join(', ')})) OVER [#{over && over.uri}] TO [#{to && to.uri}]"
274
261
  else
275
- muf_expression_cache[filter[:label]] = :restrict
276
262
  "[#{label.attribute_uri}] IN (#{element_uris.sort.map { |e| '[' + e + ']' }.join(', ')})"
277
263
  end
278
264
  [expression, errors]
@@ -305,9 +291,8 @@ module GoodData
305
291
  small_labels = get_small_labels(labels_cache)
306
292
  lookups_cache = create_lookups_cache(small_labels)
307
293
  attrs_cache = create_attrs_cache(filters, options)
308
- muf_expression_cache = create_muf_expression_cache(filters)
309
294
  create_filter_proc = proc do |login, f|
310
- expression, errors = create_expression(f, labels_cache, lookups_cache, attrs_cache, options.merge(muf_expression_cache: muf_expression_cache[login]))
295
+ expression, errors = create_expression(f, labels_cache, lookups_cache, attrs_cache, options)
311
296
  safe_login = login.downcase
312
297
  profiles_uri = if options[:type] == :muf
313
298
  project_user = project_users.find { |u| u.login == safe_login }
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.1.6
4
+ version: 2.1.7
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-08-19 00:00:00.000000000 Z
17
+ date: 2019-11-01 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  requirement: !ruby/object:Gem::Requirement
@@ -206,7 +206,7 @@ dependencies:
206
206
  version: 4.2.9
207
207
  - - "<"
208
208
  - !ruby/object:Gem::Version
209
- version: '5.2'
209
+ version: '6.1'
210
210
  name: activesupport
211
211
  prerelease: false
212
212
  type: :runtime
@@ -217,7 +217,7 @@ dependencies:
217
217
  version: 4.2.9
218
218
  - - "<"
219
219
  - !ruby/object:Gem::Version
220
- version: '5.2'
220
+ version: '6.1'
221
221
  - !ruby/object:Gem::Dependency
222
222
  requirement: !ruby/object:Gem::Requirement
223
223
  requirements: