gooddata 0.6.37 → 0.6.38

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44a5a87cc1efdfd3343ea632a439cc755070f67d
4
- data.tar.gz: 07ef3544ad0bb2c9868edda467a7cdef84e11f31
3
+ metadata.gz: b7ca3958a79bed109dcc27421e31ad94d6ebe12d
4
+ data.tar.gz: d273f49c40f12df4c1102f2f933ccdf090fafffc
5
5
  SHA512:
6
- metadata.gz: e17091cfa86cd31601b660945d2bd14c58676269b4792431fb5984d973ac3c310bcf65b3dfc4239e656ca35bef32e2302fc10d58480b6bc539a3a048c479e8bf
7
- data.tar.gz: c9044eca9f3a2d372570d674528ee0f04e176f858cd8408e9c5ddf22793b7b991912ceedfdfb00b3fc98d886e55a1c176582981704b49a4500a2f36c948dada5
6
+ metadata.gz: 4407ed2e1aa90d0583768a0d4827e2f1d96ac34589cac57735ee4ebef0ae9e6ad17f475efc5c39a50575c0a0147a71c44e79bf77704ace649bc543a67f91e269
7
+ data.tar.gz: d64151d7f4f9da2f42a573df1a34daf3d482eadbc2d968b99efec76087bd2e769fd57140df45bd9b596cfff295aba14f632ae69dd23272d62c441242431b77b7
@@ -38,6 +38,8 @@ module GoodData
38
38
  maql_replacements: opts[:maql_replacements] || opts['maql_replacements']
39
39
  }
40
40
 
41
+ tags = opts[:production_tag] || opts['production_tag']
42
+
41
43
  domain.segments.peach do |segment|
42
44
  next if !filter_on_segment.empty? && !(filter_on_segment.include?(segment.id))
43
45
  bp = segment.master_project.blueprint
@@ -74,6 +76,8 @@ module GoodData
74
76
  s.update_hidden_params(migration_spec[:additional_hidden_params] || {})
75
77
  s.save
76
78
  end
79
+
80
+ GoodData::Project.transfer_tagged_stuff(segment_master, project, tags) if tags
77
81
  end
78
82
 
79
83
  puts 'Migrating Dashboards'
@@ -321,6 +321,16 @@ module GoodData
321
321
  end
322
322
  end
323
323
 
324
+ def transfer_tagged_stuff(from_project, to_project, tag)
325
+ puts 'Transferring tagged stuff'
326
+
327
+ objects = from_project.find_by_tag(tag)
328
+
329
+ puts JSON.pretty_generate(objects)
330
+
331
+ from_project.partial_md_export(objects, project: to_project)
332
+ end
333
+
324
334
  def add_dashboard(dashboard)
325
335
  GoodData::Dashboard.create(dashboard, :client => client, :project => self)
326
336
  end
@@ -738,6 +748,23 @@ module GoodData
738
748
  # Gets user by its email, full_name, login or uri
739
749
  alias_method :member, :get_user
740
750
 
751
+ def find_by_tag(tags)
752
+ tags = tags.split(',').map(&:strip) unless tags.kind_of?(Array)
753
+
754
+ objects = tags.map do |tag|
755
+ url = "/gdc/md/#{self.pid}/tags/#{tag}"
756
+ res = self.client.get(url)
757
+
758
+ ((res || {})['entries'] || []).map do |entry|
759
+ entry['link']
760
+ end
761
+ end
762
+
763
+ objects.flatten!
764
+
765
+ objects.uniq!
766
+ end
767
+
741
768
  # Gets user by its email, full_name, login or uri.
742
769
  #
743
770
  # @param [String] name Name to look for
@@ -59,6 +59,7 @@ module GoodData
59
59
 
60
60
  response = client.get(link)
61
61
 
62
+ errors = []
62
63
  maqls = pick_correct_chunks(response['projectModelDiff']['updateScripts'], opts)
63
64
  if !maqls.empty? && !dry_run
64
65
  maqls.each_with_index do |maql, _idx|
@@ -83,9 +84,12 @@ module GoodData
83
84
  return chunks
84
85
  rescue => e
85
86
  puts "Error occured when executing MAQL, project: \"#{project.title}\" reason: \"#{e.message}\", chunks: #{chunks.inspect}"
87
+ errors << e
86
88
  next
87
89
  end
88
90
  end
91
+
92
+ fail "Unable to migrate LDM, reason(s): #{JSON.pretty_generate(errors)}" unless errors.empty?
89
93
  end
90
94
  end
91
95
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  # GoodData Module
8
8
  module GoodData
9
- VERSION = '0.6.37'
9
+ VERSION = '0.6.38'
10
10
 
11
11
  class << self
12
12
  # Version
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.37
4
+ version: 0.6.38
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: 2016-09-30 00:00:00.000000000 Z
14
+ date: 2016-10-04 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler