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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c359c320e340ceb70fd0b212f657bb858958fa8fb5ef6037dca5891fc50a90f6
4
- data.tar.gz: f4d9eaf0b6fec2ede3829844314fbafc25c4f2a378185e4656f562f58e08b09f
3
+ metadata.gz: 75c06e02304d0547ca158b319c9c88e895753233fd06da8d864c402ae89946e1
4
+ data.tar.gz: 6fda7788c5401a14481f715f4007dec869219438304b0206dfce5eb3735c3e07
5
5
  SHA512:
6
- metadata.gz: 669edb4b69e604ba1a4cde88bb8b46bf073c26765dcb3f819dc55f2fcc118008fde3bfac3e0c343e85a338fcbdeda2f1f57246c2db065565921f40e209dcaf3e
7
- data.tar.gz: 81eef18800723d403d6ecf016b87486253d06b4b1f15725189752afea71a6dce4dd7b79d62a945a5382f3486be3709089b9d04c6608c9df2632059d36e31b958
6
+ metadata.gz: b34320096c5d746f833c48ab31d00933188fdfe86c607a5529f58f03f15b8fb2636ba752b8d5a2743bf4b0d98563c39d21a64b950fb8706b278cc4ddca2500fb
7
+ data.tar.gz: 38c1b2705c12d5fb8480270a26022f1266f0bb9b15da84ffde2447ada05e7de497356a46ae759a1fc3a91fefb1aa50524a30bf52094e0da6fec31ebcdc9f763c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Core Changelog
2
2
 
3
+ ## [2.8.0] - 2025-05-22
4
+ * Add ability to disable use of the undocumented JIRA apis
5
+
3
6
  ## [2.7.0] - 2024-09-24
4
7
  * Add utility for checking for unmerged release branches before deployments
5
8
 
@@ -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.filter do |issue|
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Apadmi
4
4
  module Grout
5
- VERSION = "2.7.0"
5
+ VERSION = "2.8.0"
6
6
  end
7
7
  end
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.7.0
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: 2024-09-27 00:00:00.000000000 Z
11
+ date: 2025-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday