Skip to content

Commit 23ee29f

Browse files
author
jordanbreen28
committed
(maint) - Fix broken default CAT modules dependency checks
1 parent 01e5098 commit 23ee29f

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

bin/dependency-checker

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ OptionParser.new do |opts|
1919
options[:namespace] = namespace
2020
end
2121

22-
opts.on('-b bolt_project', '--bolt-project bolt_project', 'Check all modules within a bolt-project.yaml file.') do |bolt_project|
23-
raise 'You must specify a valid bolt-project.yaml' unless File.exist?(bolt_project) || bolt_project.end_with?('.yaml')
24-
25-
options[:bolt_project] = bolt_project
26-
end
27-
2822
opts.on('--endorsement endorsement', 'Filter a namespace search by endorsement (supported/approved/partner).') do |endorsement|
2923
raise 'You may only filter by one endorsement at a time' if options[:endorsement]
3024

lib/dependency_checker/runner.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
# Main runner for DependencyChecker
1010
module DependencyChecker
11-
class Runner
11+
class Runner # rubocop:disable Metrics/ClassLength
1212
attr_reader :problems
1313

1414
def initialize(verbose = false, forge_hostname = nil, forge_token = nil)
@@ -184,10 +184,12 @@ def return_modules(path)
184184
raise "*Error:* Ensure syntax of #{path} file is valid YAML or JSON"
185185
end
186186

187-
# transform from IAC supported module hash to simple list
188-
modules = modules.filter_map { |_key, val| val['puppet_module'] } if modules.is_a? Hash
189-
190-
modules
187+
# transform from CAT supported module hash to simple list
188+
if path.end_with? '/content-and-tooling-team/modules/list.json'
189+
modules.filter_map { |key, _val| key['name'] } if modules.is_a? Array
190+
elsif modules.is_a? Hash
191+
modules.filter_map { |_key, val| val['puppet_module'] }
192+
end
191193
end
192194

193195
# Post message to terminal

0 commit comments

Comments
 (0)