Skip to content

Commit f9b1289

Browse files
authored
Update Az Predictor version with new telemetry property name (#21615)
* Add more test cases * Rename the two property names * Update the version * Add more test cases
1 parent a3a1e8c commit f9b1289

File tree

6 files changed

+23
-6
lines changed

6 files changed

+23
-6
lines changed

tools/Az.Tools.Predictor/Az.Tools.Predictor.Test/AzPredictorTelemetryTests.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ public AzPredictorTelemetryTests(ModelFixture modelFixture)
5555
[InlineData(@"C:\Users\MyName\exe")]
5656
[InlineData(@"az storage")]
5757
[InlineData(@"get")]
58+
[InlineData(@"-StorageAccountKey""xxx""NewAzStorageContainer -context xxx")]
59+
[InlineData(@"-StorageAccountKey\""xxx\""NewAzStorageContainer -context xxx")]
60+
[InlineData(@"-StorageAccountKey""xxx""New-AzStorageContainer -context xxx")]
61+
[InlineData(@"New-AzureStorageContext-StorageAccountName ""xxx"" -StorageAccountKey ""xxx""")]
62+
[InlineData(@"sig=xxxxxxxxxxx/Sensor-Azure")]
63+
[InlineData(@"sig=Signature/Test-Sensor-Azu")]
5864
public async Task VerifyOnCommandLineAcceptedForOneUnsupportedCommandHistory(string inputData)
5965
{
6066
var expectedTelemetryCount = 2;
@@ -151,6 +157,7 @@ public async Task VerifyOnCommandLineAcceptedForOneSupportedCommandWithoutParame
151157
[InlineData("Get-AzRoleAssignment -ObjectId ***", "Remove-AzRoleAssignment -RoleDefinitionId (Get-AzRoleAssignment -ObjectId xxxx)")]
152158
[InlineData("Get-AzResourceGroup -Location:***", "Get-AzResourceGroup rg1 -Location:WestUS3")]
153159
[InlineData("Get-AzResourceGroup", "Get-AzResourceGroup rg1 WestUS3")]
160+
[InlineData("New-AzureStorageContext -StorageAccountKey *** -StorageAccountName ***", @"New-AzureStorageContext -StorageAccountName ""accountName"" -StorageAccountKey ""accountKey""")]
154161
public async Task VerifyOnCommandLineAcceptedForOneSupportedCommandWithParameter(string expectedValue, string inputData)
155162
{
156163
var expectedTelemetryCount = 2;
@@ -556,8 +563,15 @@ public async Task VerifyOnCommandLineAcceptedException()
556563
[InlineData("Set-Az", "Set-Az")]
557564
[InlineData("Get-azR", "Get-azR")]
558565
[InlineData("start_of_snippet", "NonVerb-AzResource")]
559-
[InlineData("start_of_snippet", "Get")]
560-
[InlineData("start_of_snippet", "Set-")]
566+
[InlineData("Get", "Get")]
567+
[InlineData("Set-", "Set-")]
568+
[InlineData("New-AzureStorageContext -StorageAccountKey *** -StorageAccountName ***", @"New-AzureStorageContext -StorageAccountName ""accountName"" -StorageAccountKey ""accountKey""")]
569+
[InlineData("start_of_snippet", @"-StorageAccountKey""xxx""NewAzStorageContainer -context xxx")]
570+
[InlineData("start_of_snippet", @"-StorageAccountKey\""xxx\""NewAzStorageContainer -context xxx")]
571+
[InlineData("start_of_snippet", @"-StorageAccountKey""xxx""New-AzStorageContainer -context xxx")]
572+
[InlineData("start_of_snippet", @"New-AzureStorageContext-StorageAccountName ""xxx"" -StorageAccountKey ""xxx""")]
573+
[InlineData("start_of_snippet", @"sig=xxxxxxxxxxx/Sensor-Azure")]
574+
[InlineData("start_of_snippet", @"sig=Signature/Test-Sensor-Azu")]
561575
public void VerifyUserInputInGetSuggestionEvent(string expectedUserInput, string input)
562576
{
563577
var expectedTelemetryCount = 1;

tools/Az.Tools.Predictor/Az.Tools.Predictor/Az.Tools.Predictor.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
RootModule = 'Az.Tools.Predictor.psm1'
1212

1313
# Version number of this module.
14-
ModuleVersion = '1.1.0'
14+
ModuleVersion = '1.1.1'
1515

1616
# Supported PSEditions
1717
CompatiblePSEditions = 'Core'

tools/Az.Tools.Predictor/Az.Tools.Predictor/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
-->
2020
## Upcoming Release
2121

22+
## Version 1.1.1
23+
* Updated data collection mechanism
24+
2225
## Version 1.1.0
2326
* Updated data collection mechanism
2427

tools/Az.Tools.Predictor/Az.Tools.Predictor/Telemetry/GetSuggestionTelemetryData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public sealed class GetSuggestionTelemetryData : ITelemetryData
3636
/// <summary>
3737
/// The telemetry property name for "Prediction".
3838
/// </summary>
39-
public const string PropertyNamePrediction = "Prediction";
39+
public const string PropertyNamePrediction = "Prediction2";
4040

4141
/// <summary>
4242
/// The telemetry property name for "SuggestionSessionId".

tools/Az.Tools.Predictor/Az.Tools.Predictor/Telemetry/HistoryTelemetryData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public sealed class HistoryTelemetryData : ITelemetryData
2424
/// <summary>
2525
/// The telemetry property name for "Command".
2626
/// </summary>
27-
public const string PropertyNameCommand = "Command";
27+
public const string PropertyNameCommand = "Command2";
2828

2929
/// <summary>
3030
/// The telemetry property name for "Success".

tools/Az.Tools.Predictor/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>net6.0</TargetFramework>
55
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
66
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
7-
<Version>1.1.0</Version>
7+
<Version>1.1.1</Version>
88
<Authors>Microsoft Corporation</Authors>
99
<Company>Microsoft Corporation</Company>
1010
<Copyright>Microsoft Corporation. All rights reserved.</Copyright>

0 commit comments

Comments
 (0)