From a43d7791907e92092509da0950ac33700bfaeb02 Mon Sep 17 00:00:00 2001 From: yugangw-msft Date: Wed, 7 Nov 2018 16:46:25 -0800 Subject: [PATCH 1/5] graph: output warnings to communicate breaking changes in the near future --- .../azure/cli/command_modules/role/custom.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py index 10cb683c04f..59d9ef14c5d 100644 --- a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py +++ b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py @@ -497,6 +497,11 @@ def list_apps(client, app_id=None, display_name=None, identifier_uri=None, query if identifier_uri: sub_filters.append("identifierUris/any(s:s eq '{}')".format(identifier_uri)) + if not sub_filters: + logger.warning('In a future relase, if no filter arguments are provided, CLI will only output the first' + ' 100 objects to avoid long waiting. You can still use "--all" for old behavior, though it is much' + ' recommended to avoid it') + return client.list(filter=(' and '.join(sub_filters))) @@ -525,6 +530,10 @@ def list_sps(client, spn=None, display_name=None, query_filter=None): if display_name: sub_filters.append("startswith(displayName,'{}')".format(display_name)) + if not sub_filters: + logger.warning('In a future relase, if no filter arguments are provided, CLI will only output the first' + ' 100 objects to avoid long waiting. You can still use "--all" for old behavior, though it is much' + ' recommended to avoid it') return client.list(filter=(' and '.join(sub_filters))) From 510347612315866356e63c2ed345c1583e7d2c38 Mon Sep 17 00:00:00 2001 From: yugangw-msft Date: Wed, 7 Nov 2018 16:48:20 -0800 Subject: [PATCH 2/5] update history --- src/command_modules/azure-cli-role/HISTORY.rst | 4 ++++ src/command_modules/azure-cli-role/setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/command_modules/azure-cli-role/HISTORY.rst b/src/command_modules/azure-cli-role/HISTORY.rst index ca71f6c180d..908ec64f5d0 100644 --- a/src/command_modules/azure-cli-role/HISTORY.rst +++ b/src/command_modules/azure-cli-role/HISTORY.rst @@ -2,6 +2,10 @@ Release History =============== +2.1.10 +++++++ +* graph: output warnings to communicate breaking changes in the near future for "ad app/sp list" + 2.1.9 ++++++ * support API permission management, signed-in-user, and application password & certificate credential management diff --git a/src/command_modules/azure-cli-role/setup.py b/src/command_modules/azure-cli-role/setup.py index c4dfc0729c7..8f51a153e41 100644 --- a/src/command_modules/azure-cli-role/setup.py +++ b/src/command_modules/azure-cli-role/setup.py @@ -14,7 +14,7 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") cmdclass = {} -VERSION = "2.1.9" +VERSION = "2.1.10" CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', From 3a107afab2ee694d4211cc12179dcc9846050cd4 Mon Sep 17 00:00:00 2001 From: yugangw-msft Date: Wed, 7 Nov 2018 17:31:35 -0800 Subject: [PATCH 3/5] fix linter error --- .../azure-cli-role/azure/cli/command_modules/role/custom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py index 59d9ef14c5d..fdeaa0da71d 100644 --- a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py +++ b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py @@ -499,8 +499,8 @@ def list_apps(client, app_id=None, display_name=None, identifier_uri=None, query if not sub_filters: logger.warning('In a future relase, if no filter arguments are provided, CLI will only output the first' - ' 100 objects to avoid long waiting. You can still use "--all" for old behavior, though it is much' - ' recommended to avoid it') + ' 100 objects to avoid long waiting. You can still use "--all" for old behavior, though' + ' it is much recommended to avoid it') return client.list(filter=(' and '.join(sub_filters))) From af2924190585948b5b7a96d4524b6eba9deb6724 Mon Sep 17 00:00:00 2001 From: yugangw-msft Date: Fri, 9 Nov 2018 10:11:33 -0800 Subject: [PATCH 4/5] fix linter --- .../azure-cli-role/azure/cli/command_modules/role/custom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py index fdeaa0da71d..472e5308e85 100644 --- a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py +++ b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py @@ -532,8 +532,8 @@ def list_sps(client, spn=None, display_name=None, query_filter=None): if not sub_filters: logger.warning('In a future relase, if no filter arguments are provided, CLI will only output the first' - ' 100 objects to avoid long waiting. You can still use "--all" for old behavior, though it is much' - ' recommended to avoid it') + ' 100 objects to avoid long waiting. You can still use "--all" for old behavior,' + ' though it is much recommended to avoid it') return client.list(filter=(' and '.join(sub_filters))) From d87a4e42da8629a945827aeeafa4cac178fe22f5 Mon Sep 17 00:00:00 2001 From: yugangw-msft Date: Fri, 9 Nov 2018 13:31:16 -0800 Subject: [PATCH 5/5] address review feedbacks --- .../azure/cli/command_modules/role/custom.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py index 472e5308e85..a34a9368b03 100644 --- a/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py +++ b/src/command_modules/azure-cli-role/azure/cli/command_modules/role/custom.py @@ -498,9 +498,9 @@ def list_apps(client, app_id=None, display_name=None, identifier_uri=None, query sub_filters.append("identifierUris/any(s:s eq '{}')".format(identifier_uri)) if not sub_filters: - logger.warning('In a future relase, if no filter arguments are provided, CLI will only output the first' - ' 100 objects to avoid long waiting. You can still use "--all" for old behavior, though' - ' it is much recommended to avoid it') + logger.warning('In a future release, if no filter arguments are provided, CLI will output only the first' + ' 100 objects to minimize wait times. You can still use --all for the old behavior,' + ' though it is not recommended') return client.list(filter=(' and '.join(sub_filters))) @@ -531,9 +531,9 @@ def list_sps(client, spn=None, display_name=None, query_filter=None): sub_filters.append("startswith(displayName,'{}')".format(display_name)) if not sub_filters: - logger.warning('In a future relase, if no filter arguments are provided, CLI will only output the first' - ' 100 objects to avoid long waiting. You can still use "--all" for old behavior,' - ' though it is much recommended to avoid it') + logger.warning('In a future release, if no filter arguments are provided, CLI will output only the first' + ' 100 objects to to minimize wait times. You can still use --all for the old behavior,' + ' though it is not recommended') return client.list(filter=(' and '.join(sub_filters)))