gooddata 0.6.49 → 0.6.50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -4
- data/CLI.md +0 -4
- data/DEPENDENCIES.md +0 -8
- data/Dockerfile.jruby +19 -0
- data/Dockerfile.ruby +19 -0
- data/LICENSE +2 -2
- data/LICENSE.rb +1 -1
- data/Rakefile +1 -1
- data/gooddata.gemspec +29 -28
- data/lib/gooddata.rb +2 -1
- data/lib/gooddata/app/app.rb +1 -1
- data/lib/gooddata/bricks/base_downloader.rb +1 -1
- data/lib/gooddata/bricks/brick.rb +3 -4
- data/lib/gooddata/bricks/bricks.rb +3 -1
- data/lib/gooddata/bricks/middleware/aws_middleware.rb +6 -8
- data/lib/gooddata/bricks/middleware/base_middleware.rb +2 -1
- data/lib/gooddata/bricks/middleware/bench_middleware.rb +2 -1
- data/lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb +3 -3
- data/lib/gooddata/bricks/middleware/decode_params_middleware.rb +3 -2
- data/lib/gooddata/bricks/middleware/dwh_middleware.rb +28 -0
- data/lib/gooddata/bricks/middleware/fs_download_middleware.rb +2 -2
- data/lib/gooddata/bricks/middleware/fs_upload_middleware.rb +2 -2
- data/lib/gooddata/bricks/middleware/gooddata_middleware.rb +84 -21
- data/lib/gooddata/bricks/middleware/logger_middleware.rb +1 -1
- data/lib/gooddata/bricks/middleware/middleware.rb +1 -1
- data/lib/gooddata/bricks/middleware/params_inspect_middleware.rb +21 -0
- data/lib/gooddata/bricks/middleware/restforce_middleware.rb +26 -26
- data/lib/gooddata/bricks/middleware/stdout_middleware.rb +1 -1
- data/lib/gooddata/bricks/middleware/twitter_middleware.rb +1 -1
- data/lib/gooddata/bricks/middleware/undot_params_middleware.rb +1 -1
- data/lib/gooddata/bricks/pipeline.rb +6 -13
- data/lib/gooddata/bricks/utils.rb +3 -3
- data/lib/gooddata/cli/cli.rb +1 -1
- data/lib/gooddata/cli/commands/auth_cmd.rb +1 -1
- data/lib/gooddata/cli/commands/domain_cmd.rb +1 -1
- data/lib/gooddata/cli/commands/project_cmd.rb +1 -18
- data/lib/gooddata/cli/hooks.rb +1 -2
- data/lib/gooddata/cli/shared.rb +1 -1
- data/lib/gooddata/cli/terminal.rb +1 -1
- data/lib/gooddata/client.rb +1 -1
- data/lib/gooddata/commands/api.rb +1 -1
- data/lib/gooddata/commands/auth.rb +1 -1
- data/lib/gooddata/commands/base.rb +1 -1
- data/lib/gooddata/commands/commands.rb +1 -1
- data/lib/gooddata/commands/datasets.rb +1 -1
- data/lib/gooddata/commands/datawarehouse.rb +1 -1
- data/lib/gooddata/commands/domain.rb +1 -1
- data/lib/gooddata/commands/process.rb +1 -1
- data/lib/gooddata/commands/project.rb +2 -31
- data/lib/gooddata/commands/projects.rb +1 -1
- data/lib/gooddata/commands/role.rb +1 -1
- data/lib/gooddata/commands/runners.rb +1 -1
- data/lib/gooddata/commands/scaffold.rb +1 -1
- data/lib/gooddata/commands/user.rb +1 -1
- data/lib/gooddata/connection.rb +1 -1
- data/lib/gooddata/core/core.rb +1 -1
- data/lib/gooddata/core/logging.rb +1 -1
- data/lib/gooddata/core/nil_logger.rb +1 -1
- data/lib/gooddata/core/project.rb +1 -1
- data/lib/gooddata/core/rest.rb +1 -1
- data/lib/gooddata/core/user.rb +1 -1
- data/lib/gooddata/data/data.rb +1 -1
- data/lib/gooddata/data/guesser.rb +1 -1
- data/lib/gooddata/exceptions/attr_element_not_found.rb +1 -1
- data/lib/gooddata/exceptions/command_failed.rb +1 -1
- data/lib/gooddata/exceptions/exceptions.rb +1 -1
- data/lib/gooddata/exceptions/execution_limit_exceeded.rb +1 -1
- data/lib/gooddata/exceptions/export_clone.rb +4 -0
- data/lib/gooddata/exceptions/filter_maqlization.rb +1 -1
- data/lib/gooddata/exceptions/import_clone.rb +4 -0
- data/lib/gooddata/exceptions/malformed_user.rb +1 -1
- data/lib/gooddata/exceptions/maql_execution.rb +1 -1
- data/lib/gooddata/exceptions/no_project_error.rb +1 -1
- data/lib/gooddata/exceptions/object_migration.rb +1 -1
- data/lib/gooddata/exceptions/project_not_found.rb +1 -1
- data/lib/gooddata/exceptions/segment_not_empty.rb +1 -1
- data/lib/gooddata/exceptions/uncomputable_report.rb +1 -1
- data/lib/gooddata/exceptions/user_in_different_domain.rb +1 -1
- data/lib/gooddata/exceptions/validation_error.rb +1 -1
- data/lib/gooddata/extensions/big_decimal.rb +1 -1
- data/lib/gooddata/extensions/class.rb +11 -0
- data/lib/gooddata/extensions/enumerable.rb +1 -1
- data/lib/gooddata/extensions/extensions.rb +1 -1
- data/lib/gooddata/extensions/false.rb +9 -1
- data/lib/gooddata/extensions/hash.rb +12 -1
- data/lib/gooddata/extensions/integer.rb +5 -0
- data/lib/gooddata/extensions/nil.rb +5 -1
- data/lib/gooddata/extensions/numeric.rb +1 -1
- data/lib/gooddata/extensions/object.rb +5 -1
- data/lib/gooddata/extensions/symbol.rb +1 -1
- data/lib/gooddata/extensions/true.rb +9 -1
- data/lib/gooddata/extract.rb +1 -1
- data/lib/gooddata/goodzilla/goodzilla.rb +1 -1
- data/lib/gooddata/helpers/auth_helpers.rb +1 -1
- data/lib/gooddata/helpers/csv_helper.rb +1 -1
- data/lib/gooddata/helpers/data_helper.rb +19 -10
- data/lib/gooddata/helpers/erb_helper.rb +23 -0
- data/lib/gooddata/helpers/global_helpers.rb +5 -73
- data/lib/gooddata/helpers/global_helpers_params.rb +73 -7
- data/lib/gooddata/helpers/helpers.rb +1 -1
- data/lib/gooddata/lcm/actions/actions.rb +12 -0
- data/lib/gooddata/lcm/actions/associate_clients.rb +46 -0
- data/lib/gooddata/lcm/actions/base_action.rb +23 -0
- data/lib/gooddata/lcm/actions/collect_clients.rb +89 -0
- data/lib/gooddata/lcm/actions/collect_segment_clients.rb +103 -0
- data/lib/gooddata/lcm/actions/collect_segments.rb +59 -0
- data/lib/gooddata/lcm/actions/create_segment_masters.rb +167 -0
- data/lib/gooddata/lcm/actions/ensure_release_table.rb +56 -0
- data/lib/gooddata/lcm/actions/ensure_segments.rb +35 -0
- data/lib/gooddata/lcm/actions/ensure_technical_users_domain.rb +66 -0
- data/lib/gooddata/lcm/actions/ensure_technical_users_project.rb +68 -0
- data/lib/gooddata/lcm/actions/ensure_titles.rb +54 -0
- data/lib/gooddata/lcm/actions/hello_world.rb +44 -0
- data/lib/gooddata/lcm/actions/print_actions.rb +61 -0
- data/lib/gooddata/lcm/actions/print_modes.rb +72 -0
- data/lib/gooddata/lcm/actions/print_types.rb +55 -0
- data/lib/gooddata/lcm/actions/provision_clients.rb +80 -0
- data/lib/gooddata/lcm/actions/purge_clients.rb +78 -0
- data/lib/gooddata/lcm/actions/segments_filter.rb +50 -0
- data/lib/gooddata/lcm/actions/synchronize_attribute_drillpaths.rb +60 -0
- data/lib/gooddata/lcm/actions/synchronize_clients.rb +87 -0
- data/lib/gooddata/lcm/actions/synchronize_color_palette.rb +59 -0
- data/lib/gooddata/lcm/actions/synchronize_label_types.rb +61 -0
- data/lib/gooddata/lcm/actions/synchronize_ldm.rb +64 -0
- data/lib/gooddata/lcm/actions/synchronize_meta.rb +55 -0
- data/lib/gooddata/lcm/actions/synchronize_new_segments.rb +55 -0
- data/lib/gooddata/lcm/actions/synchronize_processes.rb +66 -0
- data/lib/gooddata/lcm/actions/synchronize_schedules.rb +81 -0
- data/lib/gooddata/lcm/actions/update_release_table.rb +80 -0
- data/lib/gooddata/lcm/data/create_lcm_release.sql.erb +5 -0
- data/lib/gooddata/lcm/data/insert_into_lcm_release.sql.erb +11 -0
- data/lib/gooddata/lcm/data/select_from_lcm_release.sql.erb +8 -0
- data/lib/gooddata/lcm/data/update_lcm_release.sql.erb +7 -0
- data/lib/gooddata/lcm/dsl/dsl.rb +50 -0
- data/lib/gooddata/lcm/dsl/params_dsl.rb +61 -0
- data/lib/gooddata/lcm/dsl/type_dsl.rb +61 -0
- data/lib/gooddata/lcm/helpers/check_helper.rb +37 -0
- data/lib/gooddata/lcm/helpers/helpers.rb +12 -0
- data/lib/gooddata/lcm/lcm.rb +161 -20
- data/lib/gooddata/lcm/lcm2.rb +260 -0
- data/lib/gooddata/lcm/types/base_type.rb +29 -0
- data/lib/gooddata/lcm/types/class/ads_client.rb +35 -0
- data/lib/gooddata/lcm/types/class/class.rb +21 -0
- data/lib/gooddata/lcm/types/class/gd_client.rb +35 -0
- data/lib/gooddata/lcm/types/class/types.rb +12 -0
- data/lib/gooddata/lcm/types/complex/complex.rb +33 -0
- data/lib/gooddata/lcm/types/complex/release_query.rb +35 -0
- data/lib/gooddata/lcm/types/complex/segment.rb +37 -0
- data/lib/gooddata/lcm/types/complex/synchronization_info.rb +32 -0
- data/lib/gooddata/lcm/types/complex/tokens.rb +31 -0
- data/lib/gooddata/lcm/types/complex/types.rb +12 -0
- data/lib/gooddata/lcm/types/complex/update_preference.rb +32 -0
- data/lib/gooddata/lcm/types/param.rb +16 -0
- data/lib/gooddata/lcm/types/scalar/bool.rb +22 -0
- data/lib/gooddata/lcm/types/scalar/hash.rb +22 -0
- data/lib/gooddata/lcm/types/scalar/integer.rb +22 -0
- data/lib/gooddata/lcm/types/scalar/object.rb +22 -0
- data/lib/gooddata/lcm/types/scalar/string.rb +22 -0
- data/lib/gooddata/lcm/types/scalar/types.rb +12 -0
- data/lib/gooddata/lcm/types/special/array.rb +35 -0
- data/lib/gooddata/lcm/types/special/enum.rb +17 -0
- data/lib/gooddata/lcm/types/special/types.rb +12 -0
- data/lib/gooddata/lcm/types/types.rb +12 -0
- data/lib/gooddata/mixins/author.rb +1 -1
- data/lib/gooddata/mixins/content_getter.rb +1 -1
- data/lib/gooddata/mixins/content_property_reader.rb +1 -1
- data/lib/gooddata/mixins/content_property_writer.rb +1 -1
- data/lib/gooddata/mixins/contributor.rb +1 -1
- data/lib/gooddata/mixins/data_getter.rb +1 -1
- data/lib/gooddata/mixins/data_property_reader.rb +1 -1
- data/lib/gooddata/mixins/data_property_writer.rb +1 -1
- data/lib/gooddata/mixins/inspector.rb +1 -1
- data/lib/gooddata/mixins/is_attribute.rb +1 -1
- data/lib/gooddata/mixins/is_dimension.rb +1 -1
- data/lib/gooddata/mixins/is_fact.rb +1 -1
- data/lib/gooddata/mixins/is_label.rb +1 -1
- data/lib/gooddata/mixins/links.rb +1 -1
- data/lib/gooddata/mixins/md_finders.rb +1 -1
- data/lib/gooddata/mixins/md_grantees.rb +1 -1
- data/lib/gooddata/mixins/md_id_to_uri.rb +9 -3
- data/lib/gooddata/mixins/md_json.rb +1 -1
- data/lib/gooddata/mixins/md_lock.rb +1 -1
- data/lib/gooddata/mixins/md_object_id.rb +1 -1
- data/lib/gooddata/mixins/md_object_indexer.rb +1 -1
- data/lib/gooddata/mixins/md_object_query.rb +1 -1
- data/lib/gooddata/mixins/md_relations.rb +1 -1
- data/lib/gooddata/mixins/meta_getter.rb +1 -1
- data/lib/gooddata/mixins/meta_property_reader.rb +1 -1
- data/lib/gooddata/mixins/meta_property_writer.rb +1 -1
- data/lib/gooddata/mixins/mixins.rb +1 -1
- data/lib/gooddata/mixins/not_attribute.rb +1 -1
- data/lib/gooddata/mixins/not_exportable.rb +1 -1
- data/lib/gooddata/mixins/not_fact.rb +1 -1
- data/lib/gooddata/mixins/not_group.rb +1 -1
- data/lib/gooddata/mixins/not_label.rb +1 -1
- data/lib/gooddata/mixins/not_metric.rb +1 -1
- data/lib/gooddata/mixins/obj_id.rb +1 -1
- data/lib/gooddata/mixins/rest_getters.rb +1 -1
- data/lib/gooddata/mixins/rest_resource.rb +1 -1
- data/lib/gooddata/mixins/root_key_getter.rb +1 -1
- data/lib/gooddata/mixins/root_key_setter.rb +1 -1
- data/lib/gooddata/mixins/timestamps.rb +1 -1
- data/lib/gooddata/models/ads_output_stage.rb +85 -0
- data/lib/gooddata/models/automated_data_distribution.rb +36 -0
- data/lib/gooddata/models/blueprint/anchor_field.rb +4 -3
- data/lib/gooddata/models/blueprint/attribute_field.rb +18 -2
- data/lib/gooddata/models/blueprint/blueprint.rb +1 -1
- data/lib/gooddata/models/blueprint/blueprint_field.rb +1 -1
- data/lib/gooddata/models/blueprint/dashboard_builder.rb +1 -1
- data/lib/gooddata/models/blueprint/dataset_blueprint.rb +6 -1
- data/lib/gooddata/models/blueprint/date_dimension.rb +1 -1
- data/lib/gooddata/models/blueprint/fact_field.rb +1 -1
- data/lib/gooddata/models/blueprint/label_field.rb +5 -1
- data/lib/gooddata/models/blueprint/project_blueprint.rb +1 -1
- data/lib/gooddata/models/blueprint/project_builder.rb +1 -1
- data/lib/gooddata/models/blueprint/reference_field.rb +1 -1
- data/lib/gooddata/models/blueprint/schema_blueprint.rb +1 -1
- data/lib/gooddata/models/blueprint/schema_builder.rb +1 -1
- data/lib/gooddata/models/blueprint/to_manifest.rb +7 -3
- data/lib/gooddata/models/blueprint/to_wire.rb +12 -1
- data/lib/gooddata/models/channel_configuration.rb +112 -0
- data/lib/gooddata/models/client.rb +42 -6
- data/lib/gooddata/models/client_synchronization_result.rb +1 -1
- data/lib/gooddata/models/client_synchronization_result_details.rb +1 -1
- data/lib/gooddata/models/datawarehouse.rb +25 -3
- data/lib/gooddata/models/domain.rb +29 -4
- data/lib/gooddata/models/execution.rb +1 -1
- data/lib/gooddata/models/execution_detail.rb +1 -1
- data/lib/gooddata/models/from_wire.rb +8 -1
- data/lib/gooddata/models/invitation.rb +1 -1
- data/lib/gooddata/models/links.rb +1 -1
- data/lib/gooddata/models/membership.rb +1 -1
- data/lib/gooddata/models/metadata.rb +3 -2
- data/lib/gooddata/models/metadata/attribute.rb +7 -1
- data/lib/gooddata/models/metadata/dashboard.rb +3 -3
- data/lib/gooddata/models/metadata/dashboard/dashboard_item.rb +1 -1
- data/lib/gooddata/models/metadata/dashboard/filter_apply_item.rb +2 -2
- data/lib/gooddata/models/metadata/dashboard/filter_item.rb +2 -2
- data/lib/gooddata/models/metadata/dashboard/geo_chart_item.rb +2 -2
- data/lib/gooddata/models/metadata/dashboard/headline_item.rb +2 -2
- data/lib/gooddata/models/metadata/dashboard/iframe_item.rb +2 -2
- data/lib/gooddata/models/metadata/dashboard/report_item.rb +2 -2
- data/lib/gooddata/models/metadata/dashboard/text_item.rb +2 -2
- data/lib/gooddata/models/metadata/dashboard_tab.rb +2 -2
- data/lib/gooddata/models/metadata/dataset.rb +1 -1
- data/lib/gooddata/models/metadata/dimension.rb +1 -1
- data/lib/gooddata/models/metadata/fact.rb +1 -1
- data/lib/gooddata/models/metadata/folder.rb +1 -1
- data/lib/gooddata/models/metadata/label.rb +1 -1
- data/lib/gooddata/models/metadata/metadata.rb +1 -1
- data/lib/gooddata/models/metadata/metric.rb +1 -1
- data/lib/gooddata/models/metadata/report.rb +1 -1
- data/lib/gooddata/models/metadata/report_definition.rb +1 -1
- data/lib/gooddata/models/metadata/scheduled_mail.rb +2 -2
- data/lib/gooddata/models/metadata/scheduled_mail/dashboard_attachment.rb +1 -1
- data/lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb +1 -1
- data/lib/gooddata/models/metadata/variable.rb +1 -1
- data/lib/gooddata/models/model.rb +1 -1
- data/lib/gooddata/models/models.rb +1 -1
- data/lib/gooddata/models/module_constants.rb +1 -1
- data/lib/gooddata/models/notification_rule.rb +113 -0
- data/lib/gooddata/models/process.rb +10 -3
- data/lib/gooddata/models/profile.rb +9 -1
- data/lib/gooddata/models/project.rb +248 -50
- data/lib/gooddata/models/project_creator.rb +2 -2
- data/lib/gooddata/models/project_metadata.rb +1 -1
- data/lib/gooddata/models/project_role.rb +1 -1
- data/lib/gooddata/models/report_data_result.rb +1 -1
- data/lib/gooddata/models/schedule.rb +49 -13
- data/lib/gooddata/models/segment.rb +3 -3
- data/lib/gooddata/models/style_setting.rb +71 -0
- data/lib/gooddata/models/subscription.rb +181 -0
- data/lib/gooddata/models/tab_builder.rb +1 -1
- data/lib/gooddata/models/user_filters/mandatory_user_filter.rb +1 -1
- data/lib/gooddata/models/user_filters/user_filter.rb +1 -1
- data/lib/gooddata/models/user_filters/user_filter_builder.rb +11 -5
- data/lib/gooddata/models/user_filters/user_filters.rb +1 -1
- data/lib/gooddata/models/user_filters/variable_user_filter.rb +1 -1
- data/lib/gooddata/models/user_group.rb +19 -12
- data/lib/gooddata/rest/client.rb +9 -1
- data/lib/gooddata/rest/connection.rb +18 -9
- data/lib/gooddata/rest/object.rb +1 -1
- data/lib/gooddata/rest/object_factory.rb +1 -1
- data/lib/gooddata/rest/resource.rb +1 -1
- data/lib/gooddata/rest/rest.rb +1 -1
- data/lib/gooddata/version.rb +2 -2
- data/spec/.rubocop.yml +16 -0
- data/spec/bricks/bricks_spec.rb +13 -15
- data/spec/data/blueprints/attribute_sort_order_blueprint.json +72 -0
- data/spec/data/gooddata_version_process/gooddata_version.rb +1 -1
- data/spec/data/hello_world_process/hello_world.rb +2 -2
- data/spec/data/ruby_params_process/ruby_params.rb +1 -1
- data/spec/data/ruby_process/process.rb +2 -2
- data/spec/data/wire_models/attribute_sort_by_model.json +73 -0
- data/spec/environment/default.rb +14 -13
- data/spec/environment/develop.rb +26 -11
- data/spec/environment/environment.rb +2 -1
- data/spec/environment/hotfix.rb +15 -7
- data/spec/environment/production.rb +6 -14
- data/spec/environment/staging.rb +9 -10
- data/spec/helpers/blueprint_helper.rb +11 -10
- data/spec/helpers/cli_helper.rb +26 -24
- data/spec/helpers/connection_helper.rb +28 -26
- data/spec/helpers/crypto_helper.rb +8 -6
- data/spec/helpers/csv_helper.rb +7 -5
- data/spec/helpers/process_helper.rb +13 -11
- data/spec/helpers/project_helper.rb +36 -34
- data/spec/helpers/schedule_helper.rb +13 -11
- data/spec/helpers/spec_helper.rb +8 -6
- data/spec/integration/ads_output_stage_spec.rb +55 -0
- data/spec/integration/blueprint_updates_spec.rb +22 -16
- data/spec/integration/blueprint_with_grain_spec.rb +5 -3
- data/spec/integration/channel_configuration_spec.rb +67 -0
- data/spec/integration/clients_spec.rb +31 -22
- data/spec/integration/command_datawarehouse_spec.rb +4 -4
- data/spec/integration/command_projects_spec.rb +6 -6
- data/spec/integration/create_from_template_spec.rb +4 -3
- data/spec/integration/create_project_spec.rb +7 -4
- data/spec/integration/date_dim_switch_spec.rb +25 -28
- data/spec/integration/deprecated_load_spec.rb +11 -9
- data/spec/integration/full_process_schedule_spec.rb +82 -13
- data/spec/integration/full_project_spec.rb +67 -45
- data/spec/integration/lcm_spec.rb +41 -0
- data/spec/integration/over_to_user_filters_spec.rb +14 -10
- data/spec/integration/partial_md_export_import_spec.rb +3 -4
- data/spec/integration/project_spec.rb +101 -42
- data/spec/integration/rest_spec.rb +5 -4
- data/spec/integration/schedule_spec.rb +28 -39
- data/spec/integration/segments_spec.rb +42 -31
- data/spec/integration/subscription_spec.rb +63 -0
- data/spec/integration/user_filters_spec.rb +49 -39
- data/spec/integration/user_group_spec.rb +25 -5
- data/spec/integration/variables_spec.rb +34 -32
- data/spec/logging_in_logging_out_spec.rb +6 -8
- data/spec/spec_helper.rb +3 -3
- data/spec/unit/bricks/bricks_spec.rb +3 -4
- data/spec/unit/bricks/middleware/aws_middelware_spec.rb +8 -15
- data/spec/unit/bricks/middleware/bench_middleware_spec.rb +2 -2
- data/spec/unit/bricks/middleware/bulk_salesforce_middleware_spec.rb +2 -2
- data/spec/unit/bricks/middleware/gooddata_middleware_spec.rb +2 -2
- data/spec/unit/bricks/middleware/logger_middleware_spec.rb +2 -2
- data/spec/unit/bricks/middleware/restforce_middleware_spec.rb +3 -3
- data/spec/unit/bricks/middleware/stdout_middleware_spec.rb +3 -3
- data/spec/unit/bricks/middleware/twitter_middleware_spec.rb +3 -3
- data/spec/unit/cli/cli_spec.rb +3 -3
- data/spec/unit/cli/commands/cmd_auth_spec.rb +2 -2
- data/spec/unit/commands/command_projects_spec.rb +3 -3
- data/spec/unit/core/connection_spec.rb +3 -4
- data/spec/unit/core/logging_spec.rb +2 -5
- data/spec/unit/core/nil_logger_spec.rb +2 -2
- data/spec/unit/core/project_spec.rb +4 -4
- data/spec/unit/extensions/hash_spec.rb +3 -4
- data/spec/unit/godzilla/goodzilla_spec.rb +22 -26
- data/spec/unit/helpers/csv_helper_spec.rb +3 -3
- data/spec/unit/helpers/data_helper_spec.rb +6 -18
- data/spec/unit/helpers/global_helpers_spec.rb +112 -28
- data/spec/unit/helpers_spec.rb +139 -2
- data/spec/unit/models/blueprint/attribute_sort_by_spec.rb +20 -0
- data/spec/unit/models/blueprint/attributes_spec.rb +1 -2
- data/spec/unit/models/blueprint/dataset_spec.rb +2 -3
- data/spec/unit/models/blueprint/labels_spec.rb +1 -2
- data/spec/unit/models/blueprint/project_blueprint_spec.rb +34 -35
- data/spec/unit/models/blueprint/reference_spec.rb +1 -2
- data/spec/unit/models/blueprint/schema_builder_spec.rb +5 -7
- data/spec/unit/models/blueprint/to_wire_spec.rb +76 -55
- data/spec/unit/models/domain_spec.rb +4 -5
- data/spec/unit/models/execution_spec.rb +16 -15
- data/spec/unit/models/from_wire_spec.rb +24 -19
- data/spec/unit/models/invitation_spec.rb +1 -1
- data/spec/unit/models/membership_spec.rb +36 -41
- data/spec/unit/models/metadata_spec.rb +20 -18
- data/spec/unit/models/metric_spec.rb +67 -55
- data/spec/unit/models/model_spec.rb +32 -37
- data/spec/unit/models/params_spec.rb +1 -1
- data/spec/unit/models/profile_spec.rb +40 -45
- data/spec/unit/models/project_creator_spec.rb +27 -29
- data/spec/unit/models/project_role_spec.rb +1 -1
- data/spec/unit/models/project_spec.rb +65 -2
- data/spec/unit/models/report_result_data_spec.rb +7 -12
- data/spec/unit/models/schedule_spec.rb +71 -35
- data/spec/unit/models/to_manifest_spec.rb +69 -4
- data/spec/unit/models/unit_project_spec.rb +12 -12
- data/spec/unit/models/user_filters_spec.rb +40 -40
- data/spec/unit/models/variable_spec.rb +108 -93
- data/spec/unit/rest/polling_spec.rb +7 -7
- data/spec/unit/rest/resource_spec.rb +2 -2
- metadata +145 -228
- data/spec/environment/release.rb +0 -21
- data/spec/environment/staging_3.rb +0 -36
@@ -0,0 +1,50 @@
|
|
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 'json'
|
8
|
+
|
9
|
+
require_relative 'params_dsl'
|
10
|
+
require_relative 'type_dsl'
|
11
|
+
|
12
|
+
require_relative '../../helpers/global_helpers'
|
13
|
+
|
14
|
+
module GoodData
|
15
|
+
module LCM2
|
16
|
+
module Dsl
|
17
|
+
module Dsl
|
18
|
+
DEFAULT_OPTS = {
|
19
|
+
required: false,
|
20
|
+
default: nil
|
21
|
+
}
|
22
|
+
|
23
|
+
PARAMS = {}
|
24
|
+
TYPES = {}
|
25
|
+
|
26
|
+
def process(_klass, type, _caption, &block)
|
27
|
+
dsl = type.new
|
28
|
+
dsl.instance_eval(&block)
|
29
|
+
|
30
|
+
# puts "#{caption}: #{klass.name}"
|
31
|
+
# puts JSON.pretty_generate(dsl.params)
|
32
|
+
# puts
|
33
|
+
|
34
|
+
# yield if block_given?
|
35
|
+
|
36
|
+
# Return params
|
37
|
+
dsl.params
|
38
|
+
end
|
39
|
+
|
40
|
+
def define_params(klass, &block)
|
41
|
+
PARAMS[klass] = process(klass, GoodData::LCM2::Dsl::ParamsDsl, 'PARAMS', &block)
|
42
|
+
end
|
43
|
+
|
44
|
+
def define_type(klass, &block)
|
45
|
+
TYPES[klass] = process(klass, GoodData::LCM2::Dsl::TypeDsl, 'TYPE', &block)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,61 @@
|
|
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
|
+
|
6
|
+
# LICENSE file in the root directory of this source tree.
|
7
|
+
|
8
|
+
require_relative '../types/param'
|
9
|
+
|
10
|
+
module GoodData
|
11
|
+
module LCM2
|
12
|
+
module Dsl
|
13
|
+
class ParamsDsl
|
14
|
+
def initialize
|
15
|
+
@params = {}
|
16
|
+
|
17
|
+
new_param
|
18
|
+
end
|
19
|
+
|
20
|
+
attr_reader :params
|
21
|
+
|
22
|
+
def array_of(type)
|
23
|
+
Type::ArrayType.new(type)
|
24
|
+
end
|
25
|
+
|
26
|
+
def instance_of(type)
|
27
|
+
type.new
|
28
|
+
end
|
29
|
+
|
30
|
+
def one_of(_type)
|
31
|
+
Type::EnumType.new
|
32
|
+
end
|
33
|
+
|
34
|
+
def new_param
|
35
|
+
@param = Type::Param.new
|
36
|
+
end
|
37
|
+
|
38
|
+
def description(desc)
|
39
|
+
@param.description = desc
|
40
|
+
end
|
41
|
+
|
42
|
+
def param(name, type, opts = {})
|
43
|
+
@param.name = name
|
44
|
+
@param.type = type
|
45
|
+
@param.opts = opts
|
46
|
+
|
47
|
+
@params[name] = {
|
48
|
+
name: @param.name,
|
49
|
+
type: @param.type,
|
50
|
+
opts: @param.opts,
|
51
|
+
description: @param.description,
|
52
|
+
category: @param.type.class.const_get(:CATEGORY)
|
53
|
+
}
|
54
|
+
|
55
|
+
# Create new instance of param
|
56
|
+
new_param
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,61 @@
|
|
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
|
+
|
6
|
+
# LICENSE file in the root directory of this source tree.
|
7
|
+
|
8
|
+
require_relative '../types/param'
|
9
|
+
|
10
|
+
module GoodData
|
11
|
+
module LCM2
|
12
|
+
module Dsl
|
13
|
+
class TypeDsl
|
14
|
+
def initialize
|
15
|
+
@params = {}
|
16
|
+
|
17
|
+
new_param
|
18
|
+
end
|
19
|
+
|
20
|
+
attr_reader :params
|
21
|
+
|
22
|
+
def array_of(type)
|
23
|
+
Type::ArrayType.new(type)
|
24
|
+
end
|
25
|
+
|
26
|
+
def instance_of(type)
|
27
|
+
type.new
|
28
|
+
end
|
29
|
+
|
30
|
+
def one_of(_type)
|
31
|
+
Type::EnumType.new
|
32
|
+
end
|
33
|
+
|
34
|
+
def new_param
|
35
|
+
@param = Type::Param.new
|
36
|
+
end
|
37
|
+
|
38
|
+
def description(desc)
|
39
|
+
@param.description = desc
|
40
|
+
end
|
41
|
+
|
42
|
+
def param(name, type, opts = {})
|
43
|
+
@param.name = name
|
44
|
+
@param.type = type
|
45
|
+
@param.opts = opts
|
46
|
+
|
47
|
+
@params[name] = {
|
48
|
+
name: @param.name,
|
49
|
+
type: @param.type,
|
50
|
+
opts: @param.opts,
|
51
|
+
description: @param.description,
|
52
|
+
category: @param.type.class.const_get(:CATEGORY)
|
53
|
+
}
|
54
|
+
|
55
|
+
# Create new instance of param
|
56
|
+
new_param
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,37 @@
|
|
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 'json'
|
8
|
+
|
9
|
+
module GoodData
|
10
|
+
module LCM2
|
11
|
+
class Helpers
|
12
|
+
class << self
|
13
|
+
def check_params(specification, params)
|
14
|
+
specification.keys.each do |param_name|
|
15
|
+
value = params[param_name]
|
16
|
+
type = specification[param_name][:type]
|
17
|
+
|
18
|
+
if value.nil?
|
19
|
+
if specification[param_name][:opts][:required]
|
20
|
+
fail("Mandatory parameter '#{param_name}' of type '#{type}' is not specified")
|
21
|
+
end
|
22
|
+
else
|
23
|
+
if type.class.const_get(:CATEGORY) == :complex && !value.is_a?(Hash)
|
24
|
+
puts JSON.pretty_generate(params)
|
25
|
+
fail "Expected parameter '#{param_name}' to be kind of '#{type}', got '#{value.class.name}'"
|
26
|
+
end
|
27
|
+
|
28
|
+
unless type.check(value)
|
29
|
+
fail "Parameter '#{param_name}' has invalid type, expected: #{type}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,12 @@
|
|
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 'pathname'
|
8
|
+
|
9
|
+
base = Pathname(__FILE__).dirname.expand_path
|
10
|
+
Dir.glob(base + '*.rb').each do |file|
|
11
|
+
require file
|
12
|
+
end
|
data/lib/gooddata/lcm/lcm.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
#
|
3
|
-
# Copyright (c) 2010-
|
3
|
+
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
|
4
4
|
# This source code is licensed under the BSD-style license found in the
|
5
5
|
# LICENSE file in the root directory of this source tree.
|
6
6
|
|
@@ -27,7 +27,9 @@ module GoodData
|
|
27
27
|
messages
|
28
28
|
end
|
29
29
|
|
30
|
-
def transfer_everything(client, domain, migration_spec,
|
30
|
+
def transfer_everything(client, domain, migration_spec, opts = {})
|
31
|
+
filter_on_segment = migration_spec[:segments] || migration_spec['segments'] || []
|
32
|
+
|
31
33
|
puts 'Ensuring Users - warning: works across whole domain not just provided segment(s)'
|
32
34
|
ensure_users(domain, migration_spec, filter_on_segment)
|
33
35
|
|
@@ -38,15 +40,53 @@ module GoodData
|
|
38
40
|
maql_replacements: opts[:maql_replacements] || opts['maql_replacements']
|
39
41
|
}
|
40
42
|
|
41
|
-
|
43
|
+
#########################################################
|
44
|
+
# New Architecture of Transfer Everything Functionality #
|
45
|
+
#########################################################
|
46
|
+
#
|
47
|
+
# modes = {
|
48
|
+
# release: [
|
49
|
+
# self.synchronize_ldm,
|
50
|
+
# self.synchronize_label_types,
|
51
|
+
# self.synchronize_meta, # Tag specified? If yes, transfer only tagged stuff. If not transfer all meta.
|
52
|
+
# self.synchronize_etl, # Processes, Schedules, Additional Params
|
53
|
+
# ],
|
54
|
+
# provisioning: [
|
55
|
+
# # self.ensure_titles # Handled by Provisioning Brick?
|
56
|
+
# self.ensure_users,
|
57
|
+
# self.delete_clients,
|
58
|
+
# self.provision_clients, # LCM API
|
59
|
+
# self.synchronize_label_types,
|
60
|
+
# self.synchronize_etl # Processes, Schedules, Additional Params
|
61
|
+
# ],
|
62
|
+
# rollout: [ # Works on segments only, not using collect_clients
|
63
|
+
# self.ensure_users,
|
64
|
+
# self.synchronize_ldm,
|
65
|
+
# self.synchronize_label_types,
|
66
|
+
# self.synchronize_etl, # Processes, Schedules, Additional Params
|
67
|
+
# self.synchronize_clients
|
68
|
+
# ]
|
69
|
+
# }
|
70
|
+
#
|
71
|
+
# mode_name = param['mode']
|
72
|
+
# mode_actions = modes[mode_name] || fail("Invalid mode specified: '#{mode_name}'")
|
73
|
+
# messages = mode_actions.map do |action|
|
74
|
+
# action(params)
|
75
|
+
# end
|
42
76
|
|
43
77
|
domain.segments.peach do |segment|
|
44
78
|
next if !filter_on_segment.empty? && !(filter_on_segment.include?(segment.id))
|
79
|
+
|
45
80
|
bp = segment.master_project.blueprint
|
46
81
|
segment.clients.each do |c|
|
47
82
|
p = c.project
|
48
83
|
p.update_from_blueprint(bp, bp_opts)
|
49
84
|
end
|
85
|
+
|
86
|
+
# target_projects = segment.clients.map(&:project)
|
87
|
+
|
88
|
+
# Transfer metadata objects
|
89
|
+
# GoodData::LCM.transfer_meta(segment.master_project, target_projects)
|
50
90
|
end
|
51
91
|
|
52
92
|
puts 'Migrating Processes and Schedules'
|
@@ -55,12 +95,16 @@ module GoodData
|
|
55
95
|
domain.clients.peach do |c|
|
56
96
|
segment = c.segment
|
57
97
|
next if !filter_on_segment.empty? && !(filter_on_segment.include?(segment.id))
|
98
|
+
|
58
99
|
segment_master = segment.master_project
|
59
100
|
project = c.project
|
101
|
+
|
60
102
|
# set metadata
|
103
|
+
# TODO: Review this and remove if not required or duplicate
|
104
|
+
# FIXME: TMA-210
|
61
105
|
project.set_metadata('GOODOT_CUSTOM_PROJECT_ID', c.id)
|
62
|
-
# copy processes
|
63
106
|
|
107
|
+
# copy processes
|
64
108
|
deployment_client_segment_master = deployment_client.projects(segment_master.pid)
|
65
109
|
deployment_client_project = deployment_client.projects(project.pid)
|
66
110
|
GoodData::Project.transfer_processes(deployment_client_segment_master, deployment_client_project)
|
@@ -69,6 +113,7 @@ module GoodData
|
|
69
113
|
|
70
114
|
# Set up unique parameters
|
71
115
|
deployment_client_project.schedules.peach do |s|
|
116
|
+
# TODO: Review this and remove if not required or duplicate (GOODOT_CUSTOM_PROJECT_ID vs CLIENT_ID)
|
72
117
|
s.update_params('GOODOT_CUSTOM_PROJECT_ID' => c.id)
|
73
118
|
s.update_params('CLIENT_ID' => c.id)
|
74
119
|
s.update_params('SEGMENT_ID' => segment.id)
|
@@ -77,24 +122,35 @@ module GoodData
|
|
77
122
|
s.save
|
78
123
|
end
|
79
124
|
|
80
|
-
|
125
|
+
# Transfer label types
|
126
|
+
begin
|
127
|
+
GoodData::LCM.transfer_label_types(segment_master, project)
|
128
|
+
rescue => e
|
129
|
+
puts "Unable to transfer label_types, reason: #{e.message}"
|
130
|
+
end
|
131
|
+
|
132
|
+
# Transfer tagged objects
|
133
|
+
# FIXME: Make sure it is not duplicate functionality mentioned in TMA-171
|
134
|
+
tag = migration_spec[:production_tag]
|
135
|
+
GoodData::Project.transfer_tagged_stuff(segment_master, project, tag) if tag
|
81
136
|
end
|
82
137
|
|
83
|
-
|
84
|
-
if
|
85
|
-
|
86
|
-
|
87
|
-
|
138
|
+
do_not_synchronize_clients = migration_spec[:do_not_synchronize_clients]
|
139
|
+
if do_not_synchronize_clients.nil? || !do_not_synchronize_clients
|
140
|
+
puts 'Migrating Dashboards'
|
141
|
+
if filter_on_segment.empty?
|
142
|
+
domain.synchronize_clients
|
143
|
+
else
|
144
|
+
filter_on_segment.map do |s|
|
145
|
+
domain.segments(s).synchronize_clients
|
146
|
+
end
|
147
|
+
end
|
88
148
|
end
|
89
149
|
end
|
90
150
|
|
91
151
|
def transfer_label_types(source_project, targets)
|
92
152
|
semaphore = Mutex.new
|
93
153
|
|
94
|
-
synchronized_puts = proc do |*args|
|
95
|
-
semaphore.synchronize { puts args }
|
96
|
-
end
|
97
|
-
|
98
154
|
# Convert to array
|
99
155
|
targets = [targets] unless targets.is_a?(Array)
|
100
156
|
|
@@ -118,8 +174,8 @@ module GoodData
|
|
118
174
|
transfer = {}
|
119
175
|
display_forms.each { |display_form| transfer[display_form['meta']['identifier']] = display_form['content']['type'] }
|
120
176
|
|
121
|
-
|
122
|
-
|
177
|
+
GoodData.logger.info 'Transferring label types'
|
178
|
+
GoodData.logger.info JSON.pretty_generate(transfer)
|
123
179
|
|
124
180
|
# Transfer to target projects
|
125
181
|
targets.peach do |target|
|
@@ -131,16 +187,101 @@ module GoodData
|
|
131
187
|
|
132
188
|
if obj
|
133
189
|
if obj.content['type'] != type
|
134
|
-
|
190
|
+
semaphore.synchronize do
|
191
|
+
GoodData.logger.info "Updating #{identifier} -> #{type} in '#{target.title}'"
|
192
|
+
end
|
193
|
+
|
135
194
|
obj.content['type'] = type
|
136
195
|
obj.save
|
137
|
-
else
|
138
|
-
synchronized_puts.call "Identifier #{identifier} in '#{target.title}' already has desired type - #{type}"
|
139
196
|
end
|
140
197
|
else
|
141
|
-
|
198
|
+
semaphore.synchronize do
|
199
|
+
GoodData.logger.warn "Unable to find #{identifier} in '#{target.title}'"
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
nil
|
204
|
+
end
|
205
|
+
|
206
|
+
nil
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
# Synchronizes the dashboards tagged with the +$PRODUCTION_TAG+ from development project to master projects
|
211
|
+
# Params:
|
212
|
+
# +source_workspace+:: workspace with the tagged dashboards that are going to be synchronized to the target workspaces
|
213
|
+
# +target_workspaces+:: array of target workspaces where the tagged dashboards are going be synchronized to
|
214
|
+
def transfer_meta(source_workspace, target_workspaces, tag = nil)
|
215
|
+
objects = get_dashboards(source_workspace, tag)
|
216
|
+
begin
|
217
|
+
token = source_workspace.objects_export(objects)
|
218
|
+
GoodData.logger.info "Export token: '#{token}'"
|
219
|
+
rescue => e
|
220
|
+
GoodData.logger.error "Export failed, reason: #{e.message}"
|
221
|
+
end
|
222
|
+
target_workspaces.each do |target_workspace|
|
223
|
+
begin
|
224
|
+
target_workspace.objects_import(token)
|
225
|
+
rescue => e
|
226
|
+
GoodData.logger.error "Import failed, reason: #{e.message}"
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
# Retrieves all dashboards tagged with the +$PRODUCTION_TAG+ from the +workspace+
|
232
|
+
# Params:
|
233
|
+
# +workspace+:: workspace with the tagged dashboards
|
234
|
+
# Returns enumeration of the tagged dashboards URIs
|
235
|
+
def get_dashboards(workspace, tag = nil)
|
236
|
+
if tag
|
237
|
+
GoodData::Dashboard.find_by_tag(tag, project: workspace, client: workspace.client).map(&:uri)
|
238
|
+
else
|
239
|
+
GoodData::Dashboard.all(project: workspace, client: workspace.client).map(&:uri)
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
def transfer_attribute_drillpaths(source_project, targets)
|
244
|
+
semaphore = Mutex.new
|
245
|
+
|
246
|
+
# Convert to array
|
247
|
+
targets = [targets] unless targets.is_a?(Array)
|
248
|
+
|
249
|
+
# Get attributes from source project
|
250
|
+
attributes = source_project.attributes
|
251
|
+
|
252
|
+
# Generate transfer table
|
253
|
+
drill_paths = attributes.map do |attribute|
|
254
|
+
[attribute.meta['identifier'], attribute.content['drillDownStepAttributeDF']]
|
255
|
+
end
|
256
|
+
transfer = Hash[*drill_paths.flatten].compact
|
257
|
+
|
258
|
+
# Transfer to target projects
|
259
|
+
targets.peach do |target|
|
260
|
+
transfer.peach do |identifier, drill_path|
|
261
|
+
uri = GoodData::MdObject.identifier_to_uri({ project: target, client: target.client }, identifier)
|
262
|
+
next unless uri
|
263
|
+
|
264
|
+
obj = GoodData::MdObject[uri, { project: target, client: target.client }]
|
265
|
+
|
266
|
+
if obj
|
267
|
+
if !obj.content['drillDownStepAttributeDF'] || obj.content['drillDownStepAttributeDF'] != drill_path
|
268
|
+
semaphore.synchronize do
|
269
|
+
GoodData.logger.info "Updating drill path of #{identifier} -> #{drill_path} in '#{target.title}'"
|
270
|
+
end
|
271
|
+
|
272
|
+
obj.content['drillDownStepAttributeDF'] = drill_path
|
273
|
+
obj.save
|
274
|
+
end
|
275
|
+
else
|
276
|
+
semaphore.synchronize do
|
277
|
+
GoodData.logger.warn "Unable to find #{identifier} in '#{target.title}'"
|
278
|
+
end
|
142
279
|
end
|
280
|
+
|
281
|
+
nil
|
143
282
|
end
|
283
|
+
|
284
|
+
nil
|
144
285
|
end
|
145
286
|
end
|
146
287
|
end
|