firespring_dev_commands 2.1.10.pre.alpha.3 → 2.1.10.pre.alpha.4

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: 3eebfafcc2e64ee029e9ec478bf7d3ab53167f024eafdd581458cda045927587
4
- data.tar.gz: 71c135fe88993700199eede29e0ac56fb66735cd4511536d289bb686c5dbbb56
3
+ metadata.gz: 52dbe9d1eca34f2c4fd17091e276936d72331cc76c74f8a8ef91913fcbd5c045
4
+ data.tar.gz: d43ea562ec24047cb2823b838f5ec0f8a8b4baf64f6fbf7b50a3cbae6bbe6812
5
5
  SHA512:
6
- metadata.gz: 7fb3b21aee7a97d1c39dcb0a7837f5494d154d5be63f3851cdfd5a3751a36c165d4e617cc1771f53d45c5a7e0bdc9ee92f3c7ea6a29087c40959b71990c3616d
7
- data.tar.gz: 537f2e499353e108a7ebaa8b97f40b69dc883978625ff779a2769e71e1a640ffa300ebe926a2d383e8749834cdc42b15c4434b073085c0309fdc6158f0842c3c
6
+ metadata.gz: 233a5b1828fc69777ceefba80d6c428e35bf96fcfad0061ba79f2a2645a955076c979bb98ab3882b193db35f6a401d0aaa733ffa9fc4151bdd3f83f1d2403f11
7
+ data.tar.gz: 705ffd119c0ad4b25efe65353feb6e763da62527d485d562f029d3796395e481fd2e7af84ae3b2432bf35c94b9791738c4b9f6e8ca2035714388d77ccbe4c314
@@ -52,6 +52,10 @@ module Dev
52
52
  self << "(Id in ('#{user_story_ids.join("', '")}'))"
53
53
  end
54
54
 
55
+ def filter_by_team_ids(team_ids)
56
+ self << "(Team.Id in ('#{team_ids.join("', '")}'))" unless team_ids.nil? || team_ids.empty?
57
+ end
58
+
55
59
  # Add a filter that looks for stories whose project id is contained in the list of ids given
56
60
  def filter_by_project(projects)
57
61
  self << "(Project.Name in ('#{projects.join("', '")}'))"
@@ -67,9 +71,14 @@ module Dev
67
71
  self << "(EntityState.IsFinal eq 'true')"
68
72
  end
69
73
 
74
+ def filter_start_date_between(start_date, end_date)
75
+ self << "(StartDate gte '#{start_date}')" if start_date
76
+ self << "(StartDate lt '#{end_date}')" if end_date
77
+ end
78
+
70
79
  # 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
80
+ def filter_end_date_between(start_date, end_date)
81
+ self << "(EndDate gte '#{start_date}')" if start_date
73
82
  self << "(EndDate lt '#{end_date}')" if end_date
74
83
  end
75
84
 
@@ -77,6 +86,19 @@ module Dev
77
86
  def filter_by_missing_tests
78
87
  self << '(LinkedTestPlan is nil)'
79
88
  end
89
+
90
+ def filter_by_started_not_finished
91
+ self << '(StartDate is not nil)'
92
+ self << '(EndDate is nil)'
93
+ end
94
+
95
+ def filter_by_entity_type(entity_type)
96
+ self << "(Assignable.EntityType.Name eq '#{entity_type}')" unless entity_type.nil?
97
+ end
98
+
99
+ def filter_by_entity_ids(entity_ids)
100
+ self << "(Assignable.Id in ('#{entity_ids.join("', '")}'))" unless entity_ids.nil? || entity_ids.empty?
101
+ end
80
102
  end
81
103
  end
82
104
  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 = 'TeamAssignments'.freeze
7
+
8
+ # The api path for team assignment requests
9
+ PATH = "/#{RESOURCE_TYPE}".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,8 +2,11 @@ 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 = 'UserStories'.freeze
7
+
5
8
  # The api path for user story requests
6
- PATH = '/UserStories'.freeze
9
+ PATH = "/#{RESOURCE_TYPE}".freeze
7
10
 
8
11
  attr_accessor :type, :id, :name, :description, :start_date, :end_date, :create_date, :modify_date, :tags, :effort, :time_spent, :last_state_change_date, :project,
9
12
  :owner, :creator, :release, :team, :priority, :state, :original_data
@@ -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.4'.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.4
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