legion-data 1.1.5 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rubocop-analysis.yml +28 -0
  3. data/.github/workflows/sourcehawk-scan.yml +20 -0
  4. data/.gitignore +5 -2
  5. data/.rubocop.yml +1 -7
  6. data/CHANGELOG.md +2 -14
  7. data/CODE_OF_CONDUCT.md +75 -0
  8. data/CONTRIBUTING.md +55 -0
  9. data/Gemfile +7 -1
  10. data/INDIVIDUAL_CONTRIBUTOR_LICENSE.md +30 -0
  11. data/LICENSE +201 -0
  12. data/NOTICE.txt +9 -0
  13. data/README.md +60 -23
  14. data/SECURITY.md +9 -0
  15. data/attribution.txt +1 -0
  16. data/legion-data.gemspec +22 -35
  17. data/lib/legion/data.rb +11 -12
  18. data/lib/legion/data/connection.rb +9 -9
  19. data/lib/legion/data/migration.rb +0 -0
  20. data/lib/legion/data/migrations/001_add_schema_columns.rb +0 -0
  21. data/lib/legion/data/migrations/002_add_nodes.rb +20 -0
  22. data/lib/legion/data/migrations/003_add_settings.rb +18 -0
  23. data/lib/legion/data/migrations/004_add_extensions.rb +25 -0
  24. data/lib/legion/data/migrations/005_add_runners.rb +21 -0
  25. data/lib/legion/data/migrations/006_add_functions.rb +23 -0
  26. data/lib/legion/data/migrations/{015_add_default_extensions.rb → 007_add_default_extensions.rb} +1 -0
  27. data/lib/legion/data/migrations/008_add_tasks.rb +29 -0
  28. data/lib/legion/data/model.rb +2 -2
  29. data/lib/legion/data/models/extension.rb +0 -0
  30. data/lib/legion/data/models/function.rb +2 -4
  31. data/lib/legion/data/models/node.rb +1 -3
  32. data/lib/legion/data/models/runner.rb +0 -0
  33. data/lib/legion/data/models/setting.rb +0 -0
  34. data/lib/legion/data/models/task.rb +0 -0
  35. data/lib/legion/data/models/task_log.rb +0 -0
  36. data/lib/legion/data/settings.rb +20 -20
  37. data/lib/legion/data/version.rb +1 -1
  38. data/sourcehawk.yml +4 -0
  39. metadata +37 -131
  40. data/.circleci/config.yml +0 -174
  41. data/.rspec +0 -1
  42. data/Gemfile.lock +0 -85
  43. data/Rakefile +0 -55
  44. data/bin/console +0 -14
  45. data/bin/setup +0 -8
  46. data/bitbucket-pipelines.yml +0 -26
  47. data/lib/legion/data/migrations/002_add_users.rb +0 -17
  48. data/lib/legion/data/migrations/003_add_groups.rb +0 -16
  49. data/lib/legion/data/migrations/004_add_chains.rb +0 -25
  50. data/lib/legion/data/migrations/005_add_envs.rb +0 -24
  51. data/lib/legion/data/migrations/006_add_dcs.rb +0 -24
  52. data/lib/legion/data/migrations/007_add_nodes.rb +0 -26
  53. data/lib/legion/data/migrations/008_add_settings.rb +0 -18
  54. data/lib/legion/data/migrations/009_add_extensions.rb +0 -25
  55. data/lib/legion/data/migrations/010_add_runners.rb +0 -21
  56. data/lib/legion/data/migrations/011_add_functions.rb +0 -29
  57. data/lib/legion/data/migrations/012_add_tasks.rb +0 -28
  58. data/lib/legion/data/migrations/013_add_task_logs.rb +0 -23
  59. data/lib/legion/data/migrations/014_add_relationships.rb +0 -27
  60. data/lib/legion/data/migrations/016_change_task_args.rb +0 -7
  61. data/lib/legion/data/migrations/017_add_payload_task.rb +0 -7
  62. data/lib/legion/data/migrations/018_add_migration_column.rb +0 -7
  63. data/lib/legion/data/migrations/019_add_debug_to_relationships.rb +0 -7
  64. data/lib/legion/data/migrations/020_add_delay_debug_to_tasks.rb +0 -8
  65. data/lib/legion/data/models/chain.rb +0 -11
  66. data/lib/legion/data/models/datacenter.rb +0 -11
  67. data/lib/legion/data/models/environment.rb +0 -11
  68. data/lib/legion/data/models/group.rb +0 -10
  69. data/lib/legion/data/models/relationship.rb +0 -16
  70. data/lib/legion/data/models/user.rb +0 -10
