marty 2.1.0 → 2.1.1
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 +4 -4
- data/Gemfile +0 -2
- data/Gemfile.lock +2 -2
- data/app/models/marty/data_grid.rb +1 -4
- data/lib/marty/version.rb +1 -1
- data/marty.gemspec +3 -0
- data/other/marty/diagnostic/aws/ec2_instance.rb +1 -1
- data/other/marty/diagnostic/connections.rb +4 -1
- data/other/marty/diagnostic/environment_variables.rb +11 -6
- data/spec/dummy/db/migrate/20160923183516_add_bulk_pricing_event_ops.rb +1 -2
- data/spec/models/data_grid_spec.rb +12 -12
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ad4a69b32113f2cc635319cdf01b1fbaf5e75da
|
4
|
+
data.tar.gz: 9f949b565d227a2f3bfcd4f06be08f8b080b3800
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2e598681727dc3a4035a605c69c805d8f91f69699ca862797a1bd88f6bd81eeaf628134d694b447be752b16d56b37b75d0c6599fd9aac2600dc4f2ece5c2152
|
7
|
+
data.tar.gz: e255658aa7a7fbb18c055147aef9d4c3ce385914c37648c6a1df9706484d722f4b8d0f8dc1f9e725fe106ed00c125c669e892d23cdb5a44835edc927fa913bf7
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
marty (2.1.
|
4
|
+
marty (2.1.1)
|
5
|
+
aws-sigv4 (~> 1.0, >= 1.0.2)
|
5
6
|
axlsx (= 3.0.0pre)
|
6
7
|
coderay
|
7
8
|
delorean_lang (~> 0.3.37)
|
@@ -233,7 +234,6 @@ PLATFORMS
|
|
233
234
|
ruby
|
234
235
|
|
235
236
|
DEPENDENCIES
|
236
|
-
aws-sigv4 (~> 1.0, >= 1.0.2)
|
237
237
|
capybara
|
238
238
|
chromedriver-helper
|
239
239
|
connection_pool
|
@@ -188,14 +188,11 @@ class Marty::DataGrid < Marty::Base
|
|
188
188
|
h = dgh["metadata"].each_with_object({}) do |m, h|
|
189
189
|
attr = m["attr"]
|
190
190
|
inc = h_passed.fetch(attr, :__nf__)
|
191
|
-
next if inc == :__nf__
|
191
|
+
next if inc == :__nf__ || inc.nil?
|
192
192
|
val = (defined? inc.name) ? inc.name : inc
|
193
193
|
h[attr] = val.is_a?(String) ?
|
194
194
|
ActiveRecord::Base.connection.quote(val)[1..-2] : val
|
195
195
|
end
|
196
|
-
nilparams = h.select{|k, v| v==nil}
|
197
|
-
raise "Data Grid #{dgh['name']} lookup with nil attrs #{nilparams}" if
|
198
|
-
nilparams.present?
|
199
196
|
|
200
197
|
fn = "lookup_grid_distinct"
|
201
198
|
hjson = "'#{h.to_json}'::JSONB"
|
data/lib/marty/version.rb
CHANGED
data/marty.gemspec
CHANGED
@@ -53,7 +53,7 @@ class Marty::Diagnostic::Aws::Ec2Instance
|
|
53
53
|
def self.get url
|
54
54
|
uri = URI.parse(url)
|
55
55
|
request = Net::HTTP.new(uri.host, uri.port)
|
56
|
-
request.read_timeout = request.open_timeout = ENV['DIAG_TIMEOUT'] ||
|
56
|
+
request.read_timeout = request.open_timeout = ENV['DIAG_TIMEOUT'] || 0.25
|
57
57
|
request.start {|http|
|
58
58
|
http.get(uri.to_s)
|
59
59
|
}.body
|
@@ -2,7 +2,10 @@ module Marty::Diagnostic; class Connections < Base
|
|
2
2
|
self.aggregatable = false
|
3
3
|
diagnostic_fn do
|
4
4
|
conns = Node.get_postgres_connections[Database.db_name].
|
5
|
-
sort_by{|h| [h['application_name'],
|
5
|
+
sort_by{|h| [h['application_name'],
|
6
|
+
h['pid'],
|
7
|
+
h['client_addr'],
|
8
|
+
h['state']]}
|
6
9
|
|
7
10
|
counts = Hash.new(0)
|
8
11
|
conns.each_with_object({}) do |c, h|
|
@@ -6,14 +6,19 @@ module Marty::Diagnostic; class EnvironmentVariables < Base
|
|
6
6
|
def self.env filter=''
|
7
7
|
env = ENV.clone
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
env['SECRET_KEY_BASE']
|
9
|
+
to_delete = (Marty::Config['DIAG_ENV_BLOCK'] || []).map(&:upcase) + [
|
10
|
+
'SCRIPT_URI', 'SCRIPT_URL']
|
12
11
|
|
13
|
-
|
14
|
-
|
12
|
+
to_obfus = (Marty::Config['DIAG_ENV_OBFUSCATE'] || []).map(&:upcase) + [
|
13
|
+
'SECRET_KEY_BASE']
|
14
|
+
|
15
|
+
to_block = (Marty::Config['DIAG_ENV_BLOCK_IF_INCL'] || []).map(&:upcase) + [
|
16
|
+
'PASSWORD', 'DEBUG']
|
17
|
+
|
18
|
+
to_delete.each{|k| env.delete(k)}
|
19
|
+
|
20
|
+
to_obfus.each{|k| env[k] = env[k][0,4] if env[k]}
|
15
21
|
|
16
|
-
to_block = ['PASSWORD', 'DEBUG']
|
17
22
|
env.sort.each_with_object({}){|(k,v),h|
|
18
23
|
h[k] = v if to_block.all?{|b| !k.include?(b)} && k.include?(filter)}
|
19
24
|
end
|
@@ -1,9 +1,8 @@
|
|
1
1
|
class AddBulkPricingEventOps < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
2
3
|
def change
|
3
|
-
execute("COMMIT;")
|
4
4
|
execute "ALTER TYPE enum_event_operations ADD VALUE 'PRICING';"
|
5
5
|
execute "ALTER TYPE enum_event_operations ADD VALUE 'CRA';"
|
6
6
|
execute "ALTER TYPE enum_event_operations ADD VALUE 'AVM';"
|
7
|
-
execute("BEGIN;")
|
8
7
|
end
|
9
8
|
end
|
@@ -185,9 +185,10 @@ EOS
|
|
185
185
|
marty_whodunnit
|
186
186
|
end
|
187
187
|
|
188
|
-
def lookup_grid_helper(pt, gridname, params, follow=false)
|
188
|
+
def lookup_grid_helper(pt, gridname, params, follow=false, distinct=true)
|
189
189
|
dgh=Marty::DataGrid.lookup_h(pt, gridname)
|
190
|
-
res=Marty::DataGrid.lookup_grid_distinct_entry_h(pt, params, dgh, nil, follow
|
190
|
+
res=Marty::DataGrid.lookup_grid_distinct_entry_h(pt, params, dgh, nil, follow,
|
191
|
+
false, distinct)
|
191
192
|
[res["result"], res["name"]]
|
192
193
|
end
|
193
194
|
|
@@ -489,21 +490,20 @@ EOS
|
|
489
490
|
expect(res).to eq [456,"G9"]
|
490
491
|
end
|
491
492
|
|
492
|
-
it "should
|
493
|
+
it "should raise on nil attr values" do
|
493
494
|
dg_from_import("G9", G9)
|
494
495
|
|
495
|
-
|
496
|
+
expect{lookup_grid_helper('infinity',
|
496
497
|
"G9",
|
497
498
|
{"state" => nil, "ltv" => 81},
|
498
|
-
)
|
499
|
-
|
499
|
+
)}.to raise_error(/matches > 1/)
|
500
|
+
|
501
|
+
res = lookup_grid_helper('infinity',
|
502
|
+
"G9",
|
503
|
+
{"state" => "CA", "ltv" => nil},
|
504
|
+
false, false)
|
505
|
+
expect(res).to eq [123,"G9"]
|
500
506
|
|
501
|
-
expect {
|
502
|
-
res = lookup_grid_helper('infinity',
|
503
|
-
"G9",
|
504
|
-
{"state" => "CA", "ltv" => nil},
|
505
|
-
)
|
506
|
-
}.to raise_error(RuntimeError)
|
507
507
|
end
|
508
508
|
|
509
509
|
it "should handle boolean keys" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arman Bostani
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2018-06-
|
17
|
+
date: 2018-06-28 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: pg
|
@@ -156,6 +156,26 @@ dependencies:
|
|
156
156
|
- - ">="
|
157
157
|
- !ruby/object:Gem::Version
|
158
158
|
version: '0'
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: aws-sigv4
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
requirements:
|
163
|
+
- - "~>"
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '1.0'
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: 1.0.2
|
169
|
+
type: :runtime
|
170
|
+
prerelease: false
|
171
|
+
version_requirements: !ruby/object:Gem::Requirement
|
172
|
+
requirements:
|
173
|
+
- - "~>"
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '1.0'
|
176
|
+
- - ">="
|
177
|
+
- !ruby/object:Gem::Version
|
178
|
+
version: 1.0.2
|
159
179
|
description: Marty is a framework for viewing and reporting on versioned data.
|
160
180
|
email:
|
161
181
|
- arman.bostani@pnmac.com
|