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
@@ -1,23 +0,0 @@
1
- Sequel.migration do
2
- up do
3
- run "CREATE TABLE `task_logs` (
4
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
- `task_id` int(11) unsigned NOT NULL,
6
- `function_id` int(11) unsigned,
7
- `node_id` int(11) unsigned,
8
- `entry` text NOT NULL,
9
- `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
10
- `updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
11
- PRIMARY KEY (`id`),
12
- KEY (`created`),
13
- KEY (`updated`),
14
- CONSTRAINT `task_log_task_id` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
15
- CONSTRAINT `task_log_functions` FOREIGN KEY (`function_id`) REFERENCES `functions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
16
- CONSTRAINT `task_log_nodes` FOREIGN KEY (`node_id`) REFERENCES `nodes` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
17
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
18
- end
19
-
20
- down do
21
- drop_table :task_logs
22
- end
23
- end
@@ -1,27 +0,0 @@
1
- Sequel.migration do
2
- up do
3
- run "CREATE TABLE `relationships` (
4
- `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
5
- `name` varchar(255) DEFAULT NULL,
6
- `active` tinyint(1) unsigned NOT NULL DEFAULT '1',
7
- `chain_id` int(11) unsigned DEFAULT NULL,
8
- `trigger_id` int(11) unsigned NOT NULL,
9
- `action_id` int(11) unsigned NOT NULL,
10
- `delay` int(11) unsigned NOT NULL DEFAULT '0',
11
- `allow_new_chains` tinyint(1) unsigned NOT NULL DEFAULT '1',
12
- `conditions` text,
13
- `transformation` text,
14
- `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
15
- `updated` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
16
- PRIMARY KEY (`id`),
17
- KEY `chain_id` (`chain_id`),
18
- CONSTRAINT `function_chain_id` FOREIGN KEY (`chain_id`) REFERENCES `chains` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
19
- CONSTRAINT `relationship_action_id` FOREIGN KEY (`action_id`) REFERENCES `functions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
20
- CONSTRAINT `relationship_trigger_id` FOREIGN KEY (`trigger_id`) REFERENCES `functions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
21
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
22
- end
23
-
24
- down do
25
- drop_table :relationships
26
- end
27
- end
@@ -1,7 +0,0 @@
1
- Sequel.migration do
2
- change do
3
- alter_table(:tasks) do
4
- rename_column :args, :function_args
5
- end
6
- end
7
- end
@@ -1,7 +0,0 @@
1
- Sequel.migration do
2
- change do
3
- alter_table(:tasks) do
4
- add_column :payload, :text
5
- end
6
- end
7
- end
@@ -1,7 +0,0 @@
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
@@ -1,7 +0,0 @@
1
- Sequel.migration do
2
- change do
3
- alter_table(:relationships) do
4
- add_column :debug, Integer, null: false, default: 0, index: true
5
- end
6
- end
7
- end
@@ -1,8 +0,0 @@
1
- Sequel.migration do
2
- change do
3
- alter_table(:tasks) do
4
- add_column :delay, Integer, limit: 1, null: false, default: 0, index: true
5
- add_column :debug, Integer, limit: 1, null: false, default: 0, index: true
6
- end
7
- end
8
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Legion
4
- module Data
5
- module Model
6
- class Chain < Sequel::Model
7
- one_to_many :relationship
8
- end
9
- end
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Legion
4
- module Data
5
- module Model
6
- class Datacenter < Sequel::Model
7
- one_to_many :node
8
- end
9
- end
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Legion
4
- module Data
5
- module Model
6
- class Environment < Sequel::Model
7
- one_to_many :node
8
- end
9
- end
10
- end
11
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Legion
4
- module Data
5
- module Model
6
- class Group < Sequel::Model
7
- end
8
- end
9
- end
10
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'function'
4
-
5
- module Legion
6
- module Data
7
- module Model
8
- class Relationship < Sequel::Model
9
- many_to_one :chain
10
- one_to_many :task
11
- many_to_one :trigger, class: Legion::Data::Model::Function
12
- many_to_one :action, class: Legion::Data::Model::Function
13
- end
14
- end
15
- end
16
- end
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Legion
4
- module Data
5
- module Model
6
- class User < Sequel::Model
7
- end
8
- end
9
- end
10
- end