-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Users/rok/telemtry in m123 for older version #6823
Changes from 3 commits
29c9e6c
926c90b
34548bf
dcecbde
1600c78
b2eed05
ff30b07
668f8ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,7 @@ $ErrorActionPreference = 'Stop' | |
$deploymentOperation = 'Deployment' | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove all instances of this from this file Write-Telemetry "DTLSDK_Error" $deploymentResponse.DeploymentSummary" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refer #6889 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. @asranja Please review it. |
||
$envOperationStatus = "Passed" | ||
$jobId = $env:SYSTEM_JOBID; | ||
|
||
# enabling detailed logging only when system.debug is true | ||
$enableDetailedLoggingString = $env:system_debug | ||
|
@@ -64,7 +65,63 @@ if ($enableDetailedLoggingString -ne "true") | |
|
||
# Telemetry | ||
Import-Module $PSScriptRoot\ps_modules\TelemetryHelper | ||
# Import all the dlls and modules which have cmdlets we need | ||
Import-Module "$PSScriptRoot\DeploymentUtilities\Microsoft.TeamFoundation.DistributedTask.Task.Deployment.Internal.psm1" | ||
Import-Module "$PSScriptRoot\DeploymentUtilities\Microsoft.TeamFoundation.DistributedTask.Task.Deployment.dll" | ||
|
||
function Write-DTLServiceDeprecationMessageIfRequired | ||
{ | ||
param([string]$machine) | ||
|
||
try | ||
{ | ||
$jsonValue = ConvertFrom-Json $environmentName -ErrorAction Stop; | ||
$validJson = $true; | ||
} | ||
catch | ||
{ | ||
$validJson = $false; | ||
} | ||
|
||
if(!$validJson) | ||
{ | ||
if(-not($machine.Contains('.')) -and -not($machine.Contains(':')) -and -not($machine.Contains(","))) | ||
{ | ||
write-error "Deployments using 'test hub: machine groups' is no longer supported. Refer to https://go.microsoft.com/fwlink/?LinkID=799742&clcid=0x409 for more information or get help from Developer Community [https://developercommunity.visualstudio.com/spaces/21/index.html]." | ||
} | ||
} | ||
} | ||
|
||
function Publish-AzureTelemetry | ||
{ | ||
param([object] $deploymentResponse, | ||
[string] $jobId ) | ||
if($deploymentResponse){ | ||
$jsonString = -join("{") | ||
if([bool]($deploymentResponse.PSobject.Properties.name -match "IsAzureVm")){ | ||
$jsonString = -join( $jsonString, | ||
"`"IsAzureVm`" : `"$($deploymentResponse.IsAzureVm)`"" , | ||
",") | ||
} | ||
if([bool]($deploymentResponse.PSobject.Properties.name -match "VmUuidHash")){ | ||
$jsonString = -join( $jsonString, | ||
"`"VmUuidHash`" : `"$($deploymentResponse.VmUuidHash)`"", | ||
",") | ||
} | ||
if([bool]($deploymentResponse.PSobject.Properties.name -match "TelemetryError")){ | ||
$jsonString = -join( $jsonString, | ||
"`"TelemetryError`" : `"$($deploymentResponse.TelemetryError)`"", | ||
",") | ||
} | ||
|
||
$jsonString = -join( $jsonString, | ||
"`"JobId`" : `"$jobId`"" , "}") | ||
} | ||
|
||
$telemetryString ="##vso[telemetry.publish area=TaskHub;feature=PowerShellOnTargetMachines]$jsonString" | ||
Write-Host $telemetryString | ||
} | ||
|
||
try | ||
{ | ||
$connection = Get-VssConnection -TaskContext $distributedTaskContext | ||
|
@@ -105,6 +162,7 @@ if($runPowershellInParallel -eq "false" -or ( $resources.Count -eq 1 ) ) | |
$status = $deploymentResponse.Status | ||
|
||
Write-Output (Get-LocalizedString -Key "Deployment status for machine '{0}' : '{1}'" -ArgumentList $displayName, $status) | ||
Publish-AzureTelemetry -deploymentResponse $deploymentResponse -jobId $jobId | ||
|
||
if ($status -ne "Passed") | ||
{ | ||
|
@@ -145,6 +203,8 @@ else | |
|
||
Write-ResponseLogs -operationName $deploymentOperation -fqdn $displayName -deploymentResponse $output | ||
Write-Output (Get-LocalizedString -Key "Deployment status for machine '{0}' : '{1}'" -ArgumentList $displayName, $status) | ||
Publish-AzureTelemetry -deploymentResponse $output -jobId $jobId | ||
|
||
if($status -ne "Passed") | ||
{ | ||
$envOperationStatus = "Failed" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
"version": { | ||
"Major": 1, | ||
"Minor": 0, | ||
"Patch": 47 | ||
"Patch": 51 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why from version 47 to 51 ? |
||
}, | ||
"minimumAgentVersion": "1.104.0", | ||
"groups": [ | ||
|
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.
run all our BVT Test before merge