firespring_dev_commands 2.1.22 → 2.5.0.pre.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/firespring_dev_commands/audit/report.rb +2 -9
- data/lib/firespring_dev_commands/node.rb +1 -1
- data/lib/firespring_dev_commands/php.rb +9 -16
- data/lib/firespring_dev_commands/platform.rb +1 -1
- data/lib/firespring_dev_commands/target_process/query.rb +4 -30
- data/lib/firespring_dev_commands/target_process.rb +1 -3
- data/lib/firespring_dev_commands/templates/docker/application.rb +2 -2
- data/lib/firespring_dev_commands/templates/docker/node/application.rb +5 -19
- data/lib/firespring_dev_commands/templates/docker/php/application.rb +16 -19
- data/lib/firespring_dev_commands/templates/docker/ruby/application.rb +5 -18
- data/lib/firespring_dev_commands/version.rb +1 -1
- data/lib/firespring_dev_commands.rb +1 -1
- metadata +37 -41
- data/lib/firespring_dev_commands/bloom_growth/rock.rb +0 -34
- data/lib/firespring_dev_commands/bloom_growth/seat.rb +0 -16
- data/lib/firespring_dev_commands/bloom_growth/user.rb +0 -43
- data/lib/firespring_dev_commands/bloom_growth.rb +0 -132
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e146e8c9d9c3422dfd7641c6a09ca8c2cdfad6ed430d73aec5808de28ed5d880
|
4
|
+
data.tar.gz: 273923aae5ccce231fc77174ed89cbe0e4f5ad59b52219b04303f983e9966e1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67223e6ba12a10f798d7fee6b1cab844da41cd3dc65a449330e8c8bd0ef86180cc297889b7365b7b68f5ca8054919e9881693707ecfde02e539d0a7e22c6af51
|
7
|
+
data.tar.gz: ada0e13a3f2d8022687a2542503bad6bc847bf32fc17604116d17e06ed46ee7efa18aea35635c31a26c07f5ccdd6a3c5083235edaafd77684528bc487c17f3c7
|
@@ -3,12 +3,11 @@ module Dev
|
|
3
3
|
class Audit
|
4
4
|
# The class containing standardized information about an audit report
|
5
5
|
class Report
|
6
|
-
attr_accessor :items, :min_severity, :
|
6
|
+
attr_accessor :items, :min_severity, :ignorelist, :filtered_items
|
7
7
|
|
8
8
|
def initialize(
|
9
9
|
items,
|
10
10
|
min_severity: ENV.fetch('MIN_SEVERITY', nil),
|
11
|
-
error_on_unknown: ENV.fetch('ERROR_ON_UNKNOWN', nil),
|
12
11
|
ignorelist: ENV['IGNORELIST'].to_s.split(/\s*,\s*/)
|
13
12
|
)
|
14
13
|
# Items should be an array of Item objects
|
@@ -16,18 +15,12 @@ module Dev
|
|
16
15
|
raise 'items must all be report items' unless @items.all?(Dev::Audit::Report::Item)
|
17
16
|
|
18
17
|
@min_severity = min_severity || Level::HIGH
|
19
|
-
@error_on_unknown = error_on_unknown
|
20
18
|
@ignorelist = Array(ignorelist).compact
|
21
19
|
end
|
22
20
|
|
23
21
|
# Get all severities greater than or equal to the minimum severity
|
24
22
|
def desired_severities
|
25
|
-
|
26
|
-
-1
|
27
|
-
else
|
28
|
-
-2
|
29
|
-
end
|
30
|
-
LEVELS.slice(LEVELS.find_index(min_severity)..max_severity)
|
23
|
+
LEVELS.slice(LEVELS.find_index(min_severity)..-1)
|
31
24
|
end
|
32
25
|
|
33
26
|
# Run the filters against the report items and filter out any which should be excluded
|
@@ -58,12 +58,9 @@ module Dev
|
|
58
58
|
end
|
59
59
|
|
60
60
|
# Build the command to fix any security vulnerabilities that were found
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
# audit_fix.concat(Dev::Common.new.tokenize(ENV['OPTS'].to_s))
|
65
|
-
# audit_fix
|
66
|
-
# end
|
61
|
+
def audit_fix_command
|
62
|
+
raise 'not implemented'
|
63
|
+
end
|
67
64
|
|
68
65
|
# Build the php install command
|
69
66
|
def install_command
|
@@ -76,7 +73,7 @@ module Dev
|
|
76
73
|
# Build the php lint command
|
77
74
|
def lint_command
|
78
75
|
lint = base_command
|
79
|
-
lint << 'lint'
|
76
|
+
lint << 'run' << 'lint'
|
80
77
|
lint.concat(Dev::Common.new.tokenize(ENV['OPTS'].to_s))
|
81
78
|
lint
|
82
79
|
end
|
@@ -84,7 +81,7 @@ module Dev
|
|
84
81
|
# Build the php lint fix command
|
85
82
|
def lint_fix_command
|
86
83
|
lint_fix = base_command
|
87
|
-
lint_fix << 'lint-fix'
|
84
|
+
lint_fix << 'run' << 'lint-fix'
|
88
85
|
lint_fix.concat(Dev::Common.new.tokenize(ENV['OPTS'].to_s))
|
89
86
|
lint_fix
|
90
87
|
end
|
@@ -92,18 +89,14 @@ module Dev
|
|
92
89
|
# Build the php test command
|
93
90
|
def test_command
|
94
91
|
test = []
|
95
|
-
|
92
|
+
lint_fix << 'run' << 'test'
|
96
93
|
test.concat(Dev::Common.new.tokenize(ENV['OPTS'].to_s))
|
97
94
|
test
|
98
95
|
end
|
99
96
|
|
100
|
-
# Build the php
|
101
|
-
def
|
102
|
-
|
103
|
-
test << './vendor/bin/paratest'
|
104
|
-
test.concat(Dev::Common.new.tokenize(ENV['OPTS'].to_s))
|
105
|
-
test << "-p#{processes}" << '--runner=WrapperRunner'
|
106
|
-
test
|
97
|
+
# Build the php test (with coverage) command
|
98
|
+
def test_coverage_command
|
99
|
+
raise 'not implemented'
|
107
100
|
end
|
108
101
|
end
|
109
102
|
end
|
@@ -8,7 +8,7 @@ module Dev
|
|
8
8
|
# Normalize the ruby platform to return a docker platform architecture format
|
9
9
|
def determine_compute_architecture
|
10
10
|
case RUBY_PLATFORM
|
11
|
-
when /x86_64|amd64
|
11
|
+
when /x86_64|amd64/
|
12
12
|
'linux/amd64' # 64-bit Intel/AMD architecture
|
13
13
|
when /arm|aarch64/
|
14
14
|
'linux/arm64' # ARM architecture
|
@@ -2,13 +2,12 @@ module Dev
|
|
2
2
|
class TargetProcess
|
3
3
|
# Class for writing target process query statements
|
4
4
|
class Query
|
5
|
-
attr_accessor :where, :incl, :take
|
5
|
+
attr_accessor :where, :incl, :take
|
6
6
|
|
7
7
|
def initialize
|
8
8
|
@where = []
|
9
9
|
@incl = []
|
10
10
|
@take = 250
|
11
|
-
@empty = false
|
12
11
|
end
|
13
12
|
|
14
13
|
# Add a new query clause
|
@@ -34,11 +33,6 @@ module Dev
|
|
34
33
|
end
|
35
34
|
end
|
36
35
|
|
37
|
-
# Check if any of the "in" statements were empty. If so then we don't want to actually run the query
|
38
|
-
def empty?
|
39
|
-
@empty == true
|
40
|
-
end
|
41
|
-
|
42
36
|
# Generate the string representation for this query
|
43
37
|
def generate
|
44
38
|
{}.tap do |clause|
|
@@ -56,38 +50,22 @@ module Dev
|
|
56
50
|
# TODO: Do these need moved to their associated entities?
|
57
51
|
# Add a filter that looks for stories whose id is contained in the list of ids given
|
58
52
|
def filter_by_user_story_ids(user_story_ids)
|
59
|
-
if user_story_ids.nil? || user_story_ids.empty?
|
60
|
-
@empty = true
|
61
|
-
return
|
62
|
-
end
|
63
53
|
self << "(Id in ('#{user_story_ids.join("', '")}'))"
|
64
54
|
end
|
65
55
|
|
66
56
|
# Add a filter that looks for stories whose team id is contained in the list of ids given
|
67
57
|
def filter_by_team_ids(team_ids)
|
68
|
-
|
69
|
-
@empty = true
|
70
|
-
return
|
71
|
-
end
|
72
|
-
self << "(Team.Id in ('#{team_ids.join("', '")}'))"
|
58
|
+
self << "(Team.Id in ('#{team_ids.join("', '")}'))" unless team_ids.nil? || team_ids.empty?
|
73
59
|
end
|
74
60
|
|
75
61
|
# Add a filter that looks for stories whose project id is contained in the list of ids given
|
76
62
|
def filter_by_project(projects)
|
77
|
-
if projects.nil? || projects.empty?
|
78
|
-
@empty = true
|
79
|
-
return
|
80
|
-
end
|
81
63
|
self << "(Project.Name in ('#{projects.join("', '")}'))"
|
82
64
|
end
|
83
65
|
|
84
66
|
# Add a filter that looks for stories whose state is contained in the list of states given
|
85
67
|
def filter_by_states(states)
|
86
|
-
|
87
|
-
@empty = true
|
88
|
-
return
|
89
|
-
end
|
90
|
-
self << "(EntityState.Name in ('#{states.join("', '")}'))"
|
68
|
+
self << "(EntityState.Name in ('#{states.join("', '")}'))" unless states.nil? || states.empty?
|
91
69
|
end
|
92
70
|
|
93
71
|
# Add a filter that looks for stories whose state is set to final
|
@@ -136,11 +114,7 @@ module Dev
|
|
136
114
|
|
137
115
|
# Add a filter that looks for assignable ids which are included in the given array
|
138
116
|
def filter_by_entity_ids(entity_ids)
|
139
|
-
|
140
|
-
@empty = true
|
141
|
-
return
|
142
|
-
end
|
143
|
-
self << "(Assignable.Id in ('#{entity_ids.join("', '")}'))"
|
117
|
+
self << "(Assignable.Id in ('#{entity_ids.join("', '")}'))" unless entity_ids.nil? || entity_ids.empty?
|
144
118
|
end
|
145
119
|
|
146
120
|
# Add a filter that looks for a custom deploy date between the given dates`
|
@@ -15,7 +15,7 @@ module Dev
|
|
15
15
|
# The text of the url variable key
|
16
16
|
TP_URL = 'TP_URL'.freeze
|
17
17
|
|
18
|
-
# Config object for setting top level
|
18
|
+
# Config object for setting top level jira config options
|
19
19
|
Config = Struct.new(:username, :password, :url, :http_debug) do
|
20
20
|
def initialize
|
21
21
|
Dotenv.load(CONFIG_FILE) if File.exist?(CONFIG_FILE)
|
@@ -117,8 +117,6 @@ module Dev
|
|
117
117
|
# Call the given block (if present) with each piece of data
|
118
118
|
# Return all pieces of data
|
119
119
|
def get(path, query, &)
|
120
|
-
return [] if query.empty?
|
121
|
-
|
122
120
|
query_string = query.generate
|
123
121
|
url = "/api/v1/#{path}"
|
124
122
|
url << "?#{URI.encode_www_form(query_string)}" unless query_string.empty?
|
@@ -72,7 +72,7 @@ module Dev
|
|
72
72
|
return if exclude.include?(:sh)
|
73
73
|
|
74
74
|
desc "Open a shell into a running #{application} container"
|
75
|
-
task sh: %W(init_docker #{application}:
|
75
|
+
task sh: %W(init_docker #{application}:up _pre_sh_hooks) do
|
76
76
|
Dev::Docker::Compose.new(services: [application]).sh
|
77
77
|
Rake::Task[:_post_sh_hooks].execute
|
78
78
|
end
|
@@ -154,7 +154,7 @@ module Dev
|
|
154
154
|
return if exclude.include?(:reload)
|
155
155
|
|
156
156
|
desc "Reloads the #{application} container"
|
157
|
-
task reload: %w(init_docker _pre_reload_hooks down
|
157
|
+
task reload: %w(init_docker _pre_reload_hooks down up) do
|
158
158
|
Rake::Task[:_post_reload_hooks].execute
|
159
159
|
end
|
160
160
|
end
|
@@ -7,24 +7,11 @@ module Dev
|
|
7
7
|
module Node
|
8
8
|
# Class for default rake tasks associated with a node project
|
9
9
|
class Application < Dev::Template::ApplicationInterface
|
10
|
-
attr_reader :node
|
11
|
-
|
12
|
-
#
|
13
|
-
|
14
|
-
# @param application [String] The name of the application
|
15
|
-
# @param container_path [String] The path to the application inside of the container
|
16
|
-
# @param local_path [String] The path to the application on your local system
|
17
|
-
# @param start_container_dependencies_on_test [Boolean] Whether or not to start up container dependencies when running tests
|
18
|
-
# @param exclude [Array<Symbol>] An array of default template tasks to exclude
|
19
|
-
def initialize(
|
20
|
-
application,
|
21
|
-
container_path: nil,
|
22
|
-
local_path: nil,
|
23
|
-
start_container_dependencies_on_test: true,
|
24
|
-
exclude: []
|
25
|
-
)
|
10
|
+
attr_reader :node
|
11
|
+
|
12
|
+
# Allow for custom container path for the application
|
13
|
+
def initialize(application, container_path: nil, local_path: nil, exclude: [])
|
26
14
|
@node = Dev::Node.new(container_path:, local_path:)
|
27
|
-
@start_container_dependencies_on_test = start_container_dependencies_on_test
|
28
15
|
super(application, exclude:)
|
29
16
|
end
|
30
17
|
|
@@ -72,7 +59,6 @@ module Dev
|
|
72
59
|
application = @name
|
73
60
|
node = @node
|
74
61
|
exclude = @exclude
|
75
|
-
up_cmd = @start_container_dependencies_on_test ? :up : :up_no_deps
|
76
62
|
return if exclude.include?(:test)
|
77
63
|
|
78
64
|
DEV_COMMANDS_TOP_LEVEL.instance_eval do
|
@@ -84,7 +70,7 @@ module Dev
|
|
84
70
|
|
85
71
|
namespace :node do
|
86
72
|
desc "Run all node tests against the #{application}'s codebase"
|
87
|
-
task test: %
|
73
|
+
task test: %w(init_docker up) do
|
88
74
|
LOG.debug("Running all node tests in the #{application} codebase")
|
89
75
|
|
90
76
|
options = []
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require_relative '../../base_interface'
|
2
|
+
require 'securerandom'
|
2
3
|
|
3
4
|
module Dev
|
4
5
|
module Template
|
@@ -7,23 +8,15 @@ module Dev
|
|
7
8
|
module Php
|
8
9
|
# Class for default rake tasks associated with a php project
|
9
10
|
class Application < Dev::Template::ApplicationInterface
|
10
|
-
attr_reader :php, :
|
11
|
-
|
12
|
-
#
|
13
|
-
|
14
|
-
# @param application [String] The name of the application
|
15
|
-
# @param container_path [String] The path to the application inside of the container
|
16
|
-
# @param local_path [String] The path to the application on your local system
|
17
|
-
# @param start_container_dependencies_on_test [Boolean] Whether or not to start up container dependencies when running tests
|
18
|
-
def initialize(
|
19
|
-
application,
|
20
|
-
container_path: nil,
|
21
|
-
local_path: nil,
|
22
|
-
start_container_dependencies_on_test: true,
|
23
|
-
exclude: []
|
24
|
-
)
|
11
|
+
attr_reader :php, :siloed_tests
|
12
|
+
|
13
|
+
# Allow for custom container path for the application
|
14
|
+
def initialize(application, container_path: nil, local_path: nil, siloed_tests: nil, exclude: [])
|
25
15
|
@php = Dev::Php.new(container_path:, local_path:)
|
26
|
-
|
16
|
+
# TODO: Better name
|
17
|
+
# TODO: Should this apply to all or just tests?
|
18
|
+
@siloed_tests = siloed_tests
|
19
|
+
|
27
20
|
super(application, exclude:)
|
28
21
|
end
|
29
22
|
|
@@ -114,8 +107,8 @@ module Dev
|
|
114
107
|
def create_test_task!
|
115
108
|
application = @name
|
116
109
|
php = @php
|
110
|
+
siloed_tests = @siloed_tests
|
117
111
|
exclude = @exclude
|
118
|
-
up_cmd = @start_container_dependencies_on_test ? :up : :up_no_deps
|
119
112
|
return if exclude.include?(:test)
|
120
113
|
|
121
114
|
DEV_COMMANDS_TOP_LEVEL.instance_eval do
|
@@ -127,12 +120,16 @@ module Dev
|
|
127
120
|
|
128
121
|
namespace :php do
|
129
122
|
desc "Run all php tests against the #{application}'s codebase"
|
130
|
-
task test: %
|
123
|
+
task test: %w(init_docker up) do
|
131
124
|
LOG.debug("Running all php tests in the #{application} codebase")
|
132
125
|
|
126
|
+
project_name = nil
|
127
|
+
project_name = SecureRandom.hex if siloed_tests
|
128
|
+
|
133
129
|
options = []
|
134
130
|
options << '-T' if Dev::Common.new.running_codebuild?
|
135
|
-
Dev::Docker::Compose.new(services: application, options:).exec(*php.test_command)
|
131
|
+
Dev::Docker::Compose.new(project_name:, services: application, options:).exec(*php.test_command)
|
132
|
+
# TODO: Add clean if we are siloed
|
136
133
|
end
|
137
134
|
end
|
138
135
|
end
|
@@ -7,23 +7,11 @@ module Dev
|
|
7
7
|
module Ruby
|
8
8
|
# Class for default rake tasks associated with a ruby project
|
9
9
|
class Application < Dev::Template::ApplicationInterface
|
10
|
-
attr_reader :ruby
|
11
|
-
|
12
|
-
#
|
13
|
-
|
14
|
-
# @param application [String] The name of the application
|
15
|
-
# @param container_path [String] The path to the application inside of the container
|
16
|
-
# @param local_path [String] The path to the application on your local system
|
17
|
-
# @param start_container_dependencies_on_test [Boolean] Whether or not to start up container dependencies when running tests
|
18
|
-
def initialize(
|
19
|
-
application,
|
20
|
-
container_path: nil,
|
21
|
-
local_path: nil,
|
22
|
-
start_container_dependencies_on_test: true,
|
23
|
-
exclude: []
|
24
|
-
)
|
10
|
+
attr_reader :ruby
|
11
|
+
|
12
|
+
# Allow for custom container path for the application
|
13
|
+
def initialize(application, container_path: nil, local_path: nil, exclude: [])
|
25
14
|
@ruby = Dev::Ruby.new(container_path:, local_path:)
|
26
|
-
@start_container_dependencies_on_test = start_container_dependencies_on_test
|
27
15
|
super(application, exclude:)
|
28
16
|
end
|
29
17
|
|
@@ -71,7 +59,6 @@ module Dev
|
|
71
59
|
application = @name
|
72
60
|
ruby = @ruby
|
73
61
|
exclude = @exclude
|
74
|
-
up_cmd = @start_container_dependencies_on_test ? :up : :up_no_deps
|
75
62
|
return if exclude.include?(:test)
|
76
63
|
|
77
64
|
DEV_COMMANDS_TOP_LEVEL.instance_eval do
|
@@ -83,7 +70,7 @@ module Dev
|
|
83
70
|
|
84
71
|
namespace :ruby do
|
85
72
|
desc "Run all ruby tests against the #{application}'s codebase"
|
86
|
-
task test: %
|
73
|
+
task test: %w(init_docker up_no_deps) do
|
87
74
|
LOG.debug("Running all ruby tests in the #{application} codebase")
|
88
75
|
|
89
76
|
options = []
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firespring_dev_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1
|
4
|
+
version: 2.5.0.pre.alpha.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,154 +16,154 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.1.
|
19
|
+
version: 7.1.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 7.1.
|
26
|
+
version: 7.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: aws-sdk-cloudformation
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.83.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.83.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: aws-sdk-codepipeline
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.59.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.59.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: aws-sdk-ecr
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.61.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.61.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: aws-sdk-elasticache
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: 1.88.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: 1.88.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: aws-sdk-lambda
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.
|
89
|
+
version: 1.101.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.
|
96
|
+
version: 1.101.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: aws-sdk-opensearchservice
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
103
|
+
version: 1.24.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.
|
110
|
+
version: 1.24.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: aws-sdk-rds
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
117
|
+
version: 1.183.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
124
|
+
version: 1.183.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: aws-sdk-s3
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: 1.127.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
138
|
+
version: 1.127.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: aws-sdk-ssm
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
145
|
+
version: 1.154.0
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
152
|
+
version: 1.154.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: aws-sdk-sts
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
159
|
+
version: 1.10.0
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.
|
166
|
+
version: 1.10.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: colorize
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -249,61 +249,61 @@ dependencies:
|
|
249
249
|
- !ruby/object:Gem::Version
|
250
250
|
version: 2.3.0
|
251
251
|
- !ruby/object:Gem::Dependency
|
252
|
-
name:
|
252
|
+
name: libxml-ruby
|
253
253
|
requirement: !ruby/object:Gem::Requirement
|
254
254
|
requirements:
|
255
|
-
- -
|
255
|
+
- - '='
|
256
256
|
- !ruby/object:Gem::Version
|
257
|
-
version:
|
257
|
+
version: 4.1.1
|
258
258
|
type: :runtime
|
259
259
|
prerelease: false
|
260
260
|
version_requirements: !ruby/object:Gem::Requirement
|
261
261
|
requirements:
|
262
|
-
- -
|
262
|
+
- - '='
|
263
263
|
- !ruby/object:Gem::Version
|
264
|
-
version:
|
264
|
+
version: 4.1.1
|
265
265
|
- !ruby/object:Gem::Dependency
|
266
266
|
name: public_suffix
|
267
267
|
requirement: !ruby/object:Gem::Requirement
|
268
268
|
requirements:
|
269
269
|
- - '='
|
270
270
|
- !ruby/object:Gem::Version
|
271
|
-
version: 5.0.
|
271
|
+
version: 5.0.1
|
272
272
|
type: :runtime
|
273
273
|
prerelease: false
|
274
274
|
version_requirements: !ruby/object:Gem::Requirement
|
275
275
|
requirements:
|
276
276
|
- - '='
|
277
277
|
- !ruby/object:Gem::Version
|
278
|
-
version: 5.0.
|
278
|
+
version: 5.0.1
|
279
279
|
- !ruby/object:Gem::Dependency
|
280
280
|
name: rake
|
281
281
|
requirement: !ruby/object:Gem::Requirement
|
282
282
|
requirements:
|
283
283
|
- - "~>"
|
284
284
|
- !ruby/object:Gem::Version
|
285
|
-
version: 13.
|
285
|
+
version: 13.0.6
|
286
286
|
type: :runtime
|
287
287
|
prerelease: false
|
288
288
|
version_requirements: !ruby/object:Gem::Requirement
|
289
289
|
requirements:
|
290
290
|
- - "~>"
|
291
291
|
- !ruby/object:Gem::Version
|
292
|
-
version: 13.
|
292
|
+
version: 13.0.6
|
293
293
|
- !ruby/object:Gem::Dependency
|
294
294
|
name: slack-ruby-client
|
295
295
|
requirement: !ruby/object:Gem::Requirement
|
296
296
|
requirements:
|
297
297
|
- - "~>"
|
298
298
|
- !ruby/object:Gem::Version
|
299
|
-
version: 2.
|
299
|
+
version: 2.1.0
|
300
300
|
type: :runtime
|
301
301
|
prerelease: false
|
302
302
|
version_requirements: !ruby/object:Gem::Requirement
|
303
303
|
requirements:
|
304
304
|
- - "~>"
|
305
305
|
- !ruby/object:Gem::Version
|
306
|
-
version: 2.
|
306
|
+
version: 2.1.0
|
307
307
|
description: Ruby library for creating/maintaining your development environment
|
308
308
|
email: opensource@firespring.com
|
309
309
|
executables: []
|
@@ -327,10 +327,6 @@ files:
|
|
327
327
|
- lib/firespring_dev_commands/aws/parameter.rb
|
328
328
|
- lib/firespring_dev_commands/aws/profile.rb
|
329
329
|
- lib/firespring_dev_commands/aws/s3.rb
|
330
|
-
- lib/firespring_dev_commands/bloom_growth.rb
|
331
|
-
- lib/firespring_dev_commands/bloom_growth/rock.rb
|
332
|
-
- lib/firespring_dev_commands/bloom_growth/seat.rb
|
333
|
-
- lib/firespring_dev_commands/bloom_growth/user.rb
|
334
330
|
- lib/firespring_dev_commands/boolean.rb
|
335
331
|
- lib/firespring_dev_commands/common.rb
|
336
332
|
- lib/firespring_dev_commands/daterange.rb
|
@@ -403,9 +399,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
403
399
|
version: '3.1'
|
404
400
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
405
401
|
requirements:
|
406
|
-
- - "
|
402
|
+
- - ">"
|
407
403
|
- !ruby/object:Gem::Version
|
408
|
-
version:
|
404
|
+
version: 1.3.1
|
409
405
|
requirements: []
|
410
406
|
rubygems_version: 3.4.10
|
411
407
|
signing_key:
|
@@ -1,34 +0,0 @@
|
|
1
|
-
module Dev
|
2
|
-
class BloomGrowth
|
3
|
-
# Class containing rock information
|
4
|
-
class Rock
|
5
|
-
attr_accessor :data, :id, :type, :name, :owner, :complete, :completion_id, :created, :due
|
6
|
-
attr_reader :state
|
7
|
-
|
8
|
-
def initialize(data)
|
9
|
-
@data = data
|
10
|
-
@id = data['Id']
|
11
|
-
@type = data['Type']
|
12
|
-
@name = data['Name'].to_s.strip
|
13
|
-
@owner = User.new(data['Owner']) if data['Owner']
|
14
|
-
@complete = data['Complete']
|
15
|
-
@completion_id = data['Completion']
|
16
|
-
@created = Time.parse(data['CreateTime']) if data['CreateTime']
|
17
|
-
@due = Time.parse(data['DueDate']) if data['DueDate']
|
18
|
-
@archived = data['Archived']
|
19
|
-
end
|
20
|
-
|
21
|
-
# Convert the completion_id bloom growth gives us into a text version
|
22
|
-
def state
|
23
|
-
case completion_id
|
24
|
-
when 0
|
25
|
-
'Off Track'
|
26
|
-
when 1
|
27
|
-
'On Track'
|
28
|
-
when 2
|
29
|
-
'Complete'
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Dev
|
2
|
-
class BloomGrowth
|
3
|
-
# Class containing seat information
|
4
|
-
class Seat
|
5
|
-
attr_accessor :data, :id, :type, :name
|
6
|
-
|
7
|
-
def initialize(data)
|
8
|
-
@data = data
|
9
|
-
position = data.dig('Group', 'Position')
|
10
|
-
@id = position&.fetch('Id')
|
11
|
-
@type = position&.fetch('Type')
|
12
|
-
@name = position&.fetch('Name').to_s.strip
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
module Dev
|
2
|
-
class BloomGrowth
|
3
|
-
# Class containing user information
|
4
|
-
class User
|
5
|
-
attr_accessor :data, :id, :type, :name, :rocks, :direct_reports, :seats
|
6
|
-
|
7
|
-
def initialize(data)
|
8
|
-
@data = data
|
9
|
-
@id = data['Id']
|
10
|
-
@type = data['Type']
|
11
|
-
@name = data['Name'].to_s.strip
|
12
|
-
@rocks = nil
|
13
|
-
@direct_reports = nil
|
14
|
-
@seats = nil
|
15
|
-
end
|
16
|
-
|
17
|
-
def rocks
|
18
|
-
@rocks ||= [].tap do |ary|
|
19
|
-
Dev::BloomGrowth.new.get("/api/v1/rocks/user/#{id}") do |data|
|
20
|
-
ary << Rock.new(data)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def direct_reports
|
26
|
-
@direct_reports ||= [].tap do |ary|
|
27
|
-
Dev::BloomGrowth.new.get("/api/v1/users/#{id}/directreports") do |data|
|
28
|
-
ary << User.new(data)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def seats
|
34
|
-
@seats ||= [].tap do |ary|
|
35
|
-
Dev::BloomGrowth.new.get("/api/v1/users/#{id}/seats") do |data|
|
36
|
-
ary << Seat.new(data)
|
37
|
-
puts ary.last.inspect
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,132 +0,0 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
|
3
|
-
module Dev
|
4
|
-
# Class for interacting with the Bloom Growth api
|
5
|
-
class BloomGrowth
|
6
|
-
# The config file to try to load credentials from
|
7
|
-
CONFIG_FILE = "#{Dir.home}/.env.bloom".freeze
|
8
|
-
|
9
|
-
# The text of the username variable key
|
10
|
-
BLOOM_USERNAME = 'BLOOM_USERNAME'.freeze
|
11
|
-
|
12
|
-
# The text of the password variable key
|
13
|
-
BLOOM_PASSWORD = 'BLOOM_PASSWORD'.freeze
|
14
|
-
|
15
|
-
# The text of the token variable key
|
16
|
-
BLOOM_TOKEN = 'BLOOM_TOKEN'.freeze
|
17
|
-
|
18
|
-
# The text of the url variable key
|
19
|
-
BLOOM_URL = 'BLOOM_URL'.freeze
|
20
|
-
|
21
|
-
# Config object for setting top level bloom growth config options
|
22
|
-
Config = Struct.new(:username, :password, :url, :http_debug) do
|
23
|
-
def initialize
|
24
|
-
Dotenv.load(CONFIG_FILE) if File.exist?(CONFIG_FILE)
|
25
|
-
|
26
|
-
self.username = ENV.fetch(BLOOM_USERNAME, nil)
|
27
|
-
self.password = ENV.fetch(BLOOM_PASSWORD, nil)
|
28
|
-
self.url = ENV.fetch(BLOOM_URL, 'https://app.bloomgrowth.com')
|
29
|
-
self.http_debug = false
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
class << self
|
34
|
-
# Instantiates a new top level config object if one hasn't already been created
|
35
|
-
# Yields that config object to any given block
|
36
|
-
# Returns the resulting config object
|
37
|
-
def config
|
38
|
-
@config ||= Config.new
|
39
|
-
yield(@config) if block_given?
|
40
|
-
@config
|
41
|
-
end
|
42
|
-
|
43
|
-
# Alias the config method to configure for a slightly clearer access syntax
|
44
|
-
alias_method :configure, :config
|
45
|
-
end
|
46
|
-
|
47
|
-
attr_accessor :username, :password, :url, :token, :client, :default_headers
|
48
|
-
|
49
|
-
# Initialize a new target process client using the given inputs
|
50
|
-
def initialize(username: self.class.config.username, password: self.class.config.password, url: self.class.config.url)
|
51
|
-
raise 'username is required' if username.to_s.strip.empty?
|
52
|
-
raise 'password is required' if password.to_s.strip.empty?
|
53
|
-
raise 'url is required' if url.to_s.strip.empty?
|
54
|
-
|
55
|
-
@username = username
|
56
|
-
@password = password
|
57
|
-
@url = url
|
58
|
-
uri = URI.parse(@url)
|
59
|
-
@client = Net::HTTP.new(uri.host, uri.port)
|
60
|
-
@client.use_ssl = true
|
61
|
-
@client.verify_mode = OpenSSL::SSL::VERIFY_PEER
|
62
|
-
@client.set_debug_output(LOG) if self.class.config.http_debug
|
63
|
-
@default_headers = {
|
64
|
-
'authorization' => "Bearer #{token}",
|
65
|
-
'content-type' => 'application/json',
|
66
|
-
'accept' => 'application/json'
|
67
|
-
}
|
68
|
-
end
|
69
|
-
|
70
|
-
# Method for getting a bearer token for the bloom growth api. There are a couple of possible logic paths
|
71
|
-
# - If a token has already been defined, use it
|
72
|
-
# - If a token is found in the ENV, use it
|
73
|
-
# - Otherwise, use the username and passowrd that has been configured to request a new token from bloom
|
74
|
-
def token
|
75
|
-
@token ||= ENV.fetch(BLOOM_TOKEN, nil)
|
76
|
-
|
77
|
-
unless @token
|
78
|
-
response = post(
|
79
|
-
'/Token',
|
80
|
-
{
|
81
|
-
grant_type: 'password',
|
82
|
-
userName: username,
|
83
|
-
password:
|
84
|
-
},
|
85
|
-
headers: {
|
86
|
-
'content-type' => 'application/json',
|
87
|
-
'accept' => 'application/json'
|
88
|
-
}
|
89
|
-
)
|
90
|
-
# TODO: Should we look at https://github.com/DannyBen/lightly for caching the token?
|
91
|
-
@token = ENV[BLOOM_TOKEN] = response['access_token']
|
92
|
-
LOG.info("Retrieved BloomGrowth token. Expires on #{Time.now + response['expires_in']}")
|
93
|
-
end
|
94
|
-
|
95
|
-
@token
|
96
|
-
end
|
97
|
-
|
98
|
-
# Return all user objects visible to the logged in user
|
99
|
-
def visible_users(&)
|
100
|
-
[].tap do |ary|
|
101
|
-
get('/api/v1/users/mineviewable') do |user_data|
|
102
|
-
ary << User.new(user_data)
|
103
|
-
end
|
104
|
-
ary.each(&)
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
# Perform a get request to the given path using the given query
|
109
|
-
# Call the given block (if present) with each piece of data
|
110
|
-
# Return all pieces of data
|
111
|
-
def get(path, query_string: nil, headers: default_headers, &)
|
112
|
-
url = path
|
113
|
-
url << "?#{URI.encode_www_form(query_string)}" unless query_string.to_s.strip.empty?
|
114
|
-
|
115
|
-
response = client.request_get(url, headers)
|
116
|
-
raise "Error querying #{url} [#{query_string}]: #{response.inspect}" unless response.response.is_a?(Net::HTTPSuccess)
|
117
|
-
|
118
|
-
JSON.parse(response.body).each(&)
|
119
|
-
nil
|
120
|
-
end
|
121
|
-
|
122
|
-
# Perform a post request to the given path using the gien data
|
123
|
-
# Return the parsed json body
|
124
|
-
def post(path, data, headers: default_headers)
|
125
|
-
data = data.to_json unless data.is_a?(String)
|
126
|
-
response = client.request_post(path, data, headers)
|
127
|
-
raise "Error querying #{url}/#{path}: #{response.inspect}" unless response.response.is_a?(Net::HTTPSuccess)
|
128
|
-
|
129
|
-
JSON.parse(response.body)
|
130
|
-
end
|
131
|
-
end
|
132
|
-
end
|