mirror of
https://github.com/sameersbn/docker-gitlab.git
synced 2026-01-25 14:08:09 +00:00
Simplify message on feature flag target specified as reviewed
like below: ```` Configuring gitlab::feature_flags... - Launching rails runner to set feature flags. This will take some time.... - Specified feature flags to be disabled: --- "auto_devops_banner_disabled" --- "invalid_flag_name" - Specified feature flags to be enabled --- "git_push_create_all_pipelines" --- "another_invalid_flag_name" - Following flags are probably invalid and have been ignored --- invalid_flag_name --- another_invalid_flag_name - Apply user defined feature flags: --- auto_devops_banner_disabled : off --- git_push_create_all_pipelines : on ```` - Do not `puts` parsed options (formatted by ruby's `.to_s`), `puts` each specified target with three hyphens instead - `puts` each ignored target on each line with three hyphens instead of single line csv
This commit is contained in:
parent
05794a2b47
commit
351711c4cc
@ -38,9 +38,13 @@ class FeatureFlagCLI
|
||||
|
||||
op.on("-d", "--disable feature_a,feature_b,feature_c", Array, "comma-separated list of feature flags to be disabled (defaults: ${opts[:to_be_disabled]})") { |v|
|
||||
opts[:to_be_disabled] = v.uniq
|
||||
puts "- Specified feature flags to be disabled"
|
||||
puts opts[:to_be_disabled].map { |f| format("--- %<opt>s", opt: f) }
|
||||
}
|
||||
op.on("-e", "--enable feature_a,feature_b,feature_c", Array, "comma-separated list of feature flags to be enabled (defaults: ${opts[:to_be_enabled]})") { |v|
|
||||
opts[:to_be_enabled] = v.uniq
|
||||
puts "- Specified feature flags to be enabled"
|
||||
puts opts[:to_be_enabled].map { |f| format("--- %<opt>s", opt: f) }
|
||||
}
|
||||
|
||||
begin
|
||||
@ -58,8 +62,6 @@ class FeatureFlagCLI
|
||||
def run
|
||||
succeed, opts, args = parse_options
|
||||
if succeed
|
||||
puts "- specified feature flags: #{opts.to_s}"
|
||||
|
||||
available_flags = self.available_feature_flags
|
||||
disable_targets = available_flags & opts[:to_be_disabled]
|
||||
enable_targets = available_flags & opts[:to_be_disabled]
|
||||
@ -76,7 +78,8 @@ class FeatureFlagCLI
|
||||
invalid_disable_targets = opts[:to_be_disabled] - disable_targets
|
||||
invalid_targets = invalid_disable_targets | invalid_enable_targets
|
||||
if invalid_targets.length > 0
|
||||
puts "- Following flags are probably invalid and have been ignored: #{invalid_enable_targets.to_a.join(",")}"
|
||||
puts "- Following flags are probably invalid and have been ignored"
|
||||
puts invalid_targets.map { |f| format("--- %<name>s", name: f) }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user