@@ -4,9 +4,7 @@ module Legion
4
4
  module Data
5
5
  module Model
6
6
  class Node < Sequel::Model
7
- many_to_one :environment
8
- many_to_one :datacenter
9
- one_to_many :task_log
7
+ # one_to_many :task_log
10
8
  end
11
9
  end
12
10
  end
File without changes
File without changes
File without changes
File without changes
@@ -3,12 +3,12 @@ module Legion
3
3
  module Settings
4
4
  def self.default
5
5
  {
6
- connected: false,
7
- cache: cache,
8
- connection: connection,
9
- creds: creds,
10
- migrations: migrations,
11
- models: models,
6
+ connected: false,
7
+ cache: cache,
8
+ connection: connection,
9
+ creds: creds,
10
+ migrations: migrations,
11
+ models: models,
12
12
  connect_on_start: true
13
13
  }
14
14
  end
@@ -16,27 +16,27 @@ module Legion
16
16
  def self.models
17
17
  {
18
18
  continue_on_load_fail: false,
19
- autoload: true
19
+ autoload: true
20
20
  }
21
21
  end
22
22
 
23
23
  def self.migrations
24
24
  {
25
25
  continue_on_fail: false,
26
- auto_migrate: true,
27
- ran: false,
28
- version: nil
26
+ auto_migrate: true,
27
+ ran: false,
28
+ version: nil
29
29
  }
30
30
  end
31
31
 
32
32
  def self.connection
33
33
  {
34
- log: false,
34
+ log: false,
35
35
  log_connection_info: false,
36
- log_warn_duration: 1,
37
- sql_log_level: 'debug',
38
- max_connections: 10,
39
- preconnect: false
36
+ log_warn_duration: 1,
37
+ sql_log_level: 'debug',
38
+ max_connections: 10,
39
+ preconnect: false
40
40
  }
41
41
  end
42
42
 
@@ -44,17 +44,17 @@ module Legion
44
44
  {
45
45
  username: 'legion',
46
46
  password: 'legion',
47
- database: 'legion',
48
- host: '127.0.0.1',
49
- port: 3306
47
+ database: 'legionio',
48
+ host: '127.0.0.1',
49
+ port: 3306
50
50
  }
51
51
  end
52
52
 
53
53
  def self.cache
54
54
  {
55
- connected: false,
55
+ connected: false,
56
56
  auto_enable: Legion::Settings[:cache][:connected],
57
- ttl: 60
57
+ ttl: 60
58
58
  }
59
59
  end
60
60
  end
@@ -1,5 +1,5 @@
1
1
  module Legion
2
2
  module Data
3
- VERSION = '1.1.5'.freeze
3
+ VERSION = '1.2.0'.freeze
4
4
  end
5
5
  end
data/sourcehawk.yml ADDED
@@ -0,0 +1,4 @@
1
+
2
+ config-locations:
3
+ - https://raw.githubusercontent.com/optum/.github/main/sourcehawk.yml
4
+
metadata CHANGED
@@ -1,99 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-28 00:00:00.000000000 Z
11
+ date: 2021-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: codecov
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rake
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rspec
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: rspec_junit_formatter
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
13
  - !ruby/object:Gem::Dependency
98
14
  name: legion-logging
99
15
  requirement: !ruby/object:Gem::Requirement
@@ -150,75 +66,65 @@ dependencies:
150
66
  - - ">="
151
67
  - !ruby/object:Gem::Version
152
68
  version: '0'
153
- description: The Legion connect gem
69
+ description: A LegionIO gem to connect to a persistent data store
154
70
  email:
155
71
  - matthewdiverson@gmail.com
72
+ - ruby@optum.com
156
73
  executables: []
157
74
  extensions: []
