Skip to content
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

Update 4/27 #11

Merged
merged 18 commits into from
Apr 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
48143e2
fix recording (#17855)
kairu-ms Apr 25, 2021
138e96a
{Docs} Update track 2 migration roadmap (#17864)
jsntcy Apr 26, 2021
47a47c5
bump azdev (#17865)
jiasli Apr 26, 2021
e448cb7
[Storage] Support user assigned identity for storage account (#16613)
Juliehzl Apr 26, 2021
1062c3a
{Storage} Announce incoming breaking change (#17863)
Juliehzl Apr 26, 2021
805ca15
[HDInsight] Add Incoming BREAKING CHANGE for removing default value o…
aim-for-better Apr 26, 2021
bf4df70
{Storage} Add help example (#17550)
zhangyan133 Apr 26, 2021
39f4ecd
{Core} Aladdin recommendation improvements (#17854)
houk-ms Apr 26, 2021
2c69350
[KeyVault] BREAKING CHANGE: Support soft-delete feature for managed-H…
houk-ms Apr 26, 2021
f56be04
{Compute} Edge zone (#17853)
qwordy Apr 26, 2021
7d92fdb
[Network]`az network private-link-resource list`: support more provid…
msyyc Apr 26, 2021
7b7f326
[ACR] check-health: add support to verify dns routings to private end…
yugangw-msft Apr 26, 2021
ba16ce5
[ACR] Fix #17618: Update credential add/update handling for tasks cre…
jaysterp Apr 26, 2021
5cf2ac3
[Storage] `az storage account create/update`: Support sas&key policy …
evelyn-ys Apr 27, 2021
71c6a9f
[EventGrid] force int type for certain params (#17872)
wiebeck Apr 27, 2021
1ff6b71
change the way to get az version in acr (#17707)
fengzhou-msft Apr 27, 2021
63a988a
bump python to 3.8.9 in docker (#17840)
fengzhou-msft Apr 27, 2021
3d14ca2
{core} Fix #17170: Replace distutils.version.LooseVersion with packag…
Jing-song Apr 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure-pipelines/templates/azdev_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ steps:
chmod +x env/bin/activate
. env/bin/activate
python -m pip install -U pip
pip install azdev==0.1.30
pip install azdev==0.1.31
azdev --version

if [ -z "$CLI_EXT_REPO_PATH" ]; then
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
#---------------------------------------------------------------------------------------------

ARG PYTHON_VERSION="3.6.10"
ARG PYTHON_VERSION="3.8.9"

FROM python:${PYTHON_VERSION}-alpine3.11
FROM python:${PYTHON_VERSION}-alpine3.13

ARG CLI_VERSION

Expand Down
4 changes: 2 additions & 2 deletions doc/track_2_migration_roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ This document provides the roadmap for Track 2 SDK migration in Azure CLI. When
| CosmosDB | Yes |**Completed** | 04/30/2021 |Yong|GA (6.0.0) | Preview (2.0.0rc1) | Medium (Once two months) |Module|
| CDN | Yes |**Completed** | 04/30/2021 |Yong|GA (10.0.0) | GA (6.0.0) | Low (Once half year) | Module |
| NetAppFiles | Yes |**Completed** | 04/30/2021 |Yong|GA (1.0.0) | Preview (0.15.0) | Medium (Once two months) | Module|
| Resource | Yes |**In progress** | 04/30/2021 |Yong |GA (15.0.0) | GA (12.0.0) | Medium (Once two months) | Module |
| Resource | Yes |**Completed** | 04/30/2021 |Yong |GA (15.0.0) | GA (12.0.0) | Medium (Once two months) | Module |
| DNS | Yes |**Completed** | 04/30/2021 |Yong|Preview (8.0.0b1) | GA (3.0.0) | Medium (Once two months) | Module|
| PrivateDNS | Yes | **In progress** | 04/30/2021 |Yong|Preview (1.0.0b1) | Preview (0.1.0) |N/A | Module |
| PrivateDNS | Yes | **Completed** | 04/30/2021 |Yong|Preview (1.0.0b1) | Preview (0.1.0) |N/A | Module |
| Application-Insights |Yes | **Completed** | 04/30/2021 |Yong|GA (1.0.0) | Vendored_Preview (0.2.0) | N/A | Extension |
| Firewall |Yes| **Completed** | 04/30/2021 |Yong| Network: GA (17.0.0) | Network: Vendored_GA (13.0.0) | N/A | Extension |
| Front-door | Yes | **Completed** | 04/30/2021 |Yong|Preview (1.0.0b1) | Vendored_Preview (0.3.1) | N/A | Extension |
Expand Down
4 changes: 2 additions & 2 deletions src/azure-cli-core/azure/cli/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,9 @@ def __init__(self, mod_name, suppress_extension_name, suppress_up_to_version, re
self.recommend_update = recommend_update

def handle_suppress(self, ext):
from pkg_resources import parse_version
from packaging.version import parse
should_suppress = ext.name == self.suppress_extension_name and ext.version and \
parse_version(ext.version) <= parse_version(self.suppress_up_to_version)
parse(ext.version) <= parse(self.suppress_up_to_version)
if should_suppress:
reason = self.reason or "Use --debug for more information."
logger.warning("Extension %s (%s) has been suppressed. %s",
Expand Down
9 changes: 5 additions & 4 deletions src/azure-cli-core/azure/cli/core/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@ def strip_command(command):

examples = []
for example in help_file.examples:
examples.append({
'command': strip_command(example.command),
'description': example.name
})
if example.command and example.name:
examples.append({
'command': strip_command(example.command),
'description': example.name
})

return examples

Expand Down
7 changes: 5 additions & 2 deletions src/azure-cli-core/azure/cli/core/command_recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def _set_aladdin_recommendations(self): # pylint: disable=too-many-locals
context['subscriptionId'] = subscription_id

parameters = self._normalize_parameters(self.parameters)
parameters = [item for item in parameters if item not in ['--debug', '--verbose', '--only-show-errors']]
parameters = [item for item in set(parameters) if item not in ['--debug', '--verbose', '--only-show-errors']]
query = {
"command": self.command,
"parameters": ','.join(parameters)
Expand Down Expand Up @@ -294,7 +294,10 @@ def replace_param_values(command): # pylint: disable=unused-variable

# generate decorated commands shown to users
decorated_command = highlight_command(raw_command)
decorated_description = [(Style.SECONDARY, recommendation['description'] + '\n')]
decorated_description = [(
Style.SECONDARY,
recommendation.get('description', 'No description is found.') + '\n'
)]
decorated_recommendations.append((decorated_command, decorated_description))

# add reference link as a recommendation
Expand Down
10 changes: 5 additions & 5 deletions src/azure-cli-core/azure/cli/core/extension/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,20 +280,20 @@ def _collect(path, depth=0, max_depth=3):

def ext_compat_with_cli(azext_metadata):
from azure.cli.core import __version__ as core_version
from pkg_resources import parse_version
from packaging.version import parse
is_compatible, min_required, max_required = (True, None, None)
if azext_metadata:
min_required = azext_metadata.get(EXT_METADATA_MINCLICOREVERSION)
max_required = azext_metadata.get(EXT_METADATA_MAXCLICOREVERSION)
parsed_cli_version = parse_version(core_version)
if min_required and parsed_cli_version < parse_version(min_required):
parsed_cli_version = parse(core_version)
if min_required and parsed_cli_version < parse(min_required):
is_compatible = False
elif max_required and parsed_cli_version > parse_version(max_required):
elif max_required and parsed_cli_version > parse(max_required):
is_compatible = False

try:
min_ext_required = EXTENSION_VERSION_REQUIREMENTS.get(azext_metadata.get('name')).get(MIN_EXT_VERSION)
if parse_version(azext_metadata.get('version')) < parse_version(min_ext_required):
if parse(azext_metadata.get('version')) < parse(min_ext_required):
is_compatible = False
except AttributeError:
min_ext_required = None
Expand Down
8 changes: 4 additions & 4 deletions src/azure-cli-core/azure/cli/core/extension/_resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from pkg_resources import parse_version
from packaging.version import parse

from azure.cli.core.extension import ext_compat_with_cli, WHEEL_INFO_RE
from azure.cli.core.extension._index import get_index_extensions
Expand Down Expand Up @@ -43,10 +43,10 @@ def _is_compatible_with_cli_version(item):
def _is_greater_than_cur_version(cur_version):
if not cur_version:
return None
cur_version_parsed = parse_version(cur_version)
cur_version_parsed = parse(cur_version)

def filter_func(item):
item_version = parse_version(item['metadata']['version'])
item_version = parse(item['metadata']['version'])
if item_version > cur_version_parsed:
return True
logger.debug("Skipping '%s' as %s not greater than current version %s", item['filename'],
Expand Down Expand Up @@ -76,7 +76,7 @@ def resolve_from_index(extension_name, cur_version=None, index_url=None, target_
if not candidates:
raise NoExtensionCandidatesError("No suitable extensions found.")

candidates_sorted = sorted(candidates, key=lambda c: parse_version(c['metadata']['version']), reverse=True)
candidates_sorted = sorted(candidates, key=lambda c: parse(c['metadata']['version']), reverse=True)
logger.debug("Candidates %s", [c['filename'] for c in candidates_sorted])

if target_version:
Expand Down
10 changes: 5 additions & 5 deletions src/azure-cli-core/azure/cli/core/extension/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from subprocess import check_output, STDOUT, CalledProcessError
from urllib.parse import urlparse

from pkg_resources import parse_version
from packaging.version import parse

from azure.cli.core import CommandIndex
from azure.cli.core.util import CLIError, reload_module
Expand Down Expand Up @@ -439,12 +439,12 @@ def list_available_extensions(index_url=None, show_details=False, cli_ctx=None):
if not items:
continue

latest = max(items, key=lambda c: parse_version(c['metadata']['version']))
latest = max(items, key=lambda c: parse(c['metadata']['version']))
installed = False
if name in installed_extension_names:
installed = True
ext_version = get_extension(name).version
if ext_version and parse_version(latest['metadata']['version']) > parse_version(ext_version):
if ext_version and parse(latest['metadata']['version']) > parse(ext_version):
installed = str(True) + ' (upgrade available)'
results.append({
'name': name,
Expand Down Expand Up @@ -473,13 +473,13 @@ def list_versions(extension_name, index_url=None, cli_ctx=None):
results = []
latest_compatible_version = None

for ext in sorted(exts, key=lambda c: parse_version(c['metadata']['version']), reverse=True):
for ext in sorted(exts, key=lambda c: parse(c['metadata']['version']), reverse=True):
compatible = ext_compat_with_cli(ext['metadata'])[0]
ext_version = ext['metadata']['version']
if latest_compatible_version is None and compatible:
latest_compatible_version = ext_version
installed = ext_version == installed_ext.version if installed_ext else False
if installed and parse_version(latest_compatible_version) > parse_version(installed_ext.version):
if installed and parse(latest_compatible_version) > parse(installed_ext.version):
installed = str(True) + ' (upgrade available)'
version = ext['metadata']['version']
if latest_compatible_version == ext_version:
Expand Down
8 changes: 4 additions & 4 deletions src/azure-cli-core/azure/cli/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,10 @@ def _print(val=''):
print(val, file=output)

def _get_version_string(name, version_dict):
from distutils.version import LooseVersion # pylint: disable=import-error,no-name-in-module
from packaging.version import parse # pylint: disable=import-error,no-name-in-module
local = version_dict['local']
pypi = version_dict.get('pypi', None)
if pypi and LooseVersion(pypi) > LooseVersion(local):
if pypi and parse(pypi) > parse(local):
return name.ljust(25) + local.rjust(15) + ' *'
return name.ljust(25) + local.rjust(15)

Expand Down Expand Up @@ -1180,11 +1180,11 @@ def handle_version_update():
"""
try:
from azure.cli.core._session import VERSIONS
from distutils.version import LooseVersion # pylint: disable=import-error,no-name-in-module
from packaging.version import parse # pylint: disable=import-error,no-name-in-module
from azure.cli.core import __version__
if not VERSIONS['versions']:
get_cached_latest_versions()
elif LooseVersion(VERSIONS['versions']['core']['local']) != LooseVersion(__version__):
elif parse(VERSIONS['versions']['core']['local']) != parse(__version__):
logger.debug("Azure CLI has been updated.")
logger.debug("Clean up versions and refresh cloud endpoints information in local files.")
VERSIONS['versions'] = {}
Expand Down
4 changes: 2 additions & 2 deletions src/azure-cli/azure/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def cli_main(cli, args):
version_update_time = datetime.datetime.strptime(VERSIONS[_VERSION_UPDATE_TIME], '%Y-%m-%d %H:%M:%S.%f')
if datetime.datetime.now() > version_update_time + datetime.timedelta(days=11):
get_cached_latest_versions()
from distutils.version import LooseVersion
if LooseVersion(VERSIONS['versions']['core']['local']) < LooseVersion(VERSIONS['versions']['core']['pypi']): # pylint: disable=line-too-long
from packaging.version import parse
if parse(VERSIONS['versions']['core']['local']) < parse(VERSIONS['versions']['core']['pypi']): # pylint: disable=line-too-long
import subprocess
import platform
from azure.cli.core.azclierror import UnclassifiedUserFault # pylint: disable=ungrouped-imports
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/azure/cli/command_modules/acr/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@
- name: Create a Linux task from a public GitHub repository which builds the hello-world image with both a git commit and pull request trigger enabled. Note that this task does not use Source Registry (MyRegistry), so we can explicitly set Auth mode as None for it.
text: |
az acr task create -t hello-world:{{.Run.ID}} -n hello-world -r MyRegistry -f Dockerfile \\
--auth-mode None -c https://github.com/Azure-Samples/acr-build-helloworld-node.git \\
--no-push true --auth-mode None -c https://github.com/Azure-Samples/acr-build-helloworld-node.git \\
--pull-request-trigger-enabled true --git-access-token 000000000000000000000000000000000
- name: Create a Windows task from a public GitHub repository which builds the Azure Container Builder image on Amd64 architecture with only base image trigger enabled.
text: |
Expand Down
2 changes: 2 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acr/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ def load_arguments(self, _): # pylint: disable=too-many-statements

with self.argument_context('acr check-health') as c:
c.argument('ignore_errors', options_list=['--ignore-errors'], help='Provide all health checks, even if errors are found', action='store_true', required=False)
c.argument('vnet', options_list=['--vnet'],
help="Virtual network ID so to run this command inside a VNET to verify the DNS routing to private endpoints", required=False)

with self.argument_context('acr scope-map') as c:
c.argument('registry_name', options_list=['--registry', '-r'])
Expand Down
Loading