forked from microsoft/AL-Go-Actions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TelemetryHelper.psm1
88 lines (79 loc) · 3.94 KB
/
TelemetryHelper.psm1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
$signals = @{
"DO0070" = "AL-Go action ran: AddExistingApp"
"DO0071" = "AL-Go action ran: CheckForUpdates"
"DO0072" = "AL-Go action ran: CreateApp"
"DO0073" = "AL-Go action ran: CreateDevelopmentEnvironment"
"DO0074" = "AL-Go action ran: CreateReleaseNotes"
"DO0075" = "AL-Go action ran: Deploy"
"DO0076" = "AL-Go action ran: IncrementVersionNumber"
"DO0077" = "AL-Go action ran: PipelineCleanup"
"DO0078" = "AL-Go action ran: ReadSecrets"
"DO0079" = "AL-Go action ran: ReadSettings"
"DO0080" = "AL-Go action ran: RunPipeline"
"DO0090" = "AL-Go workflow ran: AddExistingAppOrTestApp"
"DO0091" = "AL-Go workflow ran: CiCd"
"DO0092" = "AL-Go workflow ran: CreateApp"
"DO0093" = "AL-Go workflow ran: CreateOnlineDevelopmentEnvironment"
"DO0094" = "AL-Go workflow ran: CreateRelease"
"DO0095" = "AL-Go workflow ran: CreateTestApp"
"DO0096" = "AL-Go workflow ran: IncrementVersionNumber"
"DO0097" = "AL-Go workflow ran: PublishToEnvironment"
"DO0098" = "AL-Go workflow ran: UpdateGitHubGoSystemFiles"
"DO0099" = "AL-Go workflow ran: NextMajor"
"DO0100" = "AL-Go workflow ran: NextMinor"
"DO0101" = "AL-Go workflow ran: Current"
"DO0102" = "AL-Go workflow ran: CreatePerformanceTestApp"
}
function CreateScope {
param (
[string] $eventId,
[string] $parentTelemetryScopeJson = '{}'
)
$signalName = $signals[$eventId]
if (-not $signalName) {
throw "Invalid event id ($eventId) is enountered."
}
if ($parentTelemetryScopeJson -and $parentTelemetryScopeJson -ne "{}") {
$telemetryScope = RegisterTelemetryScope $parentTelemetryScopeJson
}
$telemetryScope = InitTelemetryScope -name $signalName -eventId $eventId -parameterValues @() -includeParameters @()
return $telemetryScope
}
function GetHash {
param(
[string] $str
)
$stream = [IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes($str))
(Get-FileHash -InputStream $stream -Algorithm SHA256).Hash
}
# SIG # Begin signature block
# MIIFYQYJKoZIhvcNAQcCoIIFUjCCBU4CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUEylEygkjGgMu1Sf85ZhyPJUm
# MTygggMAMIIC/DCCAeSgAwIBAgIQWIq0Hnul0rVA6V3CGFkRiTANBgkqhkiG9w0B
# AQsFADAWMRQwEgYDVQQDDAtEdWlrbWVlc3RlcjAeFw0yMjA3MTIwOTM4MjVaFw0y
# MzA3MTIwOTU4MjVaMBYxFDASBgNVBAMMC0R1aWttZWVzdGVyMIIBIjANBgkqhkiG
# 9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+rpjbZpCADD9OlTHYX+y0NSVcRHYm9R5ELki
# 1QVeVs2D6vZ1LVjce+0ose1ZCi9202xNgdmoMGKfljvtr1AYtXuROtttk0Sv4r8N
# CZeWmFfqczBAjTu+V5tF9k/bRjr4Ca1Os5JlSY2/JrkykAjI67Ax35JJ9RVuFLYm
# UeYMZyNNvHQAC64Mm2K+lArBl4C82W7s0aHrI8zRVZbC2oibKj/Jq2jKsbO99UUD
# NAyNNkwZBJoQeKc1srf4x+bzxf/AYPJVTJTqZe0NWFSgqqAzr5278ThVo2Gl55vC
# uEr5Xvrh1TCS0ZFym28JBmzFlylv2AP1XNde0aQDTc4F5C41PQIDAQABo0YwRD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