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
[Core] Update core for latest knack #8940
Conversation
@@ -10,6 +10,7 @@ | |||
from azure.cli.core.profiles import ResourceType | |||
|
|||
from knack.log import get_logger | |||
from knack.validators import DefaultStr, DefaultInt # pylint: disable=unused-import |
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.
Avoid the breaking change to core that would occur if these were removed.
overrides.settings['default'] = DefaultStr(config_value) | ||
overrides.settings['required'] = False | ||
# same blunt mechanism like we handled id-parts, for create command, no name default | ||
if self.name.split()[-1] == 'create' and overrides.settings.get('metavar', None) == 'NAME': |
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.
Did we ignore defaults for create commands previously?
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.
👍
@@ -11,4 +11,3 @@ | |||
CONFIG_FILE_NAME = 'config' | |||
GLOBAL_CONFIG_PATH = os.path.join(GLOBAL_CONFIG_DIR, CONFIG_FILE_NAME) | |||
ENV_VAR_PREFIX = 'AZURE' | |||
DEFAULTS_SECTION = 'defaults' |
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.
I guess this is a "breaking change" but I suppose it can't be helped.
src/azure-cli-core/setup.py
Outdated
@@ -59,7 +59,7 @@ | |||
'colorama>=0.3.9', | |||
'humanfriendly>=4.7', | |||
'jmespath', | |||
'knack>=0.5.3', | |||
'knack>=0.5.4', |
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.
While we're at it, should we use the ~=
operator instead of the >=
operator? Especially when libraries are in the 0 band, we want to protect ourselves from breaking changes (even if we're the ones who would be doing it.)
Knack now contains the configure_defaults logic. This moves the CLI toward relying on that implmentation.
This checklist is used to make sure that common guidelines for a pull request are followed.
[N/A] The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).
I adhere to the Command Guidelines.