diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /bin | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) | |
download | gitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/feature-flag | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/bin/feature-flag b/bin/feature-flag index 9a550dc8884..b5e7889be1d 100755 --- a/bin/feature-flag +++ b/bin/feature-flag @@ -153,6 +153,10 @@ class FeatureFlagOptionParser end end + def read_ee_only(options) + TYPES.dig(options.type, :ee_only) + end + def read_rollout_issue_url(options) return unless TYPES.dig(options.type, :rollout_issue) @@ -204,6 +208,7 @@ class FeatureFlagCreator # 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 options.introduced_by_url ||= FeatureFlagOptionParser.read_introduced_by_url options.rollout_issue_url ||= FeatureFlagOptionParser.read_rollout_issue_url(options) @@ -224,14 +229,22 @@ class FeatureFlagCreator private def contents - YAML.dump( + # Slice is used to ensure that YAML keys + # are always ordered in a predictable way + config_hash.slice( + *::Feature::Shared::PARAMS.map(&:to_s) + ).to_yaml + end + + def config_hash + { 'name' => options.name, 'introduced_by_url' => options.introduced_by_url, 'rollout_issue_url' => options.rollout_issue_url, - 'group' => options.group.to_s, + 'group' => options.group, 'type' => options.type.to_s, 'default_enabled' => FeatureFlagOptionParser.read_default_enabled(options) - ).strip + } end def write |