summaryrefslogtreecommitdiff
path: root/bin/secpick
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2018-12-28 14:52:43 -0600
committerClement Ho <ClemMakesApps@gmail.com>2018-12-28 14:52:43 -0600
commitc9d7514fd8d46b0de126fb9d6d081ec25bd3c5bb (patch)
tree417386f11b8c9f44bfac861659603281d302f614 /bin/secpick
parent77e1a9b0f8757109ca7f7a4398c46fe8d1d45dbe (diff)
parente962baf4417e59cbb2ef8621ef0662f93f180f92 (diff)
downloadgitlab-ce-fix-popover-header-size.tar.gz
Merge branch 'master' into fix-popover-header-sizefix-popover-header-size
Diffstat (limited to 'bin/secpick')
-rwxr-xr-xbin/secpick23
1 files changed, 22 insertions, 1 deletions
diff --git a/bin/secpick b/bin/secpick
index 2b263d452c9..11acdd82226 100755
--- a/bin/secpick
+++ b/bin/secpick
@@ -1,4 +1,7 @@
#!/usr/bin/env ruby
+# frozen_string_literal: false
+
+require 'active_support/core_ext/object/to_query'
require 'optparse'
require 'open3'
require 'rainbow/refinement'
@@ -6,6 +9,7 @@ using Rainbow
BRANCH_PREFIX = 'security'.freeze
REMOTE = 'dev'.freeze
+NEW_MR_URL = 'https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/new'.freeze
options = { version: nil, branch: nil, sha: nil }
@@ -48,7 +52,24 @@ end.freeze
command = "git fetch #{REMOTE} #{stable_branch} && git checkout #{stable_branch} && git pull #{REMOTE} #{stable_branch} && git checkout -B #{branch} && git cherry-pick #{options[:sha]} && git push #{REMOTE} #{branch} && git checkout #{original_branch}"
-_stdin, stdout, stderr = Open3.popen3(command)
+stdin, stdout, stderr, wait_thr = Open3.popen3(command)
puts stdout.read&.green
puts stderr.read&.red
+
+if wait_thr.value.success?
+ params = {
+ merge_request: {
+ source_branch: branch,
+ target_branch: stable_branch,
+ title: "WIP: [#{options[:version].tr('-', '.')}] ",
+ description: '/label ~security'
+ }
+ }
+
+ puts "#{NEW_MR_URL}?#{params.to_query}".blue
+end
+
+stdin.close
+stdout.close
+stderr.close