-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AppConfig] Support Import/Export of features in yaml files #11637
Changes from all commits
dc79695
bed54bf
4509a4b
1d518d3
6393a06
c16cb4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ def load_arguments(self, _): | |
|
||
with self.argument_context('appconfig kv import', arg_group='File') as c: | ||
c.argument('path', help='Local configuration file path. Required for file arguments.') | ||
c.argument('format_', options_list=['--format'], arg_type=get_enum_type(['json', 'yaml', 'properties']), help='Imported file format. Required for file arguments. Currently, feature flags are only supported in json format.') | ||
c.argument('format_', options_list=['--format'], arg_type=get_enum_type(['json', 'yaml', 'properties']), help='Imported file format. Required for file arguments. Currently, feature flags are not supported in properties format.') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. curious why format_ has a '_' in the end There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because 'format' is a built-in identifier (pylint throws an error) In reply to: 362150723 [](ancestors = 362150723) |
||
c.argument('depth', validator=validate_import_depth, help="Depth for flattening the json or yaml file to key-value pairs. Flatten to the deepest level by default. Not applicable for property files or feature flags.") | ||
# bypass cli allowed values limition | ||
c.argument('separator', validator=validate_separator, help="Delimiter for flattening the json or yaml file to key-value pairs. Required for importing hierarchical structure. Separator will be ignored for property files and feature flags. Supported values: '.', ',', ';', '-', '_', '__', '/', ':' ") | ||
|
@@ -107,10 +107,11 @@ def load_arguments(self, _): | |
|
||
with self.argument_context('appconfig kv export', arg_group='File') as c: | ||
c.argument('path', help='Local configuration file path. Required for file arguments.') | ||
c.argument('format_', options_list=['--format'], arg_type=get_enum_type(['json', 'yaml', 'properties']), help='File format exporting to. Required for file arguments. Currently, feature flags are only supported in json format.') | ||
c.argument('format_', options_list=['--format'], arg_type=get_enum_type(['json', 'yaml', 'properties']), help='File format exporting to. Required for file arguments. Currently, feature flags are not supported in properties format.') | ||
c.argument('depth', validator=validate_import_depth, help="Depth for flattening the json or yaml file to key-value pairs. Flatten to the deepest level by default. Not appicable for property files or feature flags.") | ||
# bypass cli allowed values limition | ||
c.argument('separator', validator=validate_separator, help="Delimiter for flattening the json or yaml file to key-value pairs. Required for importing hierarchical structure. Separator will be ignored for property files and feature flags. Supported values: '.', ',', ';', '-', '_', '__', '/', ':' ") | ||
c.argument('naming_convention', arg_type=get_enum_type(['pascal', 'camel', 'underscore', 'hyphen']), help='Naming convention to be used for "Feature Management" section of file. Example: pascal = FeatureManagement, camel = featureManagement, underscore = feature_management, hyphen = feature-management.') | ||
|
||
with self.argument_context('appconfig kv export', arg_group='AppConfig') as c: | ||
c.argument('dest_name', help='The name of the destination App Configuration.') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need to log here as warning will show up in console. We can add log warning in method for reading features from file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This warning is targeted for the case when user may have feature flags in properties file, but has also supplied --skip-features argument. In that case, we don't read features from file so we cant add any warning. But since this is an edge case, I can make it logger.debug instead of warning here.
In reply to: 361022792 [](ancestors = 361022792)