firespring_dev_commands 2.1.10.pre.alpha.3 → 2.1.10.pre.alpha.5

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: 3eebfafcc2e64ee029e9ec478bf7d3ab53167f024eafdd581458cda045927587
4
- data.tar.gz: 71c135fe88993700199eede29e0ac56fb66735cd4511536d289bb686c5dbbb56
3
+ metadata.gz: 62baa06722c11abd6dbeda93dc863b50c14baac098fb11e2842b499151bfada1
4
+ data.tar.gz: 6bc8fa52af979ffde25719a3fb0f03ff239cd2965305d78bd6de06e728e94e8f
5
5
  SHA512:
6
- metadata.gz: 7fb3b21aee7a97d1c39dcb0a7837f5494d154d5be63f3851cdfd5a3751a36c165d4e617cc1771f53d45c5a7e0bdc9ee92f3c7ea6a29087c40959b71990c3616d
7
- data.tar.gz: 537f2e499353e108a7ebaa8b97f40b69dc883978625ff779a2769e71e1a640ffa300ebe926a2d383e8749834cdc42b15c4434b073085c0309fdc6158f0842c3c
6
+ metadata.gz: dfcf275ea624bb24805b81f699b4fc017be7313e860e92d4a6f9f637ffc5a77ff439223a9065f45e46bd286a0cada69d298bdb923631d674b509ae9c2c11e788
7
+ data.tar.gz: 217ec1203111108634a4cbbba2708b7b9ec736e3bff9a8a352d7539054f2b9530783f9ba497b0436b755366931e59120a60abca8d03417868580430bea5abaaf
@@ -47,11 +47,16 @@ module Dev
47
47
  generate
48
48
  end
49
49
 
50
+ # TODO: Do these need moved to their associated entities?
50
51
  # Add a filter that looks for stories whose id is contained in the list of ids given
51
52
  def filter_by_user_story_ids(user_story_ids)
52
53
  self << "(Id in ('#{user_story_ids.join("', '")}'))"
53
54
  end
54
55
 
56
+ def filter_by_team_ids(team_ids)
57
+ self << "(Team.Id in ('#{team_ids.join("', '")}'))" unless team_ids.nil? || team_ids.empty?
58
+ end
59
+
55
60
  # Add a filter that looks for stories whose project id is contained in the list of ids given
56
61
  def filter_by_project(projects)
57
62
  self << "(Project.Name in ('#{projects.join("', '")}'))"
@@ -67,9 +72,14 @@ module Dev
67
72
  self << "(EntityState.IsFinal eq 'true')"
68
73
  end
69
74
 
75
+ def filter_start_date_between(start_date, end_date)
76
+ self << "(StartDate gte '#{start_date}')" if start_date
77
+ self << "(StartDate lt '#{end_date}')" if end_date
78
+ end
79
+
70
80
  # Add a filter that looks for stories whose end date is between the given dates
71
- def filter_by_end_dates(start_date, end_date)
72
- self << "(EndDate gt '#{start_date}')" if start_date
81
+ def filter_end_date_between(start_date, end_date)
82
+ self << "(EndDate gte '#{start_date}')" if start_date
73
83
  self << "(EndDate lt '#{end_date}')" if end_date
74
84
  end
75
85
 
@@ -77,6 +87,19 @@ module Dev
77
87
  def filter_by_missing_tests
78
88
  self << '(LinkedTestPlan is nil)'
79
89
  end
90
+
91
+ def filter_by_started_not_finished
92
+ self << '(StartDate is not nil)'
93
+ self << '(EndDate is nil)'
94
+ end
95
+
96
+ def filter_by_entity_type(entity_type)
97
+ self << "(Assignable.EntityType.Name eq '#{entity_type}')" unless entity_type.nil?
98
+ end
99
+
100
+ def filter_by_entity_ids(entity_ids)
101
+ self << "(Assignable.Id in ('#{entity_ids.join("', '")}'))" unless entity_ids.nil? || entity_ids.empty?
102
+ end
80
103
  end
81
104
  end
82
105
  end
@@ -0,0 +1,37 @@
1
+ module Dev
2
+ class TargetProcess
3
+ # Class containing project information
4
+ class TeamAssignment
5
+ # The resource type for the api endpoint
6
+ RESOURCE_TYPE = 'TeamAssignment'.freeze
7
+
8
+ # The api path for team assignment requests
9
+ PATH = '/TeamAssignments'.freeze
10
+
11
+ attr_accessor :id, :type, :start_date, :end_date, :team, :story
12
+
13
+ def initialize(data)
14
+ @id = data['Id']
15
+ @type = data['ResourceType']
16
+ @start_date = parse_time(data['StartDate'])
17
+ @end_date = parse_time(data['EndDate'])
18
+ @team = Team.new(data['Team']) if data['Team']
19
+ @story = UserStory.new(data['Assignable']) if data['Assignable']
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)
27
+ end
28
+
29
+ # Calculate the cycle time as the amount of time the story was open
30
+ def cycle_time
31
+ return 1.0 unless start_date && end_date
32
+
33
+ (end_date - start_date).to_f / (60 * 60 * 24)
34
+ end
35
+ end
36
+ end
37
+ end
@@ -2,6 +2,9 @@ module Dev
2
2
  class TargetProcess
3
3
  # Class containing user story information
4
4
  class UserStory
5
+ # The resource type for the api endpoint
6
+ RESOURCE_TYPE = 'UserStory'.freeze
7
+
5
8
  # The api path for user story requests
6
9
  PATH = '/UserStories'.freeze
7
10
 
@@ -13,7 +16,7 @@ module Dev
13
16
  @type = data['ResourceType']
14
17
  @name = data['Name']
15
18
  @description = data['Description']
16
- @state = data['EntityState']['Name']
19
+ @state = data['EntityState']['Name'] if data['EntityState']
17
20
  @project = Project.new(data['Project']) if data['Project']
18
21
  @owner = User.new(data['Owner']) if data['Owner']
19
22
  @creator = User.new(data['Creator']) if data['Creator']
@@ -73,6 +73,18 @@ module Dev
73
73
  end
74
74
  end
75
75
 
76
+ # Perform a query to the team assignments api path
77
+ # Call the given block (if present) with each team assignment
78
+ # Return all team assignments
79
+ def team_assignments(query, &)
80
+ [].tap do |ary|
81
+ get(TeamAssignment::PATH, query) do |result|
82
+ ary << TeamAssignment.new(result)
83
+ end
84
+ ary.each(&)
85
+ end
86
+ end
87
+
76
88
  # Perform a get request to the given path using the given query
77
89
  # Call the given block (if present) with each piece of data
78
90
  # Return all pieces of data
@@ -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.pre.alpha.3'.freeze
9
+ VERSION = '2.1.10.pre.alpha.5'.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.pre.alpha.3
4
+ version: 2.1.10.pre.alpha.5
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-25 00:00:00.000000000 Z
11
+ date: 2023-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -310,6 +310,7 @@ files:
310
310
  - lib/firespring_dev_commands/target_process/query.rb
311
311
  - lib/firespring_dev_commands/target_process/release.rb
312
312
  - lib/firespring_dev_commands/target_process/team.rb
313
+ - lib/firespring_dev_commands/target_process/team_assignment.rb
313
314
  - lib/firespring_dev_commands/target_process/user.rb
314
315
  - lib/firespring_dev_commands/target_process/user_story.rb
315
316
  - lib/firespring_dev_commands/templates/aws.rb