apadmi_grout 2.7.0 → 2.8.0
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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/apadmi/grout/actions/find_tickets_to_move_action/find_tickets_to_move_jira_action.rb +14 -6
- data/lib/apadmi/grout/models/find_tickets_options.rb +4 -3
- data/lib/apadmi/grout/utils/git_utils.rb +11 -0
- data/lib/apadmi/grout/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: 75c06e02304d0547ca158b319c9c88e895753233fd06da8d864c402ae89946e1
|
4
|
+
data.tar.gz: 6fda7788c5401a14481f715f4007dec869219438304b0206dfce5eb3735c3e07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b34320096c5d746f833c48ab31d00933188fdfe86c607a5529f58f03f15b8fb2636ba752b8d5a2743bf4b0d98563c39d21a64b950fb8706b278cc4ddca2500fb
|
7
|
+
data.tar.gz: 38c1b2705c12d5fb8480270a26022f1266f0bb9b15da84ffde2447ada05e7de497356a46ae759a1fc3a91fefb1aa50524a30bf52094e0da6fec31ebcdc9f763c
|
data/CHANGELOG.md
CHANGED
data/lib/apadmi/grout/actions/find_tickets_to_move_action/find_tickets_to_move_jira_action.rb
CHANGED
@@ -39,7 +39,7 @@ module Apadmi
|
|
39
39
|
options = nil
|
40
40
|
)
|
41
41
|
custom_flag_messages ||= Apadmi::Grout::FlagMessages.default(status)
|
42
|
-
options ||= Apadmi::Grout::JiraFindTicketsOptions.new(include_no_sprint_tickets: false)
|
42
|
+
options ||= Apadmi::Grout::JiraFindTicketsOptions.new(include_no_sprint_tickets: false, inspect_prs: true)
|
43
43
|
|
44
44
|
issues = @jira_board_service.search_unblocked_issues(
|
45
45
|
component, status, [], options
|
@@ -55,11 +55,7 @@ module Apadmi
|
|
55
55
|
@git_utils.merge_changelog(issue_keys)
|
56
56
|
)
|
57
57
|
|
58
|
-
final_list = issues
|
59
|
-
# Decide whether to include this ticket based on PRs
|
60
|
-
status = process_prs(issue, custom_flag_messages)
|
61
|
-
decide_should_include(issue, status, changelog_ids)
|
62
|
-
end
|
58
|
+
final_list = filter_on_prs(changelog_ids, custom_flag_messages, issues, options)
|
63
59
|
|
64
60
|
@logger.message("Final list: #{final_list.map(&:key).join(", ")}")
|
65
61
|
final_list
|
@@ -67,6 +63,18 @@ module Apadmi
|
|
67
63
|
|
68
64
|
private
|
69
65
|
|
66
|
+
def filter_on_prs(changelog_ids, custom_flag_messages, issues, options)
|
67
|
+
if options.inspect_prs
|
68
|
+
issues.filter do |issue|
|
69
|
+
# Decide whether to include this ticket based on PRs
|
70
|
+
status = process_prs(issue, custom_flag_messages)
|
71
|
+
decide_should_include(issue, status, changelog_ids)
|
72
|
+
end
|
73
|
+
else
|
74
|
+
issues
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
70
78
|
# @param issue [Apadmi::Grout::Issue]
|
71
79
|
# @param pr_status [Int] status of whether or not we can move
|
72
80
|
# @param changelog_ids [Array<String>] the ticket ids pulled from git
|
@@ -7,11 +7,12 @@ module Apadmi
|
|
7
7
|
|
8
8
|
# Jira specific find tickets options
|
9
9
|
class JiraFindTicketsOptions < FindTicketsOptions
|
10
|
-
attr_reader :include_no_sprint_tickets
|
10
|
+
attr_reader :include_no_sprint_tickets, :inspect_prs
|
11
11
|
|
12
12
|
# @param include_no_sprint_tickets [String] whether or not to include tickets with no sprint assigned
|
13
|
-
def initialize(include_no_sprint_tickets: false)
|
13
|
+
def initialize(include_no_sprint_tickets: false, inspect_prs: true)
|
14
14
|
@include_no_sprint_tickets = include_no_sprint_tickets
|
15
|
+
@inspect_prs = inspect_prs
|
15
16
|
end
|
16
17
|
|
17
18
|
def ==(other)
|
@@ -19,7 +20,7 @@ module Apadmi
|
|
19
20
|
end
|
20
21
|
|
21
22
|
def state
|
22
|
-
[@include_no_sprint_tickets]
|
23
|
+
[@include_no_sprint_tickets, @inspect_prs]
|
23
24
|
end
|
24
25
|
end
|
25
26
|
|
@@ -72,12 +72,23 @@ module Apadmi
|
|
72
72
|
# See more details here: https://git-scm.com/docs/git-rev-list
|
73
73
|
# @return [String] The number of commits
|
74
74
|
def number_of_commits
|
75
|
+
raise "Repo is a shallow clone so this method will always return 1" if is_shallow_clone
|
76
|
+
|
75
77
|
stdout, stderr, status = Open3.capture3("git #{@repo_path_arg} rev-list HEAD --count")
|
76
78
|
raise "Failed to get commit number: #{stderr}" unless status.success?
|
77
79
|
|
78
80
|
stdout.strip
|
79
81
|
end
|
80
82
|
|
83
|
+
# Helper function to check if a repo is a shallow clone
|
84
|
+
# @return [Boolean] If the repo is a shallow clone
|
85
|
+
def is_shallow_clone
|
86
|
+
stdout, stderr, status = Open3.capture3("git #{@repo_path_arg} rev-parse --is-shallow-repository")
|
87
|
+
raise "Failed to check if repo is shallow clone: #{stderr}" unless status.success?
|
88
|
+
|
89
|
+
stdout.strip.downcase == "true"
|
90
|
+
end
|
91
|
+
|
81
92
|
# Gets the number of commits accessible from HEAD treating the history as a graph.
|
82
93
|
# See more details here: https://git-scm.com/docs/git-rev-list
|
83
94
|
# @return [String] The number of commits
|
data/lib/apadmi/grout/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apadmi_grout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Apadmi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|