158
- extra_rdoc_files: []
75
+ extra_rdoc_files:
76
+ - README.md
77
+ - LICENSE
78
+ - CHANGELOG.md
159
79
  files:
160
- - ".circleci/config.yml"
80
+ - ".github/workflows/rubocop-analysis.yml"
81
+ - ".github/workflows/sourcehawk-scan.yml"
161
82
  - ".gitignore"
162
- - ".rspec"
163
83
  - ".rubocop.yml"
164
84
  - CHANGELOG.md
85
+ - CODE_OF_CONDUCT.md
86
+ - CONTRIBUTING.md
165
87
  - Gemfile
166
- - Gemfile.lock
88
+ - INDIVIDUAL_CONTRIBUTOR_LICENSE.md
89
+ - LICENSE
90
+ - NOTICE.txt
167
91
  - README.md
168
- - Rakefile
169
- - bin/console
170
- - bin/setup
171
- - bitbucket-pipelines.yml
92
+ - SECURITY.md
93
+ - attribution.txt
172
94
  - legion-data.gemspec
173
95
  - lib/legion/data.rb
174
96
  - lib/legion/data/connection.rb
175
97
  - lib/legion/data/migration.rb
176
98
  - lib/legion/data/migrations/001_add_schema_columns.rb
177
- - lib/legion/data/migrations/002_add_users.rb
178
- - lib/legion/data/migrations/003_add_groups.rb
179
- - lib/legion/data/migrations/004_add_chains.rb
180
- - lib/legion/data/migrations/005_add_envs.rb
181
- - lib/legion/data/migrations/006_add_dcs.rb
182
- - lib/legion/data/migrations/007_add_nodes.rb
183
- - lib/legion/data/migrations/008_add_settings.rb
184
- - lib/legion/data/migrations/009_add_extensions.rb
185
- - lib/legion/data/migrations/010_add_runners.rb
186
- - lib/legion/data/migrations/011_add_functions.rb
187
- - lib/legion/data/migrations/012_add_tasks.rb
188
- - lib/legion/data/migrations/013_add_task_logs.rb
189
- - lib/legion/data/migrations/014_add_relationships.rb
190
- - lib/legion/data/migrations/015_add_default_extensions.rb
191
- - lib/legion/data/migrations/016_change_task_args.rb
192
- - lib/legion/data/migrations/017_add_payload_task.rb
193
- - lib/legion/data/migrations/018_add_migration_column.rb
194
- - lib/legion/data/migrations/019_add_debug_to_relationships.rb
195
- - lib/legion/data/migrations/020_add_delay_debug_to_tasks.rb
99
+ - lib/legion/data/migrations/002_add_nodes.rb
100
+ - lib/legion/data/migrations/003_add_settings.rb
101
+ - lib/legion/data/migrations/004_add_extensions.rb
102
+ - lib/legion/data/migrations/005_add_runners.rb
103
+ - lib/legion/data/migrations/006_add_functions.rb
104
+ - lib/legion/data/migrations/007_add_default_extensions.rb
105
+ - lib/legion/data/migrations/008_add_tasks.rb
196
106
  - lib/legion/data/model.rb
197
- - lib/legion/data/models/chain.rb
198
- - lib/legion/data/models/datacenter.rb
199
- - lib/legion/data/models/environment.rb
200
107
  - lib/legion/data/models/extension.rb
201
108
  - lib/legion/data/models/function.rb
202
- - lib/legion/data/models/group.rb
203
109
  - lib/legion/data/models/node.rb
204
- - lib/legion/data/models/relationship.rb
205
110
  - lib/legion/data/models/runner.rb
206
111
  - lib/legion/data/models/setting.rb
207
112
  - lib/legion/data/models/task.rb
208
113
  - lib/legion/data/models/task_log.rb
209
- - lib/legion/data/models/user.rb
210
114
  - lib/legion/data/settings.rb
211
115
  - lib/legion/data/version.rb
212
116
  - sonar-project.properties
213
- homepage: https://bitbucket.org/legion-io/legion-data
214
- licenses: []
117
+ - sourcehawk.yml
118
+ homepage: https://github.com/Optum/legion-data
119
+ licenses:
120
+ - Apache-2.0
215
121
  metadata:
216
- bug_tracker_uri: https://bitbucket.org/legion-io/legion-data/issues?status=new&status=open
217
- changelog_uri: https://bitbucket.org/legion-io/legion-data/src/CHANGELOG.md
218
- documentation_uri: https://bitbucket.org/legion-io/legion-data
219
- homepage_uri: https://bitbucket.org/legion-io/legion-data
220
- source_code_uri: https://bitbucket.org/legion-io/legion-data
221
- wiki_uri: https://bitbucket.org/legion-io/legion-data/wiki/Home
122
+ bug_tracker_uri: https://github.com/Optum/legion-data/issues
123
+ changelog_uri: https://github.com/Optum/legion-data/src/main/CHANGELOG.md
124
+ documentation_uri: https://github.com/Optum/legion-data
125
+ homepage_uri: https://github.com/Optum/LegionIO
126
+ source_code_uri: https://github.com/Optum/legion-data
127
+ wiki_uri: https://github.com/Optum/legion-data/wiki
222
128
  post_install_message:
223
129
  rdoc_options: []
224
130
  require_paths:
@@ -227,15 +133,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
227
133
  requirements:
228
134
  - - ">="
229
135
  - !ruby/object:Gem::Version
230
- version: 2.5.0
136
+ version: '2.5'
231
137
  required_rubygems_version: !ruby/object:Gem::Requirement
232
138
  requirements:
233
139
  - - ">="
234
140
  - !ruby/object:Gem::Version
235
141
  version: '0'
236
142
  requirements: []
237
- rubygems_version: 3.1.2
143
+ rubygems_version: 3.1.6
238
144
  signing_key:
239
145
  specification_version: 4
240
- summary: Used by Legion to connect to the database
146
+ summary: Manages the connects to the backend database
241
147
  test_files: []
data/.circleci/config.yml DELETED
@@ -1,174 +0,0 @@
1
- version: 2.1
2
- orbs:
3
- ruby: circleci/ruby@0.2.1
4
- sonarcloud: sonarsource/sonarcloud@1.0.1
5
-
6
- jobs:
7
- "rubocop":
8
- docker:
9
- - image: circleci/ruby:2.7-node
10
- steps:
11
- - checkout
12
- - ruby/load-cache
13
- - ruby/install-deps
14
- - run:
15
- name: Run Rubocop
16
- command: bundle exec rubocop
17
- - ruby/save-cache
18
- "ruby-two-five":
19
- docker:
20
- - image: circleci/ruby:2.5
21
- - image: circleci/mysql:5.7
22
- environment:
23
- MYSQL_DATABASE: 'legion'
24
- MYSQL_ROOT_PASSWORD: 'legion'
25
- MYSQL_USER: 'legion'
26
- MYSQL_PASSWORD: 'legion'
27
- steps:
28
- - checkout
29
- - ruby/load-cache
30
- - run:
31
- name: update bundler
32
- command: gem update bundler
33
- - ruby/install-deps
34
- - run:
35
- name: update max connections
36
- command: 'sudo apt-get install default-mysql-client && mysql -h 127.0.0.1 -u root --password=legion --execute="set global max_connections = 100000;"'
37
- - ruby/run-tests
38
- - ruby/save-cache
39
- "ruby-two-six":
40
- docker:
41
- - image: circleci/ruby:2.6
42
- - image: circleci/mysql:5.7
43
- environment:
44
- MYSQL_DATABASE: 'legion'
45
- MYSQL_ROOT_PASSWORD: 'legion'
46
- MYSQL_USER: 'legion'
47
- MYSQL_PASSWORD: 'legion'
48
- steps:
49
- - checkout
50
- - ruby/load-cache
51
- - run:
52
- name: update bundler
53
- command: gem update bundler
54
- - ruby/install-deps
55
- - run:
56
- name: update max connections
57
- command: 'sudo apt-get install default-mysql-client && mysql -h 127.0.0.1 -u root --password=legion --execute="set global max_connections = 100000;"'
58
- - ruby/run-tests
59
- - ruby/save-cache
60
- "ruby-two-seven":
61
- docker:
62
- - image: circleci/ruby:2.7
63
- - image: circleci/mysql:5.7
64
- environment:
65
- MYSQL_DATABASE: 'legion'
66
- MYSQL_ROOT_PASSWORD: 'legion'
67
- MYSQL_USER: 'legion'
68
- MYSQL_PASSWORD: 'legion'
69
- steps:
70
- - checkout
71
- - ruby/load-cache
72
- - ruby/install-deps
73
- - run:
74
- name: update max connections
75
- command: 'sudo apt-get install default-mysql-client && mysql -h 127.0.0.1 -u root --password=legion --execute="set global max_connections = 100000;"'
76
- - ruby/run-tests
77
- - ruby/save-cache
78
- "jruby-nine-two":
79
- docker:
80
- - image: circleci/jruby:9.2-jre
81
- - image: circleci/mysql:5.7
82
- environment:
83
- MYSQL_DATABASE: 'legion'
84
- MYSQL_ROOT_PASSWORD: 'legion'
85
- MYSQL_USER: 'legion'
86
- MYSQL_PASSWORD: 'legion'
87
- steps:
88
- - checkout
89
- - run:
90
- name: Bundle Install
91
- command: bundle install
92
- - run:
93
- name: update max connections
94
- command: 'sudo apt-get install default-mysql-client && mysql -h 127.0.0.1 -u root --password=legion --execute="set global max_connections = 100000;"'
95
- - run:
96
- name: Run RSpec
97
- command: bundle exec rspec --format progress --format RspecJunitFormatter -o test-results/rspec/results.xml
98
- when: always
99
- - sonarcloud/scan
100
- "jruby-nine-two-e":
101
- docker:
102
- - image: circleci/jruby:9.2.13-jre
103
- - image: circleci/mysql:5.7
104
- environment:
105
- MYSQL_DATABASE: 'legion'
106
- MYSQL_ROOT_PASSWORD: 'legion'
107
- MYSQL_USER: 'legion'
108
- MYSQL_PASSWORD: 'legion'
109
- steps:
110
- - checkout
111
- - run:
112
- name: Bundle Install
113
- command: bundle install
114
- - run:
115
- name: update max connections
116
- command: 'sudo apt-get install default-mysql-client && mysql -h 127.0.0.1 -u root --password=legion --execute="set global max_connections = 100000;"'
117
- - run:
118
- name: Run RSpec
119
- command: bundle exec rspec --format progress --format RspecJunitFormatter -o test-results/rspec/results.xml
120
- when: always
121
- "sonarcloud":
122
- docker:
123
- - image: circleci/ruby:2.7
124
- - image: circleci/mysql:5.7
125
- environment:
126
- MYSQL_DATABASE: 'legion'
127
- MYSQL_ROOT_PASSWORD: 'legion'
128
- MYSQL_USER: 'legion'
129
- MYSQL_PASSWORD: 'legion'
130
- steps:
131
- - checkout
132
- - ruby/load-cache
133
- - run:
134
- name: Install Rubocop
135
- command: gem install rubocop rubocop-sequel rubocop-performance rubocop-rspec
136
- - run:
137
- name: update bundler
138
- command: gem update bundler
139
- - ruby/install-deps
140
- - run:
141
- name: update max connections
142
- command: 'sudo apt-get install default-mysql-client && mysql -h 127.0.0.1 -u root --password=legion --execute="set global max_connections = 100000;"'
143
- - ruby/run-tests
144
- - run:
145
- name: Run Rubocop
146
- command: rubocop --format=json --out=rubocop-result.json
147
- - sonarcloud/scan
148
- - ruby/save-cache
149
-
150
- workflows:
151
- version: 2
152
- rubocop-rspec:
153
- jobs:
154
- - rubocop
155
- - ruby-two-five:
156
- requires:
157
- - rubocop
158
- - ruby-two-six:
159
- requires:
160
- - ruby-two-five
161
- - ruby-two-seven:
162
- requires:
163
- - ruby-two-five
164
- - sonarcloud:
165
- requires:
166
- - ruby-two-seven
167
- - ruby-two-six
168
- - jruby-nine-two:
169
- requires:
170
- - ruby-two-seven
171
- - ruby-two-six
172
- - jruby-nine-two-e:
173
- requires:
174
- - jruby-nine-two