legion-data 1.1.2 → 1.1.3

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
  SHA256:
3
- metadata.gz: 7edc1b56e433f1136ad04bb1ddb6c989493a516bc46ca928fe81439428616fd1
4
- data.tar.gz: 2d67b54b7de9c5aa798e941cd700381df89ef87fda8fcbd272aacb017a6af1da
3
+ metadata.gz: a74f210c0c982c7f5679b0cb5e715421cde69303e4ac616da2dcb6c48cd3f912
4
+ data.tar.gz: 4516afa1bce82a7083530b4fbd142b720478077edea5e5ae4a3177c98914c30b
5
5
  SHA512:
6
- metadata.gz: 224c4962335f385131dc6e50fe9ffe952edb4e52a0c6f3b7cdc30164cc6b668de1a9ab37778c097a0e9c790430ef62ba26af70ff2e88352a4cadf32abf35b3f9
7
- data.tar.gz: da68881cbdcaa3b021e523064f0a9d784702d69cc98c713ed7f76b24ca994eef2295d77e6e6425f093bd68e0e9cac1139a40ff7d18cf4839b4ab1dfac6cde8f1
6
+ metadata.gz: 997f4e64971b2f203c13992cc7dbdce48a0f14609d39c9d951c19c85942062d4b734ab50d834aee6c873cd58273e6c63bdd9ac2c465bd0e1cdaf6e71b50ab1e1
7
+ data.tar.gz: 055aee1a4f283ccc4e46e31c95e213070fa896ea6e78b5bbd14863a3e7c7bab8c958e14225249b4672c9cc27b5bfd6b45d64087b305babbc42b60aab35b9096f
@@ -99,7 +99,7 @@ jobs:
99
99
  - sonarcloud/scan
100
100
  "jruby-nine-two-e":
101
101
  docker:
102
- - image: circleci/jruby:9.2.11-jre
102
+ - image: circleci/jruby:9.2.13-jre
103
103
  - image: circleci/mysql:5.7
104
104
  environment:
105
105
  MYSQL_DATABASE: 'legion'
@@ -130,6 +130,9 @@ jobs:
130
130
  steps:
131
131
  - checkout
132
132
  - ruby/load-cache
133
+ - run:
134
+ name: Install Rubocop
135
+ command: gem install rubocop rubocop-sequel rubocop-performance rubocop-rspec
133
136
  - run:
134
137
  name: update bundler
135
138
  command: gem update bundler
@@ -140,7 +143,7 @@ jobs:
140
143
  - ruby/run-tests
141
144
  - run:
142
145
  name: Run Rubocop
143
- command: bundle exec rubocop --format=json --out=rubocop-result.json
146
+ command: rubocop --format=json --out=rubocop-result.json
144
147
  - sonarcloud/scan
145
148
  - ruby/save-cache
146
149
 
@@ -1,6 +1,5 @@
1
1
  require:
2
2
  - rubocop-sequel
3
- - rubocop-md
4
3
  - rubocop-performance
5
4
 
6
5
  Layout/LineLength:
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- legion-data (1.1.2)
4
+ legion-data (1.1.3)
5
5
  legion-logging
6
6
  legion-settings
7
7
  mysql2
@@ -11,7 +11,7 @@ GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
13
  ast (2.4.1)
14
- codecov (0.2.8)
14
+ codecov (0.2.12)
15
15
  json
16
16
  simplecov
17
17
  diff-lcs (1.4.4)
@@ -22,7 +22,7 @@ GEM
22
22
  legion-json (1.1.2)
23
23
  json_pure
24
24
  multi_json
25
- legion-logging (1.1.0)
25
+ legion-logging (1.1.1)
26
26
  rainbow (~> 3)
27
27
  legion-settings (1.1.1)
28
28
  legion-json
@@ -30,17 +30,17 @@ GEM
30
30
  multi_json (1.15.0)
31
31
  mysql2 (0.5.3)
32
32
  parallel (1.19.2)
33
- parser (2.7.1.4)
33
+ parser (2.7.2.0)
34
34
  ast (~> 2.4.1)
35
35
  rainbow (3.0.0)
36
36
  rake (13.0.1)
37
- regexp_parser (1.7.1)
37
+ regexp_parser (1.8.2)
38
38
  rexml (3.2.4)
39
39
  rspec (3.9.0)
40
40
  rspec-core (~> 3.9.0)
41
41
  rspec-expectations (~> 3.9.0)
42
42
  rspec-mocks (~> 3.9.0)
43
- rspec-core (3.9.2)
43
+ rspec-core (3.9.3)
44
44
  rspec-support (~> 3.9.3)
45
45
  rspec-expectations (3.9.2)
46
46
  diff-lcs (>= 1.2.0, < 2.0)
@@ -51,31 +51,32 @@ GEM
51
51
  rspec-support (3.9.3)
52
52
  rspec_junit_formatter (0.4.1)
53
53
  rspec-core (>= 2, < 4, != 2.12.0)
54
- rubocop (0.89.1)
54
+ rubocop (0.93.1)
55
55
  parallel (~> 1.10)
56
- parser (>= 2.7.1.1)
56
+ parser (>= 2.7.1.5)
57
57
  rainbow (>= 2.2.2, < 4.0)
58
- regexp_parser (>= 1.7)
58
+ regexp_parser (>= 1.8)
59
59
  rexml
60
- rubocop-ast (>= 0.3.0, < 1.0)
60
+ rubocop-ast (>= 0.6.0)
61
61
  ruby-progressbar (~> 1.7)
62
62
  unicode-display_width (>= 1.4.0, < 2.0)
63
- rubocop-ast (0.3.0)
64
- parser (>= 2.7.1.4)
63
+ rubocop-ast (0.8.0)
64
+ parser (>= 2.7.1.5)
65
65
  rubocop-md (0.4.0)
66
66
  rubocop (~> 0.60)
67
- rubocop-performance (1.7.1)
68
- rubocop (>= 0.82.0)
67
+ rubocop-performance (1.8.1)
68
+ rubocop (>= 0.87.0)
69
+ rubocop-ast (>= 0.4.0)
69
70
  rubocop-rspec (1.43.2)
70
71
  rubocop (~> 0.87)
71
72
  rubocop-sequel (0.0.6)
72
73
  rubocop (~> 0.55, >= 0.55)
73
74
  ruby-progressbar (1.10.1)
74
- sequel (5.35.0)
75
+ sequel (5.37.0)
75
76
  simplecov (0.19.0)
76
77
  docile (~> 1.1)
77
78
  simplecov-html (~> 0.11)
78
- simplecov-html (0.12.2)
79
+ simplecov-html (0.12.3)
79
80
  unicode-display_width (1.7.0)
80
81
 
81
82
  PLATFORMS
@@ -40,9 +40,9 @@ module Legion
40
40
  return unless defined?(::Legion::Cache)
41
41
 
42
42
  Legion::Data::Model::Relationship.plugin :caching, Legion::Cache, ttl: 10
43
+ Legion::Data::Model::Runner.plugin :caching, Legion::Cache, ttl: 60
43
44
  Legion::Data::Model::Chain.plugin :caching, Legion::Cache, ttl: 60
44
45
  Legion::Data::Model::Datacenter.plugin :caching, Legion::Cache, ttl: 120
45
- Legion::Data::Model::Extension.plugin :caching, Legion::Cache, ttl: 120
46
46
  Legion::Data::Model::Function.plugin :caching, Legion::Cache, ttl: 120
47
47
  Legion::Data::Model::Extension.plugin :caching, Legion::Cache, ttl: 120
48
48
  Legion::Data::Model::Node.plugin :caching, Legion::Cache, ttl: 10
@@ -50,6 +50,7 @@ module Legion
50
50
  Legion::Data::Model::Task.plugin :caching, Legion::Cache, ttl: 10
51
51
  Legion::Data::Model::User.plugin :caching, Legion::Cache, ttl: 120
52
52
  Legion::Data::Model::Group.plugin :caching, Legion::Cache, ttl: 120
53
+ Legion::Logging.info 'Legion::Data connected to Legion::Cache'
53
54
  end
54
55
 
55
56
  def shutdown
@@ -29,10 +29,19 @@ module Legion
29
29
  Legion::Settings[:data][:connected] = false
30
30
  end
31
31
 
32
- def creds_builder
32
+ def creds_builder # rubocop:disable Metrics/AbcSize
33
33
  final_creds = {}
34
- final_creds.merge! default_creds
34
+ final_creds.merge! Legion::Data::Settings.creds
35
35
  final_creds.merge! Legion::Settings[:data][:creds] if Legion::Settings[:data][:creds].is_a? Hash
36
+
37
+ if Legion::Settings[:data][:connection][:max_connections].is_a? Integer
38
+ final_creds[:max_connections] = Legion::Settings[:data][:connection][:max_connections]
39
+ end
40
+
41
+ final_creds[:preconnect] = :concurrently if Legion::Settings[:data][:connection][:preconnect]
42
+
43
+ Legion::Logging.unknown final_creds
44
+
36
45
  return final_creds if Legion::Settings[:vault].nil?
37
46
 
38
47
  if Legion::Settings[:vault][:connected] && ::Vault.sys.mounts.key?(:database)
@@ -51,8 +60,7 @@ module Legion
51
60
  username: 'legion',
52
61
  password: 'legion',
53
62
  database: 'legion',
54
- max_connections: 32,
55
- preconnect: 'concurrently'
63
+ max_connections: 4
56
64
  }
57
65
  end
58
66
  end
@@ -0,0 +1,7 @@
1
+ Sequel.migration do
2
+ change do
3
+ alter_table(:extensions) do
4
+ add_column :schema_version, Integer, null: false, default: 0, index: true
5
+ end
6
+ end
7
+ end
@@ -35,7 +35,8 @@ module Legion
35
35
  log_connection_info: false,
36
36
  log_warn_duration: 1,
37
37
  sql_log_level: 'debug',
38
- max_connections: 10
38
+ max_connections: 10,
39
+ preconnect: false
39
40
  }
40
41
  end
41
42
 
@@ -45,8 +46,7 @@ module Legion
45
46
  password: 'legion',
46
47
  database: 'legion',
47
48
  host: '127.0.0.1',
48
- port: 3306,
49
- debug: false
49
+ port: 3306
50
50
  }
51
51
  end
52
52
 
@@ -1,5 +1,5 @@
1
1
  module Legion
2
2
  module Data
3
- VERSION = '1.1.2'.freeze
3
+ VERSION = '1.1.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-25 00:00:00.000000000 Z
11
+ date: 2020-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -246,6 +246,7 @@ files:
246
246
  - lib/legion/data/migrations/015_add_default_extensions.rb
247
247
  - lib/legion/data/migrations/016_change_task_args.rb
248
248
  - lib/legion/data/migrations/017_add_payload_task.rb
249
+ - lib/legion/data/migrations/018_add_migration_column.rb
249
250
  - lib/legion/data/model.rb
250
251
  - lib/legion/data/models/chain.rb
251
252
  - lib/legion/data/models/datacenter.rb