gooddata 2.1.19-java → 2.2.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +5 -5
  2. data/.gdc-ii-config.yaml +1 -1
  3. data/.github/workflows/build.yml +66 -0
  4. data/.github/workflows/pre-merge.yml +72 -0
  5. data/CHANGELOG.md +38 -0
  6. data/Dockerfile +21 -14
  7. data/Dockerfile.jruby +1 -11
  8. data/README.md +1 -2
  9. data/SDK_VERSION +1 -1
  10. data/VERSION +1 -1
  11. data/ci/mssql/pom.xml +62 -0
  12. data/ci/mysql/pom.xml +57 -0
  13. data/ci/redshift/pom.xml +1 -1
  14. data/docker-compose.lcm.yml +0 -3
  15. data/gooddata.gemspec +2 -1
  16. data/k8s/charts/lcm-bricks/Chart.yaml +1 -1
  17. data/lcm.rake +2 -8
  18. data/lib/gooddata/bricks/middleware/aws_middleware.rb +35 -9
  19. data/lib/gooddata/cloud_resources/blobstorage/blobstorage_client.rb +98 -0
  20. data/lib/gooddata/cloud_resources/mssql/drivers/.gitkeepme +0 -0
  21. data/lib/gooddata/cloud_resources/mssql/mssql_client.rb +122 -0
  22. data/lib/gooddata/cloud_resources/mysql/drivers/.gitkeepme +0 -0
  23. data/lib/gooddata/cloud_resources/mysql/mysql_client.rb +111 -0
  24. data/lib/gooddata/cloud_resources/postgresql/postgresql_client.rb +0 -1
  25. data/lib/gooddata/cloud_resources/snowflake/snowflake_client.rb +18 -1
  26. data/lib/gooddata/helpers/data_helper.rb +9 -4
  27. data/lib/gooddata/lcm/actions/collect_meta.rb +3 -1
  28. data/lib/gooddata/lcm/actions/migrate_gdc_date_dimension.rb +3 -2
  29. data/lib/gooddata/lcm/actions/synchronize_clients.rb +56 -7
  30. data/lib/gooddata/lcm/actions/synchronize_dataset_mappings.rb +64 -0
  31. data/lib/gooddata/lcm/actions/synchronize_ldm.rb +19 -8
  32. data/lib/gooddata/lcm/actions/synchronize_user_filters.rb +12 -9
  33. data/lib/gooddata/lcm/actions/update_metric_formats.rb +185 -0
  34. data/lib/gooddata/lcm/data/delete_from_lcm_release.sql.erb +5 -0
  35. data/lib/gooddata/lcm/helpers/release_table_helper.rb +42 -8
  36. data/lib/gooddata/lcm/lcm2.rb +5 -0
  37. data/lib/gooddata/mixins/md_object_query.rb +1 -0
  38. data/lib/gooddata/models/data_source.rb +5 -1
  39. data/lib/gooddata/models/dataset_mapping.rb +36 -0
  40. data/lib/gooddata/models/metadata/label.rb +26 -27
  41. data/lib/gooddata/models/project.rb +34 -9
  42. data/lib/gooddata/models/schedule.rb +13 -1
  43. data/lib/gooddata/models/user_filters/user_filter_builder.rb +58 -53
  44. data/lib/gooddata/rest/phmap.rb +1 -0
  45. metadata +44 -18
  46. data/lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb +0 -37
@@ -203,7 +203,7 @@ module GoodData
203
203
  # so it precaches the values and still be able to function for larger ones even
204
204
  # though that would mean tons of requests
205
205
  def self.get_small_labels(labels_cache)
206
- labels_cache.values.select { |label| label && label.values_count && label.values_count < 100_000 }
206
+ labels_cache.values.select { |label| label &.values_count &. < 100_000 }
207
207
  end
208
208
 
209
209
  # Creates a MAQL expression(s) based on the filter defintion.
