Commit 4a3756a6 authored by Albert Salim's avatar Albert Salim

Merge branch '327456-consider-getting-rid-of-the-brakeman-gem' into 'master'

Get rid of the 'brakeman' gem

See merge request gitlab-org/gitlab!59141
parents c75c99e0 b18049b0
...@@ -342,7 +342,6 @@ group :metrics do ...@@ -342,7 +342,6 @@ group :metrics do
end end
group :development do group :development do
gem 'brakeman', '~> 4.10.0', require: false
gem 'lefthook', '~> 0.7.0', require: false gem 'lefthook', '~> 0.7.0', require: false
gem 'letter_opener_web', '~> 1.4.0' gem 'letter_opener_web', '~> 1.4.0'
......
...@@ -151,7 +151,6 @@ GEM ...@@ -151,7 +151,6 @@ GEM
bootstrap_form (4.2.0) bootstrap_form (4.2.0)
actionpack (>= 5.0) actionpack (>= 5.0)
activemodel (>= 5.0) activemodel (>= 5.0)
brakeman (4.10.1)
browser (4.2.0) browser (4.2.0)
builder (3.2.4) builder (3.2.4)
bullet (6.1.3) bullet (6.1.3)
...@@ -1369,7 +1368,6 @@ DEPENDENCIES ...@@ -1369,7 +1368,6 @@ DEPENDENCIES
better_errors (~> 2.9.0) better_errors (~> 2.9.0)
bootsnap (~> 1.4.6) bootsnap (~> 1.4.6)
bootstrap_form (~> 4.2.0) bootstrap_form (~> 4.2.0)
brakeman (~> 4.10.0)
browser (~> 4.2) browser (~> 4.2)
bullet (~> 6.1.3) bullet (~> 6.1.3)
bundler-audit (~> 0.7.0.1) bundler-audit (~> 0.7.0.1)
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
# Add your own tasks in files placed in lib/tasks ending in .rake, # Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
Rake::TaskManager.record_task_metadata = true
require File.expand_path('config/application', __dir__) require File.expand_path('config/application', __dir__)
relative_url_conf = File.expand_path('config/initializers/relative_url', __dir__) relative_url_conf = File.expand_path('config/initializers/relative_url', __dir__)
......
# frozen_string_literal: true
desc 'Security check via brakeman'
task :brakeman do
# We get 0 warnings at level 'w3' but we would like to reach 'w2'. Merge
# requests are welcome!
if system(*%w(brakeman --no-progress --skip-files lib/backup/repository.rb -w3 -z))
puts 'Security check succeed'
else
puts 'Security check failed'
exit 1
end
end
# frozen_string_literal: true
namespace :gitlab do
desc "GitLab | Run all tests"
task :test do
cmds = [
%w(rake brakeman),
%w(rake rubocop),
%w(rake spec),
%w(rake karma)
]
cmds.each do |cmd|
system({ 'RAILS_ENV' => 'test', 'force' => 'yes' }, *cmd) || raise("#{cmd} failed!")
end
end
end
...@@ -2,7 +2,16 @@ ...@@ -2,7 +2,16 @@
Rake::Task["test"].clear Rake::Task["test"].clear
desc "GitLab | Run all tests" desc "GitLab | List rake tasks for tests"
task :test do task :test do
Rake::Task["gitlab:test"].invoke puts "Running the full GitLab test suite takes significant time to pass. We recommend using one of the following spec tasks:\n\n"
spec_tasks = Rake::Task.tasks.select { |t| t.name.start_with?('spec:') }
longest_task_name = spec_tasks.map { |t| t.name.size }.max
spec_tasks.each do |task|
puts "#{"%-#{longest_task_name}s" % task.name} | #{task.full_comment}"
end
puts "\nLearn more at https://docs.gitlab.com/ee/development/rake_tasks.html#run-tests."
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment