firespring_dev_commands 2.1.10 → 2.1.11.pre.alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 454eca01ee701343196392ecd9a040508e72c5f40129140d2630b8da4162b5fc
4
- data.tar.gz: 709aef47b600f8abf81b95799c60b368c76f08a54010e5932458b70c04b54c4f
3
+ metadata.gz: fc8f0bc322b7f4a223de4a702efbf2a9d5018c35393e705c9ced4c144f646b77
4
+ data.tar.gz: f6ac473e759540fc0432e37e6a899cfa6628b07d38506e4d27223b395aaa7beb
5
5
  SHA512:
6
- metadata.gz: 0afc7e3e304edc242949542f19014c7e6c77e9d7e927df53e6db5ba865fcb451d517347f68da4c2ef9bef40623d82cb2e8b0a38ea41bc0a8485c9548077b26c1
7
- data.tar.gz: 63f75b79835f081f92e05d124e34014d0cd9a7c871a95f262e51f7ece898c730efa93c4bade621a7344e0d89b323870f6020b7b531ad2c4c9f6369aef42793b4
6
+ metadata.gz: c8913c2462bc151d46b53e8b70d1ef6ff0718a5713b206975f891a21560c262485c41253ca4b6780540d1d25b732687f4ff1b826771f2cea4c6815b41b5b8292
7
+ data.tar.gz: 50f74eba4f799fac640a6b82e2b463a9c91248a80ac2b6c9356e75259aabbeac83caa93ab82258697fa77f456b8ef8ae9778f4c188ae2c09318245c76e97f755
@@ -83,6 +83,11 @@ module Dev
83
83
  self << "(EndDate lt '#{end_date}')" if end_date
84
84
  end
85
85
 
86
+ def filter_date_between(start_date, end_date)
87
+ self << "(Date gte '#{start_date}')" if start_date
88
+ self << "(Date lt '#{end_date}')" if end_date
89
+ end
90
+
86
91
  # Add a filter that looks for stories which do not have a linked test plan
87
92
  def filter_by_missing_tests
88
93
  self << '(LinkedTestPlan is nil)'
@@ -100,6 +105,11 @@ module Dev
100
105
  def filter_by_entity_ids(entity_ids)
101
106
  self << "(Assignable.Id in ('#{entity_ids.join("', '")}'))" unless entity_ids.nil? || entity_ids.empty?
102
107
  end
108
+
109
+ def filter_by_deploy_date(start_date, end_date = nil)
110
+ self << "('CustomFields.Deploy Date' gt '#{start_date}')" if start_date
111
+ self << "('CustomFields.Deploy Date' lt '#{end_date}')" if end_date
112
+ end
103
113
  end
104
114
  end
105
115
  end
@@ -2,12 +2,28 @@ module Dev
2
2
  class TargetProcess
3
3
  # Class containing release information
4
4
  class Release
5
- attr_accessor :id, :type, :name
5
+ # The resource type for the api endpoint
6
+ RESOURCE_TYPE = 'Release'.freeze
7
+
8
+ # The api path for release requests
9
+ PATH = '/Releases'.freeze
10
+
11
+ attr_accessor :id, :type, :name, :start_date, :end_date, :custom_fields
6
12
 
7
13
  def initialize(data)
8
14
  @id = data['Id']
9
15
  @type = data['ResourceType']
10
16
  @name = data['Name']
17
+ @start_date = parse_time(data['StartDate'])
18
+ @end_date = parse_time(data['EndDate'])
19
+ @custom_fields = data['CustomFields']
20
+ end
21
+
22
+ # Parse the dot net time representation into something that ruby can use
23
+ def parse_time(string)
24
+ return nil unless string && !string.empty?
25
+
26
+ Time.at(string.slice(6, 10).to_i)
11
27
  end
12
28
  end
13
29
  end
