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 +4 -4
- data/lib/gooddata/lcm/lcm.rb +4 -0
- data/lib/gooddata/models/project.rb +27 -0
- data/lib/gooddata/models/project_creator.rb +4 -0
- data/lib/gooddata/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7ca3958a79bed109dcc27421e31ad94d6ebe12d
|
4
|
+
data.tar.gz: d273f49c40f12df4c1102f2f933ccdf090fafffc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4407ed2e1aa90d0583768a0d4827e2f1d96ac34589cac57735ee4ebef0ae9e6ad17f475efc5c39a50575c0a0147a71c44e79bf77704ace649bc543a67f91e269
|
7
|
+
data.tar.gz: d64151d7f4f9da2f42a573df1a34daf3d482eadbc2d968b99efec76087bd2e769fd57140df45bd9b596cfff295aba14f632ae69dd23272d62c441242431b77b7
|
data/lib/gooddata/lcm/lcm.rb
CHANGED
@@ -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
|
|
data/lib/gooddata/version.rb
CHANGED
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.
|
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-
|
14
|
+
date: 2016-10-04 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|