firespring_dev_commands 2.1.32.pre.alpha.5 → 2.1.32

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: 79a1a2ae3dec85f284124b6b7148ada390d1b1761d051470a5c05157c22873ae
4
- data.tar.gz: d0754a57c361e5532e48ecf5025f38c7ee3e63f1ee67b8ed33cc80f542562d2d
3
+ metadata.gz: e53d630e0b731aace78af986b8c5a149f1a04c65d930c77648dc8ec66087235f
4
+ data.tar.gz: a4de9e8c734f739a781cbd0679fd4be9ba91145a3d79e80e3196f029250d78c0
5
5
  SHA512:
6
- metadata.gz: 90133369d6cb5eb63925f4b9e3223a7ca51cd8235ef8d945d9a12223fc5594ccb91faf4dcdf15d77e849e4b662a97e02a831e9bc338745c536c1d41110f7af17
7
- data.tar.gz: c4ee82f9c701470b1f2624b30c6d906155f269d9900a5742dc63fb1f33dec1c91b117e6cd1c48cbd9618e0dc74827741c0db19473942bd6134c52c62bdbbf500
6
+ metadata.gz: 16e91f3a71cb49f923b6eb85541d188a6e0ddc718c4c72ba3157ffbcf484dfae874631c99ac9d2c5a3d4e11154c7ff0822f2b35da39630d878e344841bf61581
7
+ data.tar.gz: 700b7b4734de54b66791892018b147ba93d48388112773bb1908c53d5555f9737c130a7c3cadfc632971a7b449da4f86ffbc995fe984882fbf39490a2edf6034
@@ -21,9 +21,10 @@ module Dev
21
21
  # Finished status
22
22
  FINISHED = :finished
23
23
 
24
- attr_accessor :client, :name, :template_filename, :parameters, :capabilities, :failure_behavior, :state
24
+ attr_accessor :client, :name, :template_filename, :parameters, :capabilities, :failure_behavior, :preserve_parameters_on_update, :state
25
25
 
26
- def initialize(name, template_filename, parameters: Dev::Aws::Cloudformation::Parameters.new, capabilities: [], failure_behavior: 'ROLLBACK')
26
+ def initialize(name, template_filename, parameters: Dev::Aws::Cloudformation::Parameters.new, capabilities: [], failure_behavior: 'ROLLBACK',
27
+ preserve_parameters_on_update: false)
27
28
  raise 'parameters must be an intsance of parameters' unless parameters.is_a?(Dev::Aws::Cloudformation::Parameters)
28
29
 
29
30
  @client = nil
@@ -32,6 +33,7 @@ module Dev
32
33
  @parameters = parameters
33
34
  @capabilities = capabilities
34
35
  @failure_behavior = failure_behavior
36
+ @preserve_parameters_on_update = preserve_parameters_on_update
35
37
  @state = NOT_STARTED
36
38
  end
37
39
 
@@ -81,11 +83,16 @@ module Dev
81
83
  # Call upload function to get the s3 url
82
84
  template_url = upload(template_filename)
83
85
 
86
+ update_parameters = if preserve_parameters_on_update
87
+ parameters.preserve
88
+ else
89
+ parameters.default
90
+ end
84
91
  # Update the cloudformation stack
85
92
  client.update_stack(
86
93
  stack_name: name,
87
94
  template_url:,
88
- parameters: parameters.preserve,
95
+ parameters: update_parameters,
89
96
  capabilities:
90
97
  )
91
98
  @state = STARTED
@@ -2,7 +2,7 @@ module Dev
2
2
  class Aws
3
3
  # Class for performing Route53 functions
4
4
  class Route53
5
- attr_reader :client, :zones, :domains
5
+ attr_reader :client
6
6
 
7
7
  def initialize(domains)
8
8
  @client = ::Aws::Route53::Client.new
@@ -24,7 +24,7 @@ module Dev
24
24
  def parse_time(string)
25
25
  return nil unless string && !string.empty?
26
26
 
27
- Time.at(string.slice(6, 10).to_i)
27
+ ::Time.at(string.slice(6, 10).to_i)
28
28
  end
29
29
  end
30
30
  end
@@ -24,7 +24,7 @@ module Dev
24
24
  def parse_time(string)
25
25
  return nil unless string && !string.empty?
26
26
 
27
- Time.at(string.slice(6, 10).to_i)
27
+ ::Time.at(string.slice(6, 10).to_i)
28
28
  end
29
29
 
30
30
  # Calculate the cycle time as the amount of time the story was open
@@ -0,0 +1,32 @@
1
+ module Dev
2
+ class TargetProcess
3
+ # The class to query time information from Target Process
4
+ class Time
5
+ # The resource type for the api endpoint
6
+ RESOURCE_TYPE = 'Time'.freeze
7
+
8
+ # The api path for time requests
9
+ PATH = '/Time'.freeze
10
+
11
+ attr_accessor :data, :id, :type, :description, :hours, :date, :story, :user
12
+
13
+ def initialize(data)
14
+ @data = data
15
+ @id = data['Id']
16
+ @type = data['ResourceType']
17
+ @description = data['Description']
18
+ @hours = data['Spent']
19
+ @date = parse_time(data['Date'])
20
+ @story = UserStory.new(data['Assignable']) if data['Assignable']
21
+ @user = User.new(data['User']) if data['User']
22
+ end
23
+
24
+ # Parse the dot net time representation into something that ruby can use
25
+ def parse_time(string)
26
+ return nil unless string && !string.empty?
27
+
28
+ ::Time.at(string.slice(6, 10).to_i)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -2,7 +2,13 @@ module Dev
2
2
  class TargetProcess
3
3
  # Class containing user information
4
4
  class User
