Commit a4b03f35 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'secpick-improvements-security-default' into 'master'

Make security the default for the secpick script

See merge request gitlab-org/gitlab!27174
parents a65aa3c6 a9798573
...@@ -12,10 +12,8 @@ module Secpick ...@@ -12,10 +12,8 @@ module Secpick
BRANCH_PREFIX = 'security'.freeze BRANCH_PREFIX = 'security'.freeze
STABLE_SUFFIX = 'stable'.freeze STABLE_SUFFIX = 'stable'.freeze
DEFAULT_REMOTE = 'dev'.freeze DEFAULT_REMOTE = 'security'.freeze
SECURITY_REMOTE = 'security'.freeze
NEW_MR_URL = 'https://dev.gitlab.org/gitlab/gitlabhq/-/merge_requests/new'.freeze
SECURITY_MR_URL = 'https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/new'.freeze SECURITY_MR_URL = 'https://gitlab.com/gitlab-org/security/gitlab/-/merge_requests/new'.freeze
class SecurityFix class SecurityFix
...@@ -66,18 +64,10 @@ module Secpick ...@@ -66,18 +64,10 @@ module Secpick
end end
def new_mr_url def new_mr_url
if @options[:security_remote] if ee?
if ee? SECURITY_MR_URL
SECURITY_MR_URL
else
SECURITY_MR_URL.sub('/gitlab/', '/gitlab-foss/')
end
else else
if ee? SECURITY_MR_URL.sub('/gitlab/', '/gitlab-foss/')
NEW_MR_URL.sub('gitlabhq', 'gitlab-ee')
else
NEW_MR_URL
end
end end
end end
...@@ -124,19 +114,10 @@ module Secpick ...@@ -124,19 +114,10 @@ module Secpick
options[:sha] = sha options[:sha] = sha
end end
opts.on('-r', '--remote abcd', 'Git remote name of dev.gitlab.org (optional, defaults to `dev`)') do |remote| opts.on('-r', '--remote dev', "Git remote name of security repo (optional, defaults to `#{DEFAULT_REMOTE}`)") do |remote|
options[:remote] = remote options[:remote] = remote
end end
opts.on('--security-remote', 'Use the new Security group-based workflow on gitlab.com (note: mutually exclusive to --remote)') do
unless options[:remote].nil?
abort('Cannot use --security-remote with --remote')
end
options[:security_remote] = true
options[:remote] = SECURITY_REMOTE
end
opts.on('-d', '--dry-run', 'Only show Git commands, without calling them') do opts.on('-d', '--dry-run', 'Only show Git commands, without calling them') do
options[:try] = true options[:try] = true
end end
...@@ -144,11 +125,6 @@ module Secpick ...@@ -144,11 +125,6 @@ module Secpick
opts.on('-h', '--help', 'Displays Help') do opts.on('-h', '--help', 'Displays Help') do
puts opts puts opts
puts
puts 'NOTE: If `--security-remote` is used, commands will default ' \
'to using a `security` remote, and merge requests will be created ' \
'on gitlab.com/gitlab-org/security/ rather than dev.gitlab.org.'
exit exit
end end
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