Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change --whitelist to --skip #723

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/foreman_maintain/cli/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def run_scenario(scenarios, rescue_scenario = nil)
@runner ||=
ForemanMaintain::Runner.new(reporter, scenarios,
:assumeyes => option_wrapper('assumeyes?'),
:whitelist => option_wrapper('whitelist') || [],
:whitelist => option_wrapper('skip') || [],
:force => option_wrapper('force?'),
:rescue_scenario => rescue_scenario)
runner.run
Expand Down Expand Up @@ -153,7 +153,7 @@ def self.tags_option
end

# rubocop:disable Metrics/MethodLength
def self.interactive_option(opts = %w[assumeyes whitelist force plaintext])
def self.interactive_option(opts = %w[assumeyes skip force plaintext])
delete_duplicate_assumeyes_if_any

if opts.include?('assumeyes')
Expand All @@ -163,11 +163,11 @@ def self.interactive_option(opts = %w[assumeyes whitelist force plaintext])
end
end

if opts.include?('whitelist')
option(['-w', '--whitelist'], 'whitelist',
'Comma-separated list of labels of steps to be skipped') do |whitelist|
raise ArgumentError, 'value not specified' if whitelist.nil? || whitelist.empty?
whitelist.split(',').map(&:strip)
if opts.include?('skip')
option(['--skip'], 'steps',
'Comma-separated list of step labels to be skipped') do |steps|
raise ArgumentError, 'value not specified' if steps.nil? || steps.empty?
steps.split(',').map(&:strip)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/foreman_maintain/cli/upgrade_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def upgrade_runner
validate_target_version!
@upgrade_runner = ForemanMaintain::UpgradeRunner.new(target_version, reporter,
:assumeyes => assumeyes?,
:whitelist => whitelist || [],
:whitelist => skip || [],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it also internally refactor?

:force => force?).tap(&:load)
end

Expand Down
4 changes: 2 additions & 2 deletions lib/foreman_maintain/reporter/cli_reporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,13 @@ def scenario_failure_message(scenario)
contact #{scenario.detector.feature(:instance).project_support_entity}.

In case the failures are false positives, use
--whitelist="#{whitelist_labels}"
--skip="%s"
MESSAGE
else
format(<<-MESSAGE.strip_heredoc)
Resolve the failed steps and rerun the command.
In case the failures are false positives, use
--whitelist="#{whitelist_labels}"
--skip="%s"
MESSAGE
end
end
Expand Down
12 changes: 6 additions & 6 deletions test/lib/reporter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def decision_question(description)
contact Red Hat Technical Support.

In case the failures are false positives, use
--whitelist="dummy-check-fail,dummy-check-fail2"
--skip="dummy-check-fail,dummy-check-fail2"
MESSAGE
end

Expand Down Expand Up @@ -168,7 +168,7 @@ def decision_question(description)

Resolve the failed steps and rerun the command.
In case the failures are false positives, use
--whitelist="dummy-check-fail,dummy-check-fail2"
--skip="dummy-check-fail,dummy-check-fail2"
MESSAGE
end

Expand Down Expand Up @@ -219,7 +219,7 @@ def decision_question(description)

Resolve the failed steps and rerun the command.
In case the failures are false positives, use
--whitelist="dummy-check-fail"
--skip="dummy-check-fail"

The steps in warning state itself might not mean there is an error,
but it should be reviewed to ensure the behavior is expected
Expand Down Expand Up @@ -256,7 +256,7 @@ def decision_question(description)
contact Red Hat Technical Support.

In case the failures are false positives, use
--whitelist="dummy-check-fail"
--skip="dummy-check-fail"

The steps in warning state itself might not mean there is an error,
but it should be reviewed to ensure the behavior is expected
Expand Down Expand Up @@ -307,7 +307,7 @@ def decision_question(description)

Resolve the failed steps and rerun the command.
In case the failures are false positives, use
--whitelist="dummy-check-fail"
--skip="dummy-check-fail"

The steps in warning state itself might not mean there is an error,
but it should be reviewed to ensure the behavior is expected
Expand Down Expand Up @@ -338,7 +338,7 @@ def decision_question(description)

Resolve the failed steps and rerun the command.
In case the failures are false positives, use
--whitelist="dummy-check-fail"
--skip="dummy-check-fail"
MESSAGE
end

Expand Down
Loading