firespring_dev_commands 2.1.14.pre.alpha.1 → 2.1.14.pre.alpha.2
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/target_process/project.rb +2 -1
- data/lib/firespring_dev_commands/target_process/query.rb +5 -0
- data/lib/firespring_dev_commands/target_process/release.rb +2 -1
- data/lib/firespring_dev_commands/target_process/team.rb +2 -1
- data/lib/firespring_dev_commands/target_process/team_assignment.rb +2 -1
- data/lib/firespring_dev_commands/target_process/user.rb +2 -1
- data/lib/firespring_dev_commands/target_process/user_story.rb +15 -3
- data/lib/firespring_dev_commands/target_process/user_story_history.rb +3 -3
- data/lib/firespring_dev_commands/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c8429522137dc821f95c40908bc0ca8511b661e36ea0217bca59c2341bdc745
|
4
|
+
data.tar.gz: b247f082879d7bf5d67a3edf5a4bbd29894c074942244a0d0c3fe42837c37016
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 481ec33a976f08c936668ed0e7bfc98151d5493a163a591d31c4a223906f3e78a93373d10c95b377800666e435cd8244f7de921061b516c8db6b5db9bf9c1b94
|
7
|
+
data.tar.gz: 148109367568c57919dedba2469d3e8a8d08332cecc27c7cb80bc58e730e353bce3482aec35aa7acb2e94da3b922f14ea4fdddf5a386e7909fa5f639ae0aa84c
|
@@ -2,9 +2,10 @@ module Dev
|
|
2
2
|
class TargetProcess
|
3
3
|
# Class containing project information
|
4
4
|
class Project
|
5
|
-
attr_accessor :id, :type, :name
|
5
|
+
attr_accessor :date, :id, :type, :name
|
6
6
|
|
7
7
|
def initialize(data)
|
8
|
+
@data = data
|
8
9
|
@id = data['Id']
|
9
10
|
@type = data['ResourceType']
|
10
11
|
@name = data['Name']
|
@@ -107,6 +107,11 @@ module Dev
|
|
107
107
|
self << "(Assignable.EntityType.Name eq '#{entity_type}')" unless entity_type.nil?
|
108
108
|
end
|
109
109
|
|
110
|
+
# Add a filter that looks for assignable id that match the given id
|
111
|
+
def filter_by_entity_id(entity_id)
|
112
|
+
self << "(Assignable.Id eq '#{entity_id}')" unless entity_id.nil?
|
113
|
+
end
|
114
|
+
|
110
115
|
# Add a filter that looks for assignable ids which are included in the given array
|
111
116
|
def filter_by_entity_ids(entity_ids)
|
112
117
|
self << "(Assignable.Id in ('#{entity_ids.join("', '")}'))" unless entity_ids.nil? || entity_ids.empty?
|
@@ -8,9 +8,10 @@ module Dev
|
|
8
8
|
# The api path for release requests
|
9
9
|
PATH = '/Releases'.freeze
|
10
10
|
|
11
|
-
attr_accessor :id, :type, :name, :start_date, :end_date, :custom_fields
|
11
|
+
attr_accessor :data, :id, :type, :name, :start_date, :end_date, :custom_fields
|
12
12
|
|
13
13
|
def initialize(data)
|
14
|
+
@data = data
|
14
15
|
@id = data['Id']
|
15
16
|
@type = data['ResourceType']
|
16
17
|
@name = data['Name']
|
@@ -2,9 +2,10 @@ module Dev
|
|
2
2
|
class TargetProcess
|
3
3
|
# Class containing team information
|
4
4
|
class Team
|
5
|
-
attr_accessor :id, :type, :name
|
5
|
+
attr_accessor :data, :id, :type, :name
|
6
6
|
|
7
7
|
def initialize(data)
|
8
|
+
@data = data
|
8
9
|
@id = data['Id']
|
9
10
|
@type = data['ResourceType']
|
10
11
|
@name = data['Name']
|
@@ -8,9 +8,10 @@ module Dev
|
|
8
8
|
# The api path for team assignment requests
|
9
9
|
PATH = '/TeamAssignments'.freeze
|
10
10
|
|
11
|
-
attr_accessor :id, :type, :start_date, :end_date, :team, :story
|
11
|
+
attr_accessor :data, :id, :type, :start_date, :end_date, :team, :story
|
12
12
|
|
13
13
|
def initialize(data)
|
14
|
+
@data = data
|
14
15
|
@id = data['Id']
|
15
16
|
@type = data['ResourceType']
|
16
17
|
@start_date = parse_time(data['StartDate'])
|
@@ -2,9 +2,10 @@ module Dev
|
|
2
2
|
class TargetProcess
|
3
3
|
# Class containing user information
|
4
4
|
class User
|
5
|
-
attr_accessor :id, :type, :name, :login
|
5
|
+
attr_accessor :data, :id, :type, :name, :login
|
6
6
|
|
7
7
|
def initialize(data)
|
8
|
+
@data = data
|
8
9
|
@id = data['Id']
|
9
10
|
@type = data['ResourceType']
|
10
11
|
@name = data['FullName']
|
@@ -8,10 +8,11 @@ module Dev
|
|
8
8
|
# The api path for user story requests
|
9
9
|
PATH = '/UserStories'.freeze
|
10
10
|
|
11
|
-
attr_accessor :type, :id, :name, :description, :start_date, :end_date, :create_date, :modify_date, :tags, :effort, :time_spent, :last_state_change_date,
|
12
|
-
:owner, :creator, :release, :team, :priority, :state
|
11
|
+
attr_accessor :data, :type, :id, :name, :description, :start_date, :end_date, :create_date, :modify_date, :tags, :effort, :time_spent, :last_state_change_date,
|
12
|
+
:project, :owner, :creator, :release, :team, :priority, :state
|
13
13
|
|
14
14
|
def initialize(data)
|
15
|
+
@data = data
|
15
16
|
@id = data['Id']
|
16
17
|
@type = data['ResourceType']
|
17
18
|
@name = data['Name']
|
@@ -30,7 +31,6 @@ module Dev
|
|
30
31
|
@effort = data['Effort']
|
31
32
|
@time_spent = data['TimeSpent']
|
32
33
|
@last_state_change_date = parse_time(data['LastStateChangeDate'])
|
33
|
-
@original_data = original_data
|
34
34
|
end
|
35
35
|
|
36
36
|
# Parse the dot net time representation into something that ruby can use
|
@@ -46,6 +46,18 @@ module Dev
|
|
46
46
|
|
47
47
|
(end_date - start_date).to_f / (60 * 60 * 24)
|
48
48
|
end
|
49
|
+
|
50
|
+
# Returns the time the team was responsible for the issue was
|
51
|
+
def team_cycle_time(team_ids)
|
52
|
+
# Calculate the difference and convert to days
|
53
|
+
finished_dev_query = Dev::TargetProcess::Query.new
|
54
|
+
finished_dev_query.filter_by_team_ids(team_ids)
|
55
|
+
finished_dev_query.filter_end_date_between(start_date, end_date)
|
56
|
+
finished_dev_query.filter_by_entity_type(Dev::TargetProcess::UserStory::RESOURCE_TYPE)
|
57
|
+
finished_dev_query.filter_by_entity_id(id)
|
58
|
+
team_assignments = Dev::TargetProcess.new.team_assignments(finished_dev_query)
|
59
|
+
team_assignments.sum(&:cycle_time)
|
60
|
+
end
|
49
61
|
end
|
50
62
|
end
|
51
63
|
end
|
@@ -8,10 +8,11 @@ module Dev
|
|
8
8
|
# The api path for user story requests
|
9
9
|
PATH = '/UserStoryHistories'.freeze
|
10
10
|
|
11
|
-
attr_accessor :type, :id, :source_entity_id, :name, :description, :start_date, :end_date, :create_date, :modify_date, :tags, :effort,
|
12
|
-
:last_state_change_date, :project, :owner, :creator, :release, :team, :priority, :state
|
11
|
+
attr_accessor :data, :type, :id, :source_entity_id, :name, :description, :start_date, :end_date, :create_date, :modify_date, :tags, :effort,
|
12
|
+
:time_spent, :last_state_change_date, :project, :owner, :creator, :release, :team, :priority, :state
|
13
13
|
|
14
14
|
def initialize(data)
|
15
|
+
@data = data
|
15
16
|
@id = data['Id']
|
16
17
|
@source_entity_id = data['SourceEntityId']
|
17
18
|
@type = data['ResourceType']
|
@@ -31,7 +32,6 @@ module Dev
|
|
31
32
|
@effort = data['Effort']
|
32
33
|
@time_spent = data['TimeSpent']
|
33
34
|
@last_state_change_date = parse_time(data['LastStateChangeDate'])
|
34
|
-
@original_data = original_data
|
35
35
|
end
|
36
36
|
|
37
37
|
# Parse the dot net time representation into something that ruby can use
|
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.14.pre.alpha.
|
4
|
+
version: 2.1.14.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-11-
|
11
|
+
date: 2023-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|