@@ -421,68 +421,73 @@ module GoodData
421
421
  results: create_results + delete_results }
422
422
  end
423
423
 
424
- create_results = to_create.each_slice(100).flat_map do |batch|
425
- batch.pmapcat do |related_uri, group|
426
- group.each(&:save)
427
- res = client.get("/gdc/md/#{project.pid}/userfilters?users=#{related_uri}")
428
- items = res['userFilters']['items'].empty? ? [] : res['userFilters']['items'].first['userFilters']
429
-
430
- payload = {
431
- 'userFilters' => {
432
- 'items' => [{
433
- 'user' => related_uri,
434
- 'userFilters' => items.concat(group.map(&:uri))
435
- }]
424
+ if to_create.empty?
425
+ create_results = []
426
+ else
427
+ create_results = to_create.each_slice(100).flat_map do |batch|
428
+ batch.pmapcat do |related_uri, group|
429
+ group.each(&:save)
430
+ res = client.get("/gdc/md/#{project.pid}/userfilters?users=#{related_uri}")
431
+ items = res['userFilters']['items'].empty? ? [] : res['userFilters']['items'].first['userFilters']
432
+
433
+ payload = {
434
+ 'userFilters' => {
435
+ 'items' => [{
436
+ 'user' => related_uri,
437
+ 'userFilters' => items.concat(group.map(&:uri))
438
+ }]
439
+ }
436
440
  }
437
- }
438
- res = client.post("/gdc/md/#{project.pid}/userfilters", payload)
441
+ res = client.post("/gdc/md/#{project.pid}/userfilters", payload)
439
442
 
440
- # turn the errors from hashes into array of hashes
441
- update_result = res['userFiltersUpdateResult'].flat_map do |k, v|
442
- v.map { |r| { status: k.to_sym, user: r, type: :create } }
443
- end
443
+ # turn the errors from hashes into array of hashes
444
+ update_result = res['userFiltersUpdateResult'].flat_map do |k, v|
445
+ v.map { |r| { status: k.to_sym, user: r, type: :create } }
446
+ end
444
447
 
445
- update_result.map do |result|
446
- result[:status] == :failed ? result.merge(GoodData::Helpers.symbolize_keys(result[:user])) : result
448
+ update_result.map do |result|
449
+ result[:status] == :failed ? result.merge(GoodData::Helpers.symbolize_keys(result[:user])) : result
450
+ end
447
451
  end
448
452
  end
453
+ project_log_formatter.log_user_filter_results(create_results, to_create)
454
+ create_errors = create_results.select { |r| r[:status] == :failed }
455
+ fail "Creating MUFs resulted in errors: #{create_errors}" if create_errors.any?
449
456
  end
450
457
 
451
- project_log_formatter.log_user_filter_results(create_results, to_create)
452
- create_errors = create_results.select { |r| r[:status] == :failed }
453
- fail "Creating MUFs resulted in errors: #{create_errors}" if create_errors.any?
454
-
455
- delete_results = unless options[:do_not_touch_filters_that_are_not_mentioned]
456
- to_delete.each_slice(100).flat_map do |batch|
457
- batch.flat_map do |related_uri, group|
458
- results = []
459
- if related_uri
460
- res = client.get("/gdc/md/#{project.pid}/userfilters?users=#{related_uri}")
461
- items = res['userFilters']['items'].empty? ? [] : res['userFilters']['items'].first['userFilters']
462
- payload = {
463
- 'userFilters' => {
464
- 'items' => [
465
- {
466
- 'user' => related_uri,
467
- 'userFilters' => items - group.map(&:uri)
468
- }
469
- ]
470
- }
471
- }
472
- res = client.post("/gdc/md/#{project.pid}/userfilters", payload)
473
- results.concat(res['userFiltersUpdateResult']
458
+ if to_delete.empty?
459
+ delete_results = []
460
+ elsif !options[:do_not_touch_filters_that_are_not_mentioned]
461
+ delete_results = to_delete.each_slice(100).flat_map do |batch|
462
+ batch.flat_map do |related_uri, group|
463
+ results = []
464
+ if related_uri
465
+ res = client.get("/gdc/md/#{project.pid}/userfilters?users=#{related_uri}")
466
+ items = res['userFilters']['items'].empty? ? [] : res['userFilters']['items'].first['userFilters']
467
+ payload = {
468
+ 'userFilters' => {
469
+ 'items' => [
470
+ {
471
+ 'user' => related_uri,
472
+ 'userFilters' => items - group.map(&:uri)
473
+ }
474
+ ]
475
+ }
476
+ }
477
+ res = client.post("/gdc/md/#{project.pid}/userfilters", payload)
478
+ results.concat(res['userFiltersUpdateResult']
474
479
  .flat_map { |k, v| v.map { |r| { status: k.to_sym, user: r, type: :delete } } }
475
480
  .map { |result| result[:status] == :failed ? result.merge(GoodData::Helpers.symbolize_keys(result[:user])) : result })
476
- end
477
- group.peach(&:delete)
478
- results
479
- end
480
- end
481
- end
481
+ end
482
+ group.peach(&:delete)
483
+ results
484
+ end
482
485
 
483
- project_log_formatter.log_user_filter_results(delete_results, to_delete)
484
- delete_errors = delete_results.select { |r| r[:status] == :failed } if delete_results
485
- fail "Deleting MUFs resulted in errors: #{delete_errors}" if delete_errors && delete_errors.any?
486
+ project_log_formatter.log_user_filter_results(delete_results, to_delete)
487
+ delete_errors = delete_results.select { |r| r[:status] == :failed } if delete_results
488
+ fail "Deleting MUFs resulted in errors: #{delete_errors}" if delete_errors&.any?
489
+ end
490
+ end
486
491
 
487
492
  { created: to_create, deleted: to_delete, results: create_results + (delete_results || []) }
488
493
  end
@@ -82,6 +82,7 @@ module GoodData
82
82
 
83
83
  ['/gdc/internal/projects/{id}/objects/setPermissions', %r{/gdc/internal/projects/[^\/]+/objects/setPermissions}],
84
84
  ['/gdc/internal/projects/{id}/roles', %r{/gdc/internal/projects/[^\/]+/roles}],
85
+ ['/gdc/dataload/projects/{id}/modelMapping/datasets/bulk/upsert', %r{/gdc/dataload/projects/[^\/]+/modelMapping/datasets/bulk/upsert}],
85
86
  ['/gdc/md/{id}/variables/item/{id}', %r{/gdc/md/[^\/]+/variables/item/[\d]+}],
86
87
  ['/gdc/md/{id}/validate/task/{id}', %r{/gdc/md/[^\/]+/validate/task/[^\/]+}],
87
88
  ['/gdc/md/{id}/using2/{id}/{id}', %r{/gdc/md/[^\/]+/using2/[\d]+/[\d]+}],
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.19
4
+ version: 2.2.0
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: 2021-05-21 00:00:00.000000000 Z
17
+ date: 2022-02-15 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  requirement: !ruby/object:Gem::Requirement
@@ -252,6 +252,34 @@ dependencies:
252
252
  - - "<"
253
253
  - !ruby/object:Gem::Version
254
254
  version: 1.4.0
255
+ - !ruby/object:Gem::Dependency
256
+ requirement: !ruby/object:Gem::Requirement
257
+ requirements:
258
+ - - "~>"
259
+ - !ruby/object:Gem::Version
260
+ version: 1.1.0
261
+ name: azure-storage-blob
262
+ prerelease: false
263
+ type: :runtime
264
+ version_requirements: !ruby/object:Gem::Requirement
265
+ requirements:
266
+ - - "~>"
267
+ - !ruby/object:Gem::Version
268
+ version: 1.1.0
269
+ - !ruby/object:Gem::Dependency
270
+ requirement: !ruby/object:Gem::Requirement
271
+ requirements:
272
+ - - "~>"
273
+ - !ruby/object:Gem::Version
274
+ version: 1.10.0
275
+ name: nokogiri
276
+ prerelease: false
277
+ type: :runtime
278
+ version_requirements: !ruby/object:Gem::Requirement
279
+ requirements:
280
+ - - "~>"
281
+ - !ruby/object:Gem::Version
282
+ version: 1.10.0
255
283
  - !ruby/object:Gem::Dependency
256
284
  requirement: !ruby/object:Gem::Requirement
257
285
  requirements:
@@ -418,20 +446,6 @@ dependencies:
418
446
  - - ">="
419
447
  - !ruby/object:Gem::Version
420
448
  version: 1.2.1
421
- - !ruby/object:Gem::Dependency
422
- requirement: !ruby/object:Gem::Requirement
423
- requirements:
424
- - - "~>"
425
- - !ruby/object:Gem::Version
426
- version: '0.2'
427
- name: salesforce_bulk_query
428
- prerelease: false
429
- type: :runtime
430
- version_requirements: !ruby/object:Gem::Requirement
431
- requirements:
432
- - - "~>"
433
- - !ruby/object:Gem::Version
434
- version: '0.2'
435
449
  - !ruby/object:Gem::Dependency
436
450
  requirement: !ruby/object:Gem::Requirement
437
451
  requirements:
@@ -514,6 +528,8 @@ files:
514
528
  - ".flayignore"
515
529
  - ".gdc-ii-config-chart.yaml"
516
530
  - ".gdc-ii-config.yaml"
531
+ - ".github/workflows/build.yml"
532
+ - ".github/workflows/pre-merge.yml"
517
533
  - ".gitignore"
518
534
  - ".pronto.yml"
519
535
  - ".rspec"
@@ -553,6 +569,8 @@ files:
553
569
  - bin/users.sh
554
570
  - ci.rake
555
571
  - ci/bigquery/pom.xml
572
+ - ci/mssql/pom.xml
573
+ - ci/mysql/pom.xml
556
574
  - ci/postgresql/pom.xml
557
575
  - ci/redshift/pom.xml
558
576
  - ci/snowflake/pom.xml
@@ -581,7 +599,6 @@ files:
581
599
  - lib/gooddata/bricks/middleware/aws_middleware.rb
582
600
  - lib/gooddata/bricks/middleware/base_middleware.rb
583
601
  - lib/gooddata/bricks/middleware/bench_middleware.rb
584
- - lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb
585
602
  - lib/gooddata/bricks/middleware/context_logger_decorator.rb
586
603
  - lib/gooddata/bricks/middleware/context_manager.rb
587
604
  - lib/gooddata/bricks/middleware/decode_params_middleware.rb
@@ -616,9 +633,14 @@ files:
616
633
  - lib/gooddata/client.rb
617
634
  - lib/gooddata/cloud_resources/bigquery/bigquery_client.rb
618
635
  - lib/gooddata/cloud_resources/bigquery/drivers/.gitkeepme
636
+ - lib/gooddata/cloud_resources/blobstorage/blobstorage_client.rb
619
637
  - lib/gooddata/cloud_resources/cloud_resource_client.rb
620
638
  - lib/gooddata/cloud_resources/cloud_resource_factory.rb
621
639
  - lib/gooddata/cloud_resources/cloud_resources.rb
640
+ - lib/gooddata/cloud_resources/mssql/drivers/.gitkeepme
641
+ - lib/gooddata/cloud_resources/mssql/mssql_client.rb
642
+ - lib/gooddata/cloud_resources/mysql/drivers/.gitkeepme
643
+ - lib/gooddata/cloud_resources/mysql/mysql_client.rb
622
644
  - lib/gooddata/cloud_resources/postgresql/drivers/.gitkeepme
623
645
  - lib/gooddata/cloud_resources/postgresql/postgresql_client.rb
624
646
  - lib/gooddata/cloud_resources/redshift/drivers/log4j.properties
@@ -720,6 +742,7 @@ files:
720
742
  - lib/gooddata/lcm/actions/synchronize_cas.rb
721
743
  - lib/gooddata/lcm/actions/synchronize_clients.rb
722
744
  - lib/gooddata/lcm/actions/synchronize_color_palette.rb
745
+ - lib/gooddata/lcm/actions/synchronize_dataset_mappings.rb
723
746
  - lib/gooddata/lcm/actions/synchronize_etls_in_segment.rb
724
747
  - lib/gooddata/lcm/actions/synchronize_label_types.rb
725
748
  - lib/gooddata/lcm/actions/synchronize_ldm.rb
@@ -731,9 +754,11 @@ files:
731
754
  - lib/gooddata/lcm/actions/synchronize_user_filters.rb
732
755
  - lib/gooddata/lcm/actions/synchronize_user_groups.rb
733
756
  - lib/gooddata/lcm/actions/synchronize_users.rb
757
+ - lib/gooddata/lcm/actions/update_metric_formats.rb
734
758
  - lib/gooddata/lcm/actions/update_release_table.rb
735
759
  - lib/gooddata/lcm/brick_logger.rb
736
760
  - lib/gooddata/lcm/data/create_lcm_release.sql.erb
761
+ - lib/gooddata/lcm/data/delete_from_lcm_release.sql.erb
737
762
  - lib/gooddata/lcm/data/insert_into_lcm_release.sql.erb
738
763
  - lib/gooddata/lcm/data/select_from_lcm_release.sql.erb
739
764
  - lib/gooddata/lcm/data/update_lcm_release.sql.erb
@@ -847,6 +872,7 @@ files:
847
872
  - lib/gooddata/models/client_synchronization_result_details.rb
848
873
  - lib/gooddata/models/data_product.rb
849
874
  - lib/gooddata/models/data_source.rb
875
+ - lib/gooddata/models/dataset_mapping.rb
850
876
  - lib/gooddata/models/datawarehouse.rb
851
877
  - lib/gooddata/models/domain.rb
852
878
  - lib/gooddata/models/execution.rb
@@ -947,7 +973,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
947
973
  version: '0'
948
974
  requirements: []
949
975
  rubyforge_project:
950
- rubygems_version: 2.6.13
976
+ rubygems_version: 2.6.14.1
951
977
  signing_key:
952
978
  specification_version: 4
953
979
  summary: A convenient Ruby wrapper around the GoodData RESTful API
@@ -1,37 +0,0 @@
1
- # encoding: UTF-8
2
- #
3
- # Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
4
- # This source code is licensed under the BSD-style license found in the
5
- # LICENSE file in the root directory of this source tree.
6
-
7
- require 'salesforce_bulk_query'
8
-
9
- require_relative 'base_middleware'
10
-
11
- module GoodData
12
- module Bricks
13
- class BulkSalesforceMiddleware < Bricks::Middleware
14
- DEFAULT_VERSION = '29.0'.freeze
15
-
16
- def self.create_client(params)
17
- salesforce = nil
18
- if params['salesforce_client']
19
-
20
- client = params['salesforce_client']
21
- client.authenticate!
22
-
23
- salesforce = SalesforceBulkQuery::Api.new(client, logger: params['GDC_LOGGER'])
24
- # SalesforceBulkQuery adds its own Restforce logging so turn it off
25
- Restforce.log = false if params['GDC_LOGGER']
26
- end
27
- params.merge('salesforce_bulk_client' => salesforce)
28
- end
29
-
30
- def call(params)
31
- params = params.to_hash
32
- params = self.class.create_client(params)
33
- @app.call(params)
34
- end
35
- end
36
- end
37
- end