@@ -0,0 +1,45 @@
1
+ module Dev
2
+ class TargetProcess
3
+ # Class containing user story information
4
+ class UserStoryHistory
5
+ # The resource type for the api endpoint
6
+ RESOURCE_TYPE = 'UserStoryHistory'.freeze
7
+
8
+ # The api path for user story requests
9
+ PATH = '/UserStoryHistories'.freeze
10
+
11
+ attr_accessor :type, :id, :source_entity_id, :name, :description, :start_date, :end_date, :create_date, :modify_date, :tags, :effort, :time_spent,
12
+ :last_state_change_date, :project, :owner, :creator, :release, :team, :priority, :state, :original_data
13
+
14
+ def initialize(data)
15
+ @id = data['Id']
16
+ @source_entity_id = data['SourceEntityId']
17
+ @type = data['ResourceType']
18
+ @name = data['Name']
19
+ @description = data['Description']
20
+ @state = data['EntityState']['Name'] if data['EntityState']
21
+ @project = Project.new(data['Project']) if data['Project']
22
+ @owner = User.new(data['Owner']) if data['Owner']
23
+ @creator = User.new(data['Creator']) if data['Creator']
24
+ @release = Release.new(data['Release']) if data['Release']
25
+ @team = Team.new(data['Team']) if data['Team']
26
+ @start_date = parse_time(data['StartDate'])
27
+ @end_date = parse_time(data['EndDate'])
28
+ @create_date = parse_time(data['CreateDate'])
29
+ @modify_date = parse_time(data['ModifyDate'])
30
+ @tags = data['Tags']
31
+ @effort = data['Effort']
32
+ @time_spent = data['TimeSpent']
33
+ @last_state_change_date = parse_time(data['LastStateChangeDate'])
34
+ @original_data = original_data
35
+ end
36
+
37
+ # Parse the dot net time representation into something that ruby can use
38
+ def parse_time(string)
39
+ return nil unless string && !string.empty?
40
+
41
+ Time.at(string.slice(6, 10).to_i)
42
+ end
43
+ end
44
+ end
45
+ end
@@ -45,6 +45,10 @@ module Dev
45
45
 
46
46
  # Initialize a new target process client using the given inputs
47
47
  def initialize(username: self.class.config.username, password: self.class.config.password, url: self.class.config.url)
48
+ raise 'username is required' if username.to_s.strip.empty?
49
+ raise 'password is required' if password.to_s.strip.empty?
50
+ raise 'url is required' if url.to_s.strip.empty?
51
+
48
52
  @username = username
49
53
  @password = password
50
54
  @auth = Base64.strict_encode64("#{@username}:#{@password}")
@@ -61,6 +65,18 @@ module Dev
61
65
  }
62
66
  end
63
67
 
68
+ # Perform a query to the release api path
69
+ # Call the given block (if present) with each release
70
+ # Return all releases
71
+ def releases(query, &)
72
+ [].tap do |ary|
73
+ get(Release::PATH, query) do |result|
74
+ ary << Release.new(result)
75
+ end
76
+ ary.each(&)
77
+ end
78
+ end
79
+
64
80
  # Perform a query to the user story api path
65
81
  # Call the given block (if present) with each user story
66
82
  # Return all user stories
@@ -73,6 +89,18 @@ module Dev
73
89
  end
74
90
  end
75
91
 
92
+ # Perform a query to the user story history api path
93
+ # Call the given block (if present) with each user story history
94
+ # Return all user stories
95
+ def user_story_histories(query, &)
96
+ [].tap do |ary|
97
+ get(UserStoryHistory::PATH, query) do |result|
98
+ ary << UserStoryHistory.new(result)
99
+ end
100
+ ary.each(&)
101
+ end
102
+ end
103
+
76
104
  # Perform a query to the team assignments api path
77
105
  # Call the given block (if present) with each team assignment
78
106
  # Return all team assignments
@@ -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.10'.freeze
9
+ VERSION = '2.1.11.pre.alpha.2'.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.10
4
+ version: 2.1.11.pre.alpha.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-30 00:00:00.000000000 Z
11
+ date: 2023-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -313,6 +313,7 @@ files:
313
313
  - lib/firespring_dev_commands/target_process/team_assignment.rb
314
314
  - lib/firespring_dev_commands/target_process/user.rb
315
315
  - lib/firespring_dev_commands/target_process/user_story.rb
316
+ - lib/firespring_dev_commands/target_process/user_story_history.rb
316
317
  - lib/firespring_dev_commands/templates/aws.rb
317
318
  - lib/firespring_dev_commands/templates/base_interface.rb
318
319
  - lib/firespring_dev_commands/templates/ci.rb
@@ -341,9 +342,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
341
342
  version: '3.1'
342
343
  required_rubygems_version: !ruby/object:Gem::Requirement
343
344
  requirements:
344
- - - ">="
345
+ - - ">"
345
346
  - !ruby/object:Gem::Version
346
- version: '0'
347
+ version: 1.3.1
347
348
  requirements: []
348
349
  rubygems_version: 3.4.10
349
350
  signing_key: