gooddata 0.6.52 → 0.6.53

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
  SHA1:
3
- metadata.gz: 4b52bbc7d6883ecc03056e9bd3b8d40814b1c7e6
4
- data.tar.gz: d9016a67965073aa35cc99d6285200b2217aafdb
3
+ metadata.gz: '0738df048980ee42b4fbe246eb0761ae040fa282'
4
+ data.tar.gz: ec5451d85b478976653819b3a7e5fe54bc45bc10
5
5
  SHA512:
6
- metadata.gz: 9c84503bccbc716e9a55fd77c2ceaa105ec3790fcf0af44282c01cc1704c0095bf65777a63ebea9e89d193806e349c4c081fdf8f235530c211f42716ae8da355
7
- data.tar.gz: b8bd3acdca2aaac173bc92dbd9aef01c32a8b5f2a99267686b02e97d66d15521577e1cfedfa96814d5eb3cc3e7b42611945980871732eb5658e94cfcc4d3f531
6
+ metadata.gz: cb6a70f0a46abd160058f032ee3221138b203b1bd7f94f9df6efb33e8b63b6bfd65a83e6dba02c38745ef4f2c34782a1a9c98244222fe1aa6edc70b9e6e45012
7
+ data.tar.gz: 6f6de0a44400885a940089fe13013fd1c15b1e9a7c270cc694df8816d774771b0ad2d16cf034c8ea4bfbe305d668b76f41bd38d94ba1667ffe4c025b437f6ae8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # GoodData Ruby SDK Changelog
2
2
 
3
+ ## 0.6.53
4
+ - TMA-522 - Rollout: Incorrect CLIENT_ID assigned to client schedule
5
+
3
6
  ## 0.6.52
4
7
  - Add support for computed attribute in blueprint
5
8
  - Fix bug with transfering schedules without their state
@@ -45,10 +45,12 @@ module GoodData
45
45
  production_tags = Helpers.parse_production_tags(params.production_tag, segment_tags)
46
46
 
47
47
  if transfer_all || production_tags.empty?
48
- objects = GoodData::Dashboard.all(
48
+ old_dashboards = GoodData::Dashboard.all(
49
49
  project: from_project,
50
50
  client: development_client
51
51
  )
52
+ kpi_dashboards = MdObject.query('analyticalDashboard', MdObject, client: development_client, project: from_project)
53
+ objects = old_dashboards.to_a + kpi_dashboards.to_a
52
54
  else
53
55
  objects = GoodData::Dashboard.find_by_tag(
54
56
  production_tags,
@@ -43,10 +43,13 @@ module GoodData
43
43
 
44
44
  segment_tags = segments_to_tags[info.segment]
45
45
  production_tags = Helpers.parse_production_tags(params.production_tag, segment_tags)
46
- if production_tags.any?
46
+ objects = []
47
+ if transfer_all
48
+ vizs = MdObject.query('visualization', MdObject, client: development_client, project: from_project)
49
+ viz_widgets = MdObject.query('visualizationWidget', MdObject, client: development_client, project: from_project)
50
+ objects = (from_project.reports.to_a + from_project.metrics.to_a + from_project.variables.to_a + vizs.to_a + viz_widgets.to_a).map(&:uri)
51
+ elsif production_tags.any?
47
52
  objects = from_project.find_by_tag(production_tags)
48
- else
49
- objects = (from_project.reports.to_a + from_project.metrics.to_a + from_project.variables.to_a).map(&:uri)
50
53
  end
51
54
 
52
55
  info[:transfer_uris] ||= []
@@ -55,6 +55,7 @@ module GoodData
55
55
  development_pid = segment_in.development_pid
56
56
  driver = segment_in.driver.downcase
57
57
  token = params.tokens[driver.to_sym] || fail("Token for driver '#{driver}' was not specified")
58
+ ads_output_stage_uri = segment_in.ads_output_stage_uri
58
59
 
59
60
  # Create master project Postgres
60
61
  version = get_project_version(params, segment_id) + 1
@@ -112,6 +113,7 @@ module GoodData
112
113
  name: master_name,
113
114
  development_pid: development_pid,
114
115
  master_pid: project.pid,
116
+ ads_output_stage_uri: ads_output_stage_uri,
115
117
  driver: driver,
116
118
  status: status
117
119
  }
@@ -119,7 +121,8 @@ module GoodData
119
121
  {
120
122
  segment: segment_id,
121
123
  from: development_pid,
122
- to: [{ pid: project.pid }]
124
+ to: [{ pid: project.pid }],
125
+ ads_output_stage_uri: ads_output_stage_uri
123
126
  }
124
127
  end
125
128
 
@@ -114,13 +114,14 @@ module GoodData
114
114
  end
115
115
  end
116
116
 
117
- additional_params = params.additional_params || {}
118
- additional_params.merge!(
117
+ schedule.update_params(params.additional_params) if params.additional_params
118
+
119
+ schedule.update_params(
119
120
  CLIENT_ID: entry[:client_id], # needed for ADD and CloudConnect ETL
120
121
  GOODOT_CUSTOM_PROJECT_ID: entry[:client_id] # TMA-210
121
122
  )
122
- schedule.update_params(additional_params)
123
- schedule.update_hidden_params(params.additional_hidden_params || {})
123
+
124
+ schedule.update_hidden_params(params.additional_hidden_params) if params.additional_hidden_params
124
125
  schedule.enable
125
126
  schedule.save
126
127
  end
@@ -15,9 +15,6 @@ module GoodData
15
15
  description 'Client Used for Connecting to GD'
16
16
  param :gdc_gd_client, instance_of(Type::GdClientType), required: true
17
17
 
18
- description 'Uri of the source output stage. It must be in the same domain as the target project.'
19
- param :ads_output_stage_uri, instance_of(Type::StringType), required: false
20
-
21
18
  description 'Development Client Used for Connecting to GD'
22
19
  param :development_client, instance_of(Type::GdClientType), required: true
23
20
 
@@ -51,7 +48,7 @@ module GoodData
51
48
  to_project = client.projects(pid) || fail("Invalid 'to' project specified - '#{pid}'")
52
49
 
53
50
  params.gdc_logger.info "Transferring processes, from project: '#{from.title}', PID: '#{from.pid}', to project: '#{to_project.title}', PID: '#{to_project.pid}'"
54
- GoodData::Project.transfer_processes(from, to_project, ads_output_stage_uri: params.ads_output_stage_uri)
51
+ GoodData::Project.transfer_processes(from, to_project, ads_output_stage_uri: info.ads_output_stage_uri)
55
52
 
56
53
  to_project.add.output_stage.client_id = client_id if client_id && to_project.add.output_stage
57
54
 
@@ -313,15 +313,6 @@ module GoodData
313
313
  # Fail whole execution if there is any failed action
314
314
  fail(JSON.pretty_generate(errors)) if strict_mode && errors.any?
315
315
 
316
- if actions.length > 1
317
- puts
318
- puts 'SUMMARY'
319
- puts
320
-
321
- # Print execution summary/results
322
- print_actions_result(actions, results)
323
- end
324
-
325
316
  brick_results = {}
326
317
  actions.each_with_index do |action, index|
327
318
  brick_results[action.short_name] = results[index]
@@ -21,6 +21,9 @@ module GoodData
21
21
 
22
22
  description 'To which projects'
23
23
  param :to, array_of(instance_of(Type::HashType)), required: true
24
+
25
+ description 'Uri of the source output stage. It must be in the same domain as the target project.'
26
+ param :ads_output_stage_uri, instance_of(Type::StringType), required: false
24
27
  end
25
28
 
26
29
  def check(value)
@@ -16,6 +16,17 @@ module GoodData
16
16
 
17
17
  ProvisioningResult = Struct.new('ProvisioningResult', :id, :status, :project_uri, :error)
18
18
 
19
+ USER_LANGUAGES = {
20
+ 'en-US' => 'English',
21
+ 'nl-NL' => 'Dutch',
22
+ 'es-ES' => 'Spanish',
23
+ 'pt-BR' => 'Portuguese/Brazil',
24
+ 'pt-PT' => 'Portuguese/Portugal',
25
+ 'fr-FR' => 'French',
26
+ 'de-DE' => 'German',
27
+ 'ja-JP' => 'Japanese'
28
+ }
29
+
19
30
  class << self
20
31
  # Looks for domain
21
32
  #
@@ -44,7 +55,8 @@ module GoodData
44
55
  :lastName => user_data[:last_name] || 'LastName',
45
56
  :password => user_data[:password] || generated_pass,
46
57
  :verifyPassword => user_data[:password] || generated_pass,
47
- :email => user_data[:email] || user_data[:login]
58
+ :email => user_data[:email] || user_data[:login],
59
+ :language => ensure_user_language(user_data)
48
60
  }
49
61
 
50
62
  # Optional authentication modes
@@ -124,7 +136,8 @@ module GoodData
124
136
  data = {
125
137
  :firstName => user_data[:first_name] || 'FirstName',
126
138
  :lastName => user_data[:last_name] || 'LastName',
127
- :email => user_data[:email]
139
+ :email => user_data[:email],
140
+ :language => ensure_user_language(user_data)
128
141
  }
129
142
 
130
143
  # Optional authentication modes
@@ -269,6 +282,19 @@ to new properties (email=#{user_data[:email]}, sso_provider=#{user_data[:sso_pro
269
282
  end
270
283
  end
271
284
  end
285
+
286
+ private
287
+
288
+ def ensure_user_language(user_data)
289
+ language = user_data[:language] || 'en-US'
290
+ unless USER_LANGUAGES.keys.include?(language)
291
+ available_languages = USER_LANGUAGES.map { |k, v| "#{k} (#{v})" }.join(', ')
292
+ GoodData.logger.warn "The language for user '#{user_data[:login]}' will be English because '#{language}' is an invalid value. \
293
+ Available values for setting language are: #{available_languages}."
294
+ language = 'en-US'
295
+ end
296
+ language
297
+ end
272
298
  end
273
299
 
274
300
  def initialize(domain_name)
@@ -26,6 +26,7 @@ module GoodData
26
26
  'position' => nil,
27
27
  'timezone' => nil,
28
28
  'updated' => nil,
29
+ 'language' => nil,
29
30
  'links' => {
30
31
  'projects' => nil,
31
32
  'self' => nil
@@ -44,7 +45,8 @@ module GoodData
44
45
  :last_name,
45
46
  :phone,
46
47
  :position,
47
- :timezone
48
+ :timezone,
49
+ :language
48
50
  ]
49
51
 
50
52
  PROFILE_PATH = '/gdc/account/profile/%s'
@@ -158,6 +160,21 @@ module GoodData
158
160
  @json['accountSetting']['companyName'] = val
159
161
  end
160
162
 
163
+ # Gets the language
164
+ #
165
+ # @return [String] Language
166
+ def language
167
+ @json['accountSetting']['language'] || 'en-US'
168
+ end
169
+
170
+ # Set the language
171
+ #
172
+ # @param val [String] Language to be set
173
+ def language=(val)
174
+ @dirty ||= language != val
175
+ @json['accountSetting']['language'] = val
176
+ end
177
+
161
178
  # Gets the country
162
179
  #
163
180
  # @return [String] Country
@@ -6,7 +6,7 @@
6
6
 
7
7
  # GoodData Module
8
8
  module GoodData
9
- VERSION = '0.6.52'
9
+ VERSION = '0.6.53'
10
10
 
11
11
  class << self
12
12
  # Version
@@ -26,6 +26,7 @@ describe GoodData::LCM2::CollectMeta do
26
26
 
27
27
  it 'retrieves all dashboards' do
28
28
  expect(GoodData::Dashboard).to receive(:all).and_return({})
29
+ expect(GoodData::MdObject).to receive(:query).and_return({})
29
30
  subject.class.call(params)
30
31
  end
31
32
  end
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: 0.6.52
4
+ version: 0.6.53
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kolesnikov
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-07-03 00:00:00.000000000 Z
14
+ date: 2017-07-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler