summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-02-18 09:45:46 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-02-18 09:45:46 +0000
commita7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch)
tree7452bd5c3545c2fa67a28aa013835fb4fa071baf /bin
parentee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff)
downloadgitlab-ce-a7b3560714b4d9cc4ab32dffcd1f74a284b93580.tar.gz
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'bin')
-rwxr-xr-xbin/feature-flag16
-rwxr-xr-xbin/metrics-server3
2 files changed, 8 insertions, 11 deletions
diff --git a/bin/feature-flag b/bin/feature-flag
index 06387d12eb5..be32c80aeab 100755
--- a/bin/feature-flag
+++ b/bin/feature-flag
@@ -9,6 +9,7 @@ require 'optparse'
require 'yaml'
require 'fileutils'
require 'uri'
+require 'readline'
require_relative '../lib/feature/shared' unless defined?(Feature::Shared)
@@ -114,8 +115,7 @@ class FeatureFlagOptionParser
$stdout.puts ">> Specify the group introducing the feature flag, like `group::apm`:"
loop do
- $stdout.print "?> "
- group = $stdin.gets.strip
+ group = Readline.readline('?> ', false)&.strip
group = nil if group.empty?
return group if group.nil? || group.start_with?('group::')
@@ -137,9 +137,7 @@ class FeatureFlagOptionParser
end
loop do
- $stdout.print "?> "
-
- type = $stdin.gets.strip.to_sym
+ type = Readline.readline('?> ', false)&.strip&.to_sym
return type if TYPES[type] && !TYPES[type][:deprecated]
$stderr.puts "Invalid type specified '#{type}'"
@@ -151,8 +149,7 @@ class FeatureFlagOptionParser
$stdout.puts ">> URL of the MR introducing the feature flag (enter to skip):"
loop do
- $stdout.print "?> "
- introduced_by_url = $stdin.gets.strip
+ introduced_by_url = Readline.readline('?> ', false)&.strip
introduced_by_url = nil if introduced_by_url.empty?
return introduced_by_url if introduced_by_url.nil? || introduced_by_url.start_with?('https://')
@@ -184,8 +181,7 @@ class FeatureFlagOptionParser
$stdout.puts ">> URL of the rollout issue (enter to skip):"
loop do
- $stdout.print "?> "
- created_url = $stdin.gets.strip
+ created_url = Readline.readline('?> ', false)&.strip
created_url = nil if created_url.empty?
return created_url if created_url.nil? || created_url.start_with?('https://')
@@ -218,7 +214,7 @@ class FeatureFlagCreator
assert_name!
assert_existing_feature_flag!
- # Read type from $stdin unless is already set
+ # Read type from stdin unless is already set
options.type ||= FeatureFlagOptionParser.read_type
options.ee ||= FeatureFlagOptionParser.read_ee_only(options)
options.group ||= FeatureFlagOptionParser.read_group
diff --git a/bin/metrics-server b/bin/metrics-server
index d8f2ed9faa4..f8eca93908e 100755
--- a/bin/metrics-server
+++ b/bin/metrics-server
@@ -9,4 +9,5 @@ raise "METRICS_SERVER_TARGET cannot be blank" if target.blank?
metrics_dir = ENV["prometheus_multiproc_dir"] || File.absolute_path("tmp/prometheus_multiproc_dir/#{target}")
wipe_metrics_dir = Gitlab::Utils.to_boolean(ENV['WIPE_METRICS_DIR']) || false
-Process.wait(MetricsServer.spawn(target, metrics_dir: metrics_dir, wipe_metrics_dir: wipe_metrics_dir))
+server = MetricsServer.new(target, metrics_dir, wipe_metrics_dir)
+server.start