gooddata 0.6.54 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.document +0 -0
- data/.editorconfig +0 -0
- data/.travis.yml +9 -0
- data/.yardopts +0 -0
- data/CHANGELOG.md +7 -0
- data/CLI.md +0 -0
- data/Gemfile +0 -0
- data/Guardfile +0 -0
- data/LICENSE +0 -0
- data/LICENSE.rb +0 -0
- data/TODO.md +0 -0
- data/dependency_decisions.yml +0 -0
- data/gooddata.gemspec +1 -1
- data/lib/gooddata/app/app.rb +0 -0
- data/lib/gooddata/bricks/brick.rb +0 -0
- data/lib/gooddata/bricks/bricks.rb +0 -0
- data/lib/gooddata/bricks/middleware/base_middleware.rb +0 -0
- data/lib/gooddata/bricks/middleware/bench_middleware.rb +0 -0
- data/lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb +0 -0
- data/lib/gooddata/bricks/middleware/decode_params_middleware.rb +0 -0
- data/lib/gooddata/bricks/middleware/fs_download_middleware.rb +0 -0
- data/lib/gooddata/bricks/middleware/fs_upload_middleware.rb +0 -0
- data/lib/gooddata/bricks/middleware/middleware.rb +0 -0
- data/lib/gooddata/bricks/middleware/stdout_middleware.rb +0 -0
- data/lib/gooddata/bricks/middleware/twitter_middleware.rb +0 -0
- data/lib/gooddata/bricks/middleware/undot_params_middleware.rb +0 -0
- data/lib/gooddata/bricks/pipeline.rb +0 -0
- data/lib/gooddata/bricks/utils.rb +0 -0
- data/lib/gooddata/cli/cli.rb +0 -0
- data/lib/gooddata/cli/commands/auth_cmd.rb +0 -0
- data/lib/gooddata/cli/commands/domain_cmd.rb +0 -0
- data/lib/gooddata/cli/commands/project_cmd.rb +0 -0
- data/lib/gooddata/cli/hooks.rb +0 -0
- data/lib/gooddata/cli/shared.rb +0 -0
- data/lib/gooddata/cli/terminal.rb +0 -0
- data/lib/gooddata/commands/api.rb +0 -0
- data/lib/gooddata/commands/auth.rb +0 -0
- data/lib/gooddata/commands/base.rb +0 -0
- data/lib/gooddata/commands/commands.rb +0 -0
- data/lib/gooddata/commands/datasets.rb +0 -0
- data/lib/gooddata/commands/datawarehouse.rb +0 -0
- data/lib/gooddata/commands/domain.rb +0 -0
- data/lib/gooddata/commands/process.rb +0 -0
- data/lib/gooddata/commands/project.rb +0 -0
- data/lib/gooddata/commands/projects.rb +0 -0
- data/lib/gooddata/commands/role.rb +0 -0
- data/lib/gooddata/commands/runners.rb +0 -0
- data/lib/gooddata/commands/scaffold.rb +0 -0
- data/lib/gooddata/commands/user.rb +0 -0
- data/lib/gooddata/connection.rb +0 -0
- data/lib/gooddata/core/core.rb +0 -0
- data/lib/gooddata/core/logging.rb +0 -0
- data/lib/gooddata/core/nil_logger.rb +0 -0
- data/lib/gooddata/core/project.rb +0 -0
- data/lib/gooddata/core/rest.rb +0 -0
- data/lib/gooddata/core/user.rb +0 -0
- data/lib/gooddata/data/data.rb +0 -0
- data/lib/gooddata/data/guesser.rb +0 -0
- data/lib/gooddata/exceptions/attr_element_not_found.rb +0 -0
- data/lib/gooddata/exceptions/command_failed.rb +0 -0
- data/lib/gooddata/exceptions/exceptions.rb +0 -0
- data/lib/gooddata/exceptions/execution_limit_exceeded.rb +0 -0
- data/lib/gooddata/exceptions/export_clone.rb +0 -0
- data/lib/gooddata/exceptions/filter_maqlization.rb +0 -0
- data/lib/gooddata/exceptions/import_clone.rb +0 -0
- data/lib/gooddata/exceptions/malformed_user.rb +0 -0
- data/lib/gooddata/exceptions/maql_execution.rb +0 -0
- data/lib/gooddata/exceptions/object_migration.rb +0 -0
- data/lib/gooddata/exceptions/project_not_found.rb +0 -0
- data/lib/gooddata/exceptions/segment_not_empty.rb +0 -0
- data/lib/gooddata/exceptions/uncomputable_report.rb +0 -0
- data/lib/gooddata/exceptions/user_in_different_domain.rb +0 -0
- data/lib/gooddata/exceptions/validation_error.rb +0 -0
- data/lib/gooddata/extensions/big_decimal.rb +0 -0
- data/lib/gooddata/extensions/class.rb +0 -0
- data/lib/gooddata/extensions/extensions.rb +0 -0
- data/lib/gooddata/extensions/false.rb +0 -0
- data/lib/gooddata/extensions/hash.rb +0 -0
- data/lib/gooddata/extensions/integer.rb +0 -0
- data/lib/gooddata/extensions/nil.rb +0 -0
- data/lib/gooddata/extensions/numeric.rb +0 -0
- data/lib/gooddata/extensions/object.rb +0 -0
- data/lib/gooddata/extensions/string.rb +0 -0
- data/lib/gooddata/extensions/symbol.rb +0 -0
- data/lib/gooddata/extensions/true.rb +0 -0
- data/lib/gooddata/extract.rb +0 -0
- data/lib/gooddata/goodzilla/goodzilla.rb +0 -0
- data/lib/gooddata/helpers/auth_helpers.rb +0 -0
- data/lib/gooddata/helpers/csv_helper.rb +0 -0
- data/lib/gooddata/helpers/erb_helper.rb +0 -0
- data/lib/gooddata/helpers/global_helpers.rb +0 -0
- data/lib/gooddata/helpers/helpers.rb +0 -0
- data/lib/gooddata/lcm/actions/actions.rb +0 -0
- data/lib/gooddata/lcm/actions/base_action.rb +0 -0
- data/lib/gooddata/lcm/actions/collect_data_product.rb +4 -9
- data/lib/gooddata/lcm/actions/collect_segments.rb +2 -1
- data/lib/gooddata/lcm/actions/collect_users_brick_users.rb +46 -0
- data/lib/gooddata/lcm/actions/synchronize_user_filters.rb +8 -22
- data/lib/gooddata/lcm/actions/synchronize_users.rb +17 -5
- data/lib/gooddata/lcm/data/create_lcm_release.sql.erb +0 -0
- data/lib/gooddata/lcm/data/insert_into_lcm_release.sql.erb +0 -0
- data/lib/gooddata/lcm/data/select_from_lcm_release.sql.erb +0 -0
- data/lib/gooddata/lcm/data/update_lcm_release.sql.erb +0 -0
- data/lib/gooddata/lcm/dsl/dsl.rb +0 -0
- data/lib/gooddata/lcm/dsl/params_dsl.rb +0 -0
- data/lib/gooddata/lcm/helpers/helpers.rb +0 -0
- data/lib/gooddata/lcm/lcm2.rb +2 -0
- data/lib/gooddata/lcm/types/base_type.rb +0 -0
- data/lib/gooddata/lcm/types/class/ads_client.rb +0 -0
- data/lib/gooddata/lcm/types/class/class.rb +0 -0
- data/lib/gooddata/lcm/types/class/gd_client.rb +0 -0
- data/lib/gooddata/lcm/types/class/types.rb +0 -0
- data/lib/gooddata/lcm/types/complex/complex.rb +0 -0
- data/lib/gooddata/lcm/types/complex/release_query.rb +0 -0
- data/lib/gooddata/lcm/types/complex/tokens.rb +0 -0
- data/lib/gooddata/lcm/types/complex/types.rb +0 -0
- data/lib/gooddata/lcm/types/complex/users_brick_config.rb +32 -0
- data/lib/gooddata/lcm/types/param.rb +0 -0
- data/lib/gooddata/lcm/types/scalar/bool.rb +0 -0
- data/lib/gooddata/lcm/types/scalar/hash.rb +0 -0
- data/lib/gooddata/lcm/types/scalar/integer.rb +0 -0
- data/lib/gooddata/lcm/types/scalar/object.rb +0 -0
- data/lib/gooddata/lcm/types/scalar/string.rb +0 -0
- data/lib/gooddata/lcm/types/scalar/types.rb +0 -0
- data/lib/gooddata/lcm/types/special/types.rb +0 -0
- data/lib/gooddata/lcm/types/types.rb +0 -0
- data/lib/gooddata/lcm/user_bricks_helper.rb +32 -0
- data/lib/gooddata/mixins/author.rb +0 -0
- data/lib/gooddata/mixins/content_getter.rb +0 -0
- data/lib/gooddata/mixins/content_property_reader.rb +0 -0
- data/lib/gooddata/mixins/content_property_writer.rb +0 -0
- data/lib/gooddata/mixins/contributor.rb +0 -0
- data/lib/gooddata/mixins/data_getter.rb +0 -0
- data/lib/gooddata/mixins/data_property_reader.rb +0 -0
- data/lib/gooddata/mixins/data_property_writer.rb +0 -0
- data/lib/gooddata/mixins/inspector.rb +0 -0
- data/lib/gooddata/mixins/is_attribute.rb +0 -0
- data/lib/gooddata/mixins/is_dimension.rb +0 -0
- data/lib/gooddata/mixins/is_fact.rb +0 -0
- data/lib/gooddata/mixins/is_folder.rb +0 -0
- data/lib/gooddata/mixins/is_label.rb +0 -0
- data/lib/gooddata/mixins/links.rb +0 -0
- data/lib/gooddata/mixins/md_grantees.rb +0 -0
- data/lib/gooddata/mixins/md_lock.rb +0 -0
- data/lib/gooddata/mixins/md_object_id.rb +0 -0
- data/lib/gooddata/mixins/md_relations.rb +0 -0
- data/lib/gooddata/mixins/meta_getter.rb +0 -0
- data/lib/gooddata/mixins/meta_property_reader.rb +0 -0
- data/lib/gooddata/mixins/meta_property_writer.rb +0 -0
- data/lib/gooddata/mixins/mixins.rb +0 -0
- data/lib/gooddata/mixins/not_attribute.rb +0 -0
- data/lib/gooddata/mixins/not_exportable.rb +0 -0
- data/lib/gooddata/mixins/not_fact.rb +0 -0
- data/lib/gooddata/mixins/not_group.rb +0 -0
- data/lib/gooddata/mixins/not_label.rb +0 -0
- data/lib/gooddata/mixins/not_metric.rb +0 -0
- data/lib/gooddata/mixins/obj_id.rb +0 -0
- data/lib/gooddata/mixins/rest_getters.rb +0 -0
- data/lib/gooddata/mixins/rest_resource.rb +0 -0
- data/lib/gooddata/mixins/root_key_getter.rb +0 -0
- data/lib/gooddata/mixins/root_key_setter.rb +0 -0
- data/lib/gooddata/mixins/timestamps.rb +0 -0
- data/lib/gooddata/mixins/to_json.rb +0 -0
- data/lib/gooddata/mixins/uri_getter.rb +0 -0
- data/lib/gooddata/models/ads_output_stage.rb +0 -0
- data/lib/gooddata/models/automated_data_distribution.rb +0 -0
- data/lib/gooddata/models/blueprint/anchor_field.rb +0 -0
- data/lib/gooddata/models/blueprint/attribute_field.rb +0 -0
- data/lib/gooddata/models/blueprint/blueprint.rb +0 -0
- data/lib/gooddata/models/blueprint/blueprint_field.rb +0 -0
- data/lib/gooddata/models/blueprint/dashboard_builder.rb +0 -0
- data/lib/gooddata/models/blueprint/dataset_blueprint.rb +0 -0
- data/lib/gooddata/models/blueprint/fact_field.rb +0 -0
- data/lib/gooddata/models/blueprint/label_field.rb +0 -0
- data/lib/gooddata/models/blueprint/reference_field.rb +0 -0
- data/lib/gooddata/models/blueprint/schema_blueprint.rb +0 -0
- data/lib/gooddata/models/blueprint/schema_builder.rb +0 -0
- data/lib/gooddata/models/blueprint/to_manifest.rb +0 -0
- data/lib/gooddata/models/channel_configuration.rb +0 -0
- data/lib/gooddata/models/client_synchronization_result.rb +0 -0
- data/lib/gooddata/models/client_synchronization_result_details.rb +0 -0
- data/lib/gooddata/models/datawarehouse.rb +0 -0
- data/lib/gooddata/models/execution.rb +0 -0
- data/lib/gooddata/models/execution_detail.rb +0 -0
- data/lib/gooddata/models/invitation.rb +0 -0
- data/lib/gooddata/models/links.rb +0 -0
- data/lib/gooddata/models/metadata/dashboard/dashboard_item.rb +0 -0
- data/lib/gooddata/models/metadata/dashboard/filter_apply_item.rb +0 -0
- data/lib/gooddata/models/metadata/dashboard/filter_item.rb +0 -0
- data/lib/gooddata/models/metadata/dashboard/geo_chart_item.rb +0 -0
- data/lib/gooddata/models/metadata/dashboard/headline_item.rb +0 -0
- data/lib/gooddata/models/metadata/dashboard/iframe_item.rb +0 -0
- data/lib/gooddata/models/metadata/dashboard/report_item.rb +0 -0
- data/lib/gooddata/models/metadata/dashboard/text_item.rb +0 -0
- data/lib/gooddata/models/metadata/dashboard_tab.rb +0 -0
- data/lib/gooddata/models/metadata/label.rb +0 -0
- data/lib/gooddata/models/metadata/metadata.rb +0 -0
- data/lib/gooddata/models/metadata/report.rb +10 -0
- data/lib/gooddata/models/metadata/scheduled_mail/dashboard_attachment.rb +0 -0
- data/lib/gooddata/models/metadata/scheduled_mail/report_attachment.rb +0 -0
- data/lib/gooddata/models/models.rb +0 -0
- data/lib/gooddata/models/module_constants.rb +0 -0
- data/lib/gooddata/models/notification_rule.rb +0 -0
- data/lib/gooddata/models/project_log_formatter.rb +0 -0
- data/lib/gooddata/models/project_metadata.rb +0 -0
- data/lib/gooddata/models/tab_builder.rb +0 -0
- data/lib/gooddata/models/user_filters/mandatory_user_filter.rb +0 -0
- data/lib/gooddata/models/user_filters/user_filter_builder.rb +24 -12
- data/lib/gooddata/models/user_filters/user_filters.rb +0 -0
- data/lib/gooddata/rest/README.md +0 -0
- data/lib/gooddata/rest/connection.rb +15 -3
- data/lib/gooddata/rest/object.rb +0 -0
- data/lib/gooddata/rest/resource.rb +0 -0
- data/lib/gooddata/rest/rest.rb +0 -0
- data/lib/gooddata/version.rb +1 -1
- data/lib/templates/bricks/brick.rb.erb +0 -0
- data/lib/templates/bricks/main.rb.erb +0 -0
- data/lib/templates/project/Goodfile.erb +0 -0
- data/lib/templates/project/data/commits.csv +0 -0
- data/lib/templates/project/data/devs.csv +0 -0
- data/lib/templates/project/data/repos.csv +0 -0
- data/lib/templates/project/model/model.rb.erb +0 -0
- data/spec/.rubocop.yml +0 -0
- data/spec/bricks/bricks_spec.rb +0 -0
- data/spec/bricks/default-config.json +0 -0
- data/spec/data/.gooddata +0 -0
- data/spec/data/blueprints/additional_dataset_module.json +0 -0
- data/spec/data/blueprints/attribute_sort_order_blueprint.json +0 -0
- data/spec/data/blueprints/big_blueprint_not_pruned.json +0 -0
- data/spec/data/blueprints/m_n_model.json +0 -0
- data/spec/data/blueprints/model_module.json +0 -0
- data/spec/data/cc/data/source/commits.csv +0 -0
- data/spec/data/cc/data/source/devs.csv +0 -0
- data/spec/data/cc/data/source/repos.csv +0 -0
- data/spec/data/cc/devel.prm +0 -0
- data/spec/data/cc/graph/graph.grf +0 -0
- data/spec/data/cc/workspace.prm +0 -0
- data/spec/data/column_based_permissions.csv +0 -0
- data/spec/data/column_based_permissions2.csv +0 -0
- data/spec/data/gd_gse_data_blueprint.json +0 -0
- data/spec/data/gd_gse_data_manifest.json +0 -0
- data/spec/data/gd_gse_data_model.json +0 -0
- data/spec/data/gooddata_version_process/gooddata_version.rb +0 -0
- data/spec/data/gooddata_version_process/gooddata_version.zip +0 -0
- data/spec/data/hello_world_process/hello_world.rb +0 -0
- data/spec/data/hello_world_process/hello_world.zip +0 -0
- data/spec/data/line_based_permissions.csv +0 -0
- data/spec/data/manifests/test_blueprint.json +0 -0
- data/spec/data/manifests/test_project.json +0 -0
- data/spec/data/reports/left_attr_report.json +0 -0
- data/spec/data/reports/metric_only_one_line.json +0 -0
- data/spec/data/reports/report_1.json +0 -0
- data/spec/data/reports/top_attr_report.json +0 -0
- data/spec/data/ruby_params_process/ruby_params.rb +0 -0
- data/spec/data/ruby_process/deep_files/deep_stuff.txt +0 -0
- data/spec/data/ruby_process/process.rb +0 -0
- data/spec/data/ruby_process/stuff.txt +0 -0
- data/spec/data/superfluous_titles_view.json +0 -0
- data/spec/data/test-ci-data.csv +0 -0
- data/spec/data/users.csv +0 -0
- data/spec/data/wire_models/attribute_sort_by_model.json +0 -0
- data/spec/data/wire_models/model_view.json +0 -0
- data/spec/data/wire_models/nu_model.json +0 -0
- data/spec/data/wire_test_project.json +0 -0
- data/spec/environment/default.rb +0 -0
- data/spec/environment/environment.rb +0 -0
- data/spec/environment/production.rb +0 -0
- data/spec/helpers/blueprint_helper.rb +0 -0
- data/spec/helpers/cli_helper.rb +0 -0
- data/spec/helpers/connection_helper.rb +0 -0
- data/spec/helpers/crypto_helper.rb +0 -0
- data/spec/helpers/csv_helper.rb +0 -0
- data/spec/helpers/project_helper.rb +13 -0
- data/spec/helpers/spec_helper.rb +0 -0
- data/spec/integration/blueprint_updates_spec.rb +0 -0
- data/spec/integration/blueprint_with_grain_spec.rb +0 -0
- data/spec/integration/channel_configuration_spec.rb +0 -0
- data/spec/integration/command_projects_spec.rb +0 -0
- data/spec/integration/create_project_spec.rb +0 -0
- data/spec/integration/deprecated_load_spec.rb +0 -0
- data/spec/integration/full_project_spec.rb +3 -5
- data/spec/integration/models/metadata/report_spec.rb +54 -0
- data/spec/integration/over_to_user_filters_spec.rb +0 -0
- data/spec/integration/partial_md_export_import_spec.rb +0 -0
- data/spec/integration/rest_spec.rb +0 -0
- data/spec/integration/schedule_spec.rb +0 -0
- data/spec/integration/user_group_spec.rb +0 -0
- data/spec/logging_in_logging_out_spec.rb +0 -0
- data/spec/unit/actions/collect_data_product_spec.rb +9 -17
- data/spec/unit/actions/collect_users_brick_users_spec.rb +36 -0
- data/spec/unit/actions/shared_examples_for_user_actions.rb +17 -1
- data/spec/unit/actions/synchronize_user_filters_spec.rb +5 -1
- data/spec/unit/actions/synchronize_users_spec.rb +64 -6
- data/spec/unit/bricks/bricks_spec.rb +0 -0
- data/spec/unit/bricks/middleware/bench_middleware_spec.rb +0 -0
- data/spec/unit/bricks/middleware/bulk_salesforce_middleware_spec.rb +0 -0
- data/spec/unit/bricks/middleware/gooddata_middleware_spec.rb +0 -0
- data/spec/unit/bricks/middleware/restforce_middleware_spec.rb +0 -0
- data/spec/unit/bricks/middleware/stdout_middleware_spec.rb +0 -0
- data/spec/unit/bricks/middleware/twitter_middleware_spec.rb +0 -0
- data/spec/unit/cli/cli_spec.rb +0 -0
- data/spec/unit/cli/commands/cmd_auth_spec.rb +0 -0
- data/spec/unit/core/nil_logger_spec.rb +0 -0
- data/spec/unit/extensions/hash_spec.rb +0 -0
- data/spec/unit/godzilla/goodzilla_spec.rb +0 -0
- data/spec/unit/helpers/csv_helper_spec.rb +0 -0
- data/spec/unit/lcm/user_bricks_helper_spec.rb +58 -0
- data/spec/unit/models/blueprint/attribute_sort_by_spec.rb +0 -0
- data/spec/unit/models/blueprint/attributes_spec.rb +0 -0
- data/spec/unit/models/blueprint/dataset_spec.rb +0 -0
- data/spec/unit/models/blueprint/labels_spec.rb +0 -0
- data/spec/unit/models/blueprint/reference_spec.rb +0 -0
- data/spec/unit/models/blueprint/schema_builder_spec.rb +0 -0
- data/spec/unit/models/blueprint/to_wire_spec.rb +0 -0
- data/spec/unit/models/execution_spec.rb +0 -0
- data/spec/unit/models/from_wire_spec.rb +0 -0
- data/spec/unit/models/metric_spec.rb +0 -0
- data/spec/unit/models/model_spec.rb +0 -0
- data/spec/unit/models/report_result_data_spec.rb +0 -0
- data/spec/unit/models/user_filters/user_filter_builder_spec.rb +110 -0
- data/spec/unit/models/user_filters_spec.rb +0 -0
- data/spec/unit/models/variable_spec.rb +0 -0
- data/spec/unit/rest/resource_spec.rb +0 -0
- metadata +148 -94
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/gooddata/lcm/dsl/dsl.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
data/lib/gooddata/lcm/lcm2.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,32 @@
|
|
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_relative '../base_type'
|
8
|
+
|
9
|
+
require_relative '../special/array'
|
10
|
+
require_relative 'complex'
|
11
|
+
|
12
|
+
module GoodData
|
13
|
+
module LCM2
|
14
|
+
module Type
|
15
|
+
class UsersBrickConfig < ComplexType
|
16
|
+
CATEGORY = :complex
|
17
|
+
|
18
|
+
PARAMS = define_type(self) do
|
19
|
+
description 'Source of the users table'
|
20
|
+
param :input_source, instance_of(Type::HashType), required: true
|
21
|
+
|
22
|
+
description 'Name of the column of user logins'
|
23
|
+
param :login_column, instance_of(Type::StringType), required: false
|
24
|
+
end
|
25
|
+
|
26
|
+
def check(value)
|
27
|
+
BaseType.check_params(PARAMS, value)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module GoodData
|
2
|
+
module LCM2
|
3
|
+
# Contains code shared by Users Brick and User Filters Brick
|
4
|
+
class UserBricksHelper
|
5
|
+
class << self
|
6
|
+
def resolve_client_id(domain, project, data_product)
|
7
|
+
md = project.metadata
|
8
|
+
goodot_id = md['GOODOT_CUSTOM_PROJECT_ID'].to_s
|
9
|
+
|
10
|
+
client = domain.clients(:all, data_product).find do |c|
|
11
|
+
c.project_uri == project.uri
|
12
|
+
end
|
13
|
+
if goodot_id.empty? && client.nil?
|
14
|
+
fail "Project \"#{project.pid}\" metadata does not contain key " \
|
15
|
+
"GOODOT_CUSTOM_PROJECT_ID neither is it mapped to a " \
|
16
|
+
"client_id in LCM metadata. We are unable to get the " \
|
17
|
+
"values for user filters."
|
18
|
+
end
|
19
|
+
|
20
|
+
unless goodot_id.empty? || client.nil? || (goodot_id == client.id)
|
21
|
+
fail "GOODOT_CUSTOM_PROJECT_ID metadata key is provided for " \
|
22
|
+
"project \"#{project.pid}\" but doesn't match client id " \
|
23
|
+
"assigned to the project in LCM metadata. " \
|
24
|
+
"Please resolve the conflict."
|
25
|
+
end
|
26
|
+
|
27
|
+
goodot_id.empty? ? client.id : goodot_id
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -174,6 +174,16 @@ module GoodData
|
|
174
174
|
client.poll_on_code(result1['uri'], options.merge(process: false))
|
175
175
|
end
|
176
176
|
|
177
|
+
# Exports a report too large to be computed on the UI. It executes in raw form.
|
178
|
+
# Saves the result into file.
|
179
|
+
#
|
180
|
+
# @param filename [String] Filename to save into
|
181
|
+
# @return [Net::HTTPResponse] Returns HTTP status
|
182
|
+
def export_raw(filename)
|
183
|
+
result = client.post("/gdc/app/projects/#{project.pid}/execute/raw", 'report_req' => { 'report' => uri })
|
184
|
+
client.download(result['uri'], filename, url_encode: false)
|
185
|
+
end
|
186
|
+
|
177
187
|
# Returns the newest (current version) report definition uri
|
178
188
|
#
|
179
189
|
# @return [String] Returns uri of the newest report defintion
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -261,23 +261,19 @@ module GoodData
|
|
261
261
|
#
|
262
262
|
# @param filters [Array<Hash>] Filters definition
|
263
263
|
# @return [Array] first is list of MAQL statements
|
264
|
-
def self.maqlify_filters(filters, options = {})
|
264
|
+
def self.maqlify_filters(filters, project_users, options = {})
|
265
265
|
fail_early = options[:fail_early] == false ? false : true
|
266
266
|
users_cache = options[:users_cache]
|
267
267
|
labels_cache = create_label_cache(filters, options)
|
268
268
|
small_labels = get_small_labels(labels_cache)
|
269
269
|
lookups_cache = create_lookups_cache(small_labels)
|
270
270
|
attrs_cache = create_attrs_cache(filters, options)
|
271
|
-
users = Hash[
|
272
|
-
options[:project].users.map do |user|
|
273
|
-
[user.login, user.profile_url]
|
274
|
-
end
|
275
|
-
]
|
276
271
|
create_filter_proc = proc do |login, f|
|
277
272
|
expression, errors = create_expression(f, labels_cache, lookups_cache, attrs_cache, options)
|
278
273
|
profiles_uri = if options[:type] == :muf
|
279
|
-
|
280
|
-
|
274
|
+
project_user = project_users.find { |u| u.login == login }
|
275
|
+
|
276
|
+
project_user.nil? ? ('/gdc/account/profile/' + login) : project_user.profile_url
|
281
277
|
elsif options[:type] == :variable
|
282
278
|
(users_cache[login] && users_cache[login].uri)
|
283
279
|
else
|
@@ -373,13 +369,16 @@ module GoodData
|
|
373
369
|
dry_run = options[:dry_run]
|
374
370
|
project_log_formatter = GoodData::ProjectLogFormatter.new(project)
|
375
371
|
|
372
|
+
project_users = project.users
|
376
373
|
filters = normalize_filters(user_filters)
|
377
|
-
user_filters, errors = maqlify_filters(filters, options.merge(users_must_exist: users_must_exist, type: :muf))
|
374
|
+
user_filters, errors = maqlify_filters(filters, project_users, options.merge(users_must_exist: users_must_exist, type: :muf))
|
378
375
|
|
379
376
|
fail GoodData::FilterMaqlizationError, errors if !ignore_missing_values && !errors.empty?
|
380
377
|
filters = user_filters.map { |data| client.create(MandatoryUserFilter, data, project: project) }
|
381
378
|
to_create, to_delete = resolve_user_filters(filters, project.data_permissions)
|
382
379
|
|
380
|
+
to_delete = sanitize_filters_to_delete(to_delete, options[:users_brick_input], project_users)
|
381
|
+
|
383
382
|
if options[:do_not_touch_filters_that_are_not_mentioned]
|
384
383
|
GoodData.logger.warn("Data permissions computed: #{to_create.count} to create")
|
385
384
|
else
|
@@ -500,14 +499,14 @@ module GoodData
|
|
500
499
|
missing_users = get_missing_users(filters, options.merge(users_cache: users_cache))
|
501
500
|
user_filters, errors = if missing_users.empty?
|
502
501
|
verify_existing_users(filters, project: project, users_must_exist: users_must_exist, users_cache: users_cache)
|
503
|
-
maqlify_filters(filters, options.merge(users_cache: users_cache, users_must_exist: users_must_exist))
|
502
|
+
maqlify_filters(filters, users, options.merge(users_cache: users_cache, users_must_exist: users_must_exist))
|
504
503
|
elsif missing_users.count < 100
|
505
504
|
verify_existing_users(filters, project: project, users_must_exist: users_must_exist, users_cache: users_cache)
|
506
|
-
maqlify_filters(filters, options.merge(users_cache: users_cache, users_must_exist: users_must_exist))
|
505
|
+
maqlify_filters(filters, users, options.merge(users_cache: users_cache, users_must_exist: users_must_exist))
|
507
506
|
else
|
508
507
|
users_cache = create_cache(users, :login)
|
509
508
|
verify_existing_users(filters, project: project, users_must_exist: users_must_exist, users_cache: users_cache)
|
510
|
-
maqlify_filters(filters, options.merge(users_cache: users_cache, users_must_exist: users_must_exist))
|
509
|
+
maqlify_filters(filters, users, options.merge(users_cache: users_cache, users_must_exist: users_must_exist))
|
511
510
|
end
|
512
511
|
|
513
512
|
fail GoodData::FilterMaqlizationError, errors if !ignore_missing_values && !errors.empty?
|
@@ -537,5 +536,18 @@ module GoodData
|
|
537
536
|
end
|
538
537
|
end
|
539
538
|
end
|
539
|
+
|
540
|
+
# Removes MUFs from to_delete unless in user is in users_brick_input
|
541
|
+
def self.sanitize_filters_to_delete(to_delete, users_brick_input, project_users)
|
542
|
+
return to_delete unless users_brick_input && users_brick_input.any?
|
543
|
+
user_profiles = users_brick_input.map do |user|
|
544
|
+
result = project_users.find { |u| u.login == user['login'] }
|
545
|
+
next unless result
|
546
|
+
result.profile_url
|
547
|
+
end.compact
|
548
|
+
to_delete.reject do |_, value|
|
549
|
+
user_profiles.none? { |profile| profile == value.first.json[:related] }
|
550
|
+
end
|
551
|
+
end
|
540
552
|
end
|
541
553
|
end
|
File without changes
|
data/lib/gooddata/rest/README.md
CHANGED
File without changes
|
@@ -59,6 +59,9 @@ end
|
|
59
59
|
|
60
60
|
module GoodData
|
61
61
|
module Rest
|
62
|
+
class RestRetryError < StandardError
|
63
|
+
end
|
64
|
+
|
62
65
|
# Wrapper of low-level HTTP/REST client/library
|
63
66
|
class Connection
|
64
67
|
include MonitorMixin
|
@@ -250,6 +253,9 @@ module GoodData
|
|
250
253
|
reset_headers!
|
251
254
|
end
|
252
255
|
|
256
|
+
# @param what Address of the remote file.
|
257
|
+
# @param where Full path to the target file.
|
258
|
+
# @option [Bool] :url_encode ('true') URL encode the address.
|
253
259
|
def download(what, where, options = {})
|
254
260
|
# handle the path (directory) given in what
|
255
261
|
ilast_slash = what.rindex('/')
|
@@ -278,7 +284,8 @@ module GoodData
|
|
278
284
|
staging_uri = options[:staging_url].to_s
|
279
285
|
|
280
286
|
base_url = dir.empty? ? staging_uri : URI.join("#{server}", staging_uri, "#{dir}/").to_s
|
281
|
-
|
287
|
+
sanitized_what = options[:url_encode] == false ? what : CGI.escape(what)
|
288
|
+
url = URI.join("#{server}", base_url, sanitized_what).to_s
|
282
289
|
|
283
290
|
b = proc do |f|
|
284
291
|
raw = {
|
@@ -288,14 +295,16 @@ module GoodData
|
|
288
295
|
:verify_ssl => verify_ssl
|
289
296
|
}
|
290
297
|
RestClient::Request.execute(raw) do |chunk, _x, response|
|
291
|
-
if response.code.to_s
|
298
|
+
if response.code.to_s == '202'
|
299
|
+
fail RestRetryError, 'Got 202, retry'
|
300
|
+
elsif response.code.to_s != '200'
|
292
301
|
fail ArgumentError, "Error downloading #{url}. Got response: #{response.code} #{response} #{response.body}"
|
293
302
|
end
|
294
303
|
f.write chunk
|
295
304
|
end
|
296
305
|
end
|
297
306
|
|
298
|
-
GoodData::Rest::Connection.retryable(:tries => Helpers::GD_MAX_RETRY, :refresh_token => proc { refresh_token }) do
|
307
|
+
GoodData::Rest::Connection.retryable(:tries => Helpers::GD_MAX_RETRY, :refresh_token => proc { refresh_token }, :on => RestRetryError) do
|
299
308
|
if where.is_a?(IO) || where.is_a?(StringIO)
|
300
309
|
b.call(where)
|
301
310
|
else
|
@@ -590,6 +599,9 @@ ERR
|
|
590
599
|
elsif content_type == 'application/zip'
|
591
600
|
result = response
|
592
601
|
GoodData.rest_logger.debug 'Response: a zipped stream'
|
602
|
+
elsif content_type == 'text/csv'
|
603
|
+
result = response
|
604
|
+
GoodData.rest_logger.debug 'Response: CSV text'
|
593
605
|
elsif response.headers[:content_length].to_s == '0'
|
594
606
|
result = nil
|
595
607
|
GoodData.rest_logger.debug 'Response: Empty response possibly 204'
|