5
- attr_accessor :data, :id, :type, :name, :login
5
+ # The resource type for the api endpoint
6
+ RESOURCE_TYPE = 'User'.freeze
7
+
8
+ # The api path for user requests
9
+ PATH = '/User'.freeze
10
+
11
+ attr_accessor :data, :id, :type, :name, :login, :email
6
12
 
7
13
  def initialize(data)
8
14
  @data = data
@@ -10,6 +16,12 @@ module Dev
10
16
  @type = data['ResourceType']
11
17
  @name = data['FullName']
12
18
  @login = data['Login']
19
+ @email = data['Email']
20
+ end
21
+
22
+ # Get the user with the given id and return that object
23
+ def self.get(id)
24
+ new(TargetProcess.new.get("#{User::PATH}/#{id}", Query.new))
13
25
  end
14
26
  end
15
27
  end
@@ -37,7 +37,7 @@ module Dev
37
37
  def parse_time(string)
38
38
  return nil unless string && !string.empty?
39
39
 
40
- Time.at(string.slice(6, 10).to_i)
40
+ ::Time.at(string.slice(6, 10).to_i)
41
41
  end
42
42
 
43
43
  # Calculate the cycle time as the amount of time the story was open
@@ -38,7 +38,7 @@ module Dev
38
38
  def parse_time(string)
39
39
  return nil unless string && !string.empty?
40
40
 
41
- Time.at(string.slice(6, 10).to_i)
41
+ ::Time.at(string.slice(6, 10).to_i)
42
42
  end
43
43
  end
44
44
  end
@@ -72,8 +72,8 @@ module Dev
72
72
  [].tap do |ary|
73
73
  get(Release::PATH, query) do |result|
74
74
  ary << Release.new(result)
75
+ yield ary.last if block_given?
75
76
  end
76
- ary.each(&)
77
77
  end
78
78
  end
79
79
 
@@ -84,8 +84,8 @@ module Dev
84
84
  [].tap do |ary|
85
85
  get(UserStory::PATH, query) do |result|
86
86
  ary << UserStory.new(result)
87
+ yield ary.last if block_given?
87
88
  end
88
- ary.each(&)
89
89
  end
90
90
  end
91
91
 
@@ -96,8 +96,8 @@ module Dev
96
96
  [].tap do |ary|
97
97
  get(UserStoryHistory::PATH, query) do |result|
98
98
  ary << UserStoryHistory.new(result)
99
+ yield ary.last if block_given?
99
100
  end
100
- ary.each(&)
101
101
  end
102
102
  end
103
103
 
@@ -108,8 +108,20 @@ module Dev
108
108
  [].tap do |ary|
109
109
  get(TeamAssignment::PATH, query) do |result|
110
110
  ary << TeamAssignment.new(result)
111
+ yield ary.last if block_given?
112
+ end
113
+ end
114
+ end
115
+
116
+ # Perform a query to the time api path
117
+ # Call the given block (if present) with each time
118
+ # Return all times
119
+ def times(query, &)
120
+ [].tap do |ary|
121
+ get(Time::PATH, query) do |result|
122
+ ary << Time.new(result)
123
+ yield ary.last if block_given?
111
124
  end
112
- ary.each(&)
113
125
  end
114
126
  end
115
127
 
@@ -132,8 +144,11 @@ module Dev
132
144
  parsed_response['Items'].each(&)
133
145
 
134
146
  while parsed_response['Next']
135
- response = client.request_get(parsed_response['Next'], headers)
136
- raise "Error querying #{parsed_response['Next']} [#{query_string}]: #{response.inspect}" unless response.response.is_a?(Net::HTTPSuccess)
147
+ next_query_string = URI(parsed_response['Next']).query
148
+ next_url = "/api/v1/#{path}"
149
+ next_url << "?#{next_query_string}" unless query_string.empty?
150
+ response = client.request_get(next_url, headers)
151
+ raise "Error querying #{next_url} [#{next_query_string}]: #{response.inspect}" unless response.response.is_a?(Net::HTTPSuccess)
137
152
 
138
153
  parsed_response = JSON.parse(response.body)
139
154
  return parsed_response unless parsed_response.key?('Items')
@@ -6,6 +6,6 @@ module Dev
6
6
  # Use 'v.v.v.pre.alpha.v' for pre-release vesions
7
7
  # Use 'v.v.v.beta.v for beta versions
8
8
  # Use semantic versioning for any releases (https://semver.org/)
9
- VERSION = '2.1.32.pre.alpha.5'.freeze
9
+ VERSION = '2.1.32'.freeze
10
10
  end
11
11
  end
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.32.pre.alpha.5
4
+ version: 2.1.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-30 00:00:00.000000000 Z
11
+ date: 2024-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -395,6 +395,7 @@ files:
395
395
  - lib/firespring_dev_commands/target_process/release.rb
396
396
  - lib/firespring_dev_commands/target_process/team.rb
397
397
  - lib/firespring_dev_commands/target_process/team_assignment.rb
398
+ - lib/firespring_dev_commands/target_process/time.rb
398
399
  - lib/firespring_dev_commands/target_process/user.rb
399
400
  - lib/firespring_dev_commands/target_process/user_story.rb
400
401
  - lib/firespring_dev_commands/target_process/user_story_history.rb
@@ -428,9 +429,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
428
429
  version: '3.1'
429
430
  required_rubygems_version: !ruby/object:Gem::Requirement
430
431
  requirements:
431
- - - ">"
432
+ - - ">="
432
433
  - !ruby/object:Gem::Version
433
- version: 1.3.1
434
+ version: '0'
434
435
  requirements: []
435
436
  rubygems_version: 3.4.10
436
437
  signing_key: