marty 2.1.0 → 2.1.1

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: 74cf23a65bfc74eca6990825fc5cd0e3498ce1ee
4
- data.tar.gz: bbe239541fa78e0520ba9556ce2e54a6bdcd316d
3
+ metadata.gz: 7ad4a69b32113f2cc635319cdf01b1fbaf5e75da
4
+ data.tar.gz: 9f949b565d227a2f3bfcd4f06be08f8b080b3800
5
5
  SHA512:
6
- metadata.gz: 7b83dbaa63058e3cb97bf2075b41630737fe3caed36b5f006b70c34e2dc743dc57333064b5952cd3e933b1b67a81309001e688944d0f0de4eb5a558d5ce27db6
7
- data.tar.gz: a8a857fcf340d133ecf3a9248aad919630f8f11c480b3301abf7df896a70e7bb4811fddef838b4787bfe6c08d95863a33eb88045fe50b29c14e158ede8484b6c
6
+ metadata.gz: f2e598681727dc3a4035a605c69c805d8f91f69699ca862797a1bd88f6bd81eeaf628134d694b447be752b16d56b37b75d0c6599fd9aac2600dc4f2ece5c2152
7
+ data.tar.gz: e255658aa7a7fbb18c055147aef9d4c3ce385914c37648c6a1df9706484d722f4b8d0f8dc1f9e725fe106ed00c125c669e892d23cdb5a44835edc927fa913bf7
data/Gemfile CHANGED
@@ -10,8 +10,6 @@ gem 'daemons', '~> 1.1.9'
10
10
  gem 'rails', '~> 5.1.4'
11
11
  gem 'pg'
12
12
  gem 'sqlite3'
13
- # for signing of aws ec2 requests
14
- gem 'aws-sigv4', '~> 1.0', '>= 1.0.2'
15
13
 
16
14
 
17
15
  group :development, :test do
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- marty (2.1.0)
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
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
data/marty.gemspec CHANGED
@@ -41,4 +41,7 @@ Gem::Specification.new do |s|
41
41
  s.add_dependency 'rubyzip'
42
42
  s.add_dependency 'sqlite3'
43
43
  s.add_dependency 'json-schema'
44
+
45
+ # used for signing aws ec2 requests
46
+ s.add_dependency 'aws-sigv4', '~> 1.0', '>= 1.0.2'
44
47
  end
@@ -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'] || 5
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'], h['pid'], h['client_addr']]}
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
- # obfuscate SECRET_KEY_BASE for comparison
10
- env['SECRET_KEY_BASE'] = env['SECRET_KEY_BASE'][0,4] if
11
- env['SECRET_KEY_BASE']
9
+ to_delete = (Marty::Config['DIAG_ENV_BLOCK'] || []).map(&:upcase) + [
10
+ 'SCRIPT_URI', 'SCRIPT_URL']
12
11
 
13
- # remove SCRIPT_URI, SCRIPT_URL as calling node differs
14
- ['SCRIPT_URI', 'SCRIPT_URL'].each{|k| env.delete(k)}
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 handle nil attr values to match wildcard" do
493
+ it "should raise on nil attr values" do
493
494
  dg_from_import("G9", G9)
494
495
 
495
- res = lookup_grid_helper('infinity',
496
+ expect{lookup_grid_helper('infinity',
496
497
  "G9",
497
498
  {"state" => nil, "ltv" => 81},
498
- )
499
- expect(res).to eq [456,"G9"]
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.0
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-05 00:00:00.000000000 Z
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