As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Commit ceb23a62 authored by ash's avatar ash
Browse files

Use :warn instead of :error for invalid commands.

parent 7626d957
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -18,7 +18,7 @@ class GitlabKeys
when 'add-key'; add_key
when 'rm-key'; rm_key
else
$logger.error "Attempt to execute invalid gitlab-keys command #{@command.inspect}."
$logger.warn "Attempt to execute invalid gitlab-keys command #{@command.inspect}."
puts 'not allowed'
false
end
Loading
Loading
Loading
Loading
@@ -32,7 +32,7 @@ class GitlabProjects
when 'import-project'; import_project
when 'fork-project'; fork_project
else
$logger.error "Attempt to execute invalid gitlab-projects command #{@command.inspect}."
$logger.warn "Attempt to execute invalid gitlab-projects command #{@command.inspect}."
puts 'not allowed'
false
end
Loading
Loading
Loading
Loading
@@ -63,10 +63,10 @@ describe GitlabKeys do
gitlab_keys.exec
end
it 'should log an error on unknown commands' do
it 'should log a warning on unknown commands' do
gitlab_keys = build_gitlab_keys('nooope')
gitlab_keys.stub(puts: nil)
$logger.should_receive(:error).with('Attempt to execute invalid gitlab-keys command "nooope".')
$logger.should_receive(:warn).with('Attempt to execute invalid gitlab-keys command "nooope".')
gitlab_keys.exec
end
end
Loading
Loading
Loading
Loading
@@ -180,9 +180,9 @@ describe GitlabProjects do
gitlab_projects.exec
end
it 'should log a message for unknown commands' do
it 'should log a warning for unknown commands' do
gitlab_projects = build_gitlab_projects('hurf-durf', repo_name)
$logger.should_receive(:error).with('Attempt to execute invalid gitlab-projects command "hurf-durf".')
$logger.should_receive(:warn).with('Attempt to execute invalid gitlab-projects command "hurf-durf".')
gitlab_projects.exec
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment