Skip to content

Commit 7d2edb6

Browse files
authored
Merge branch 'Azure:dev' into resilv/help-eval
2 parents 5a6a8cd + 1d853bd commit 7d2edb6

File tree

45 files changed

+73670
-4175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+73670
-4175
lines changed

.vscode/launch.json

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"configurations": [
44
{
55
"name": "Azure CLI Debug (Integrated Console)",
6-
"type": "python",
6+
"type": "debugpy",
77
"request": "launch",
88
"python": "${command:python.interpreterPath}",
99
"program": "${workspaceRoot}/src/azure-cli/azure/cli/__main__.py",
@@ -12,33 +12,24 @@
1212
"--help"
1313
],
1414
"console": "integratedTerminal",
15-
"debugOptions": [
16-
"WaitOnAbnormalExit",
17-
"WaitOnNormalExit",
18-
"RedirectOutput"
19-
],
2015
"justMyCode": false
2116
},
2217
{
2318
"name": "Azure CLI Debug (External Console)",
24-
"type": "python",
19+
"type": "debugpy",
2520
"request": "launch",
2621
"stopOnEntry": true,
2722
"python": "${command:python.interpreterPath}",
2823
"program": "${workspaceRoot}/src/azure-cli/azure/cli/__main__.py",
2924
"cwd": "${workspaceRoot}",
3025
"args": [
31-
"--help"
26+
"--version"
3227
],
3328
"console": "externalTerminal",
34-
"debugOptions": [
35-
"WaitOnAbnormalExit",
36-
"WaitOnNormalExit"
37-
]
3829
},
3930
{
4031
"name": "Azdev Scripts",
41-
"type": "python",
32+
"type": "debugpy",
4233
"request": "launch",
4334
"python": "${command:python.interpreterPath}",
4435
"program": "${workspaceRoot}/tools/automation/__main__.py",
@@ -47,11 +38,6 @@
4738
"--help"
4839
],
4940
"console": "integratedTerminal",
50-
"debugOptions": [
51-
"WaitOnAbnormalExit",
52-
"WaitOnNormalExit",
53-
"RedirectOutput"
54-
]
5541
}
5642
]
57-
}
43+
}

src/azure-cli-core/azure/cli/core/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ def get_cli_version(self):
120120

121121
def show_version(self):
122122
from azure.cli.core.util import get_az_version_string, show_updates
123+
from azure.cli.core import telemetry
124+
125+
telemetry.set_command_details(command="", parameters=["--version"])
123126

124127
ver_string, updates_available_components = get_az_version_string()
125128
print(ver_string)

src/azure-cli-core/azure/cli/core/tests/test_telemetry.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# --------------------------------------------------------------------------------------------
55

66
import unittest
7+
from unittest import mock
78

89

910
class TestCoreTelemetry(unittest.TestCase):
@@ -57,3 +58,24 @@ def test_cloud_forbid_telemetry(self):
5758
# mock to add current cloud name in CLOUDS_FORBIDDING_TELEMETRY
5859
with mock.patch('azure.cli.core.cloud.CLOUDS_FORBIDDING_TELEMETRY', [az_cli.cloud.name]):
5960
self.assertFalse(telemetry.is_telemetry_enabled())
61+
62+
@mock.patch('azure.cli.core.util.get_az_version_string')
63+
def test_show_version_sets_telemetry_params(self, mock_get_version):
64+
"""Test show_version telemetry state is same regardless of available updates."""
65+
from azure.cli.core.mock import DummyCli
66+
from azure.cli.core import telemetry
67+
from knack.completion import ARGCOMPLETE_ENV_NAME
68+
69+
mock_get_version.return_value = ("azure-cli 2.80.0", ["core", "extension1"])
70+
71+
telemetry.start()
72+
73+
cli = DummyCli()
74+
telemetry.set_application(cli, ARGCOMPLETE_ENV_NAME)
75+
76+
cli.show_version()
77+
78+
session = telemetry._session
79+
self.assertEqual(session.command, "")
80+
self.assertEqual(session.parameters, ["--version"])
81+
self.assertIsNone(session.raw_command)

src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/application_gateway/__cmd_group.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#
55
# Code generated by aaz-dev-tools
66
# --------------------------------------------------------------------------------------------
7-
# swagger change: https://github.com/Azure/azure-rest-api-specs/pull/24526
87

98
# pylint: skip-file
109
# flake8: noqa

0 commit comments

Comments
 (0)