Skip to content

Commit c236a88

Browse files
authored
Remove email fields from kusto schema (#7785)
* Remove email fields from kusto schema * Remove unnecessary columns and add useable URL
1 parent 2d364d5 commit c236a88

File tree

3 files changed

+9
-97
lines changed

3 files changed

+9
-97
lines changed

tools/pipeline-witness/Azure.Sdk.Tools.PipelineWitness/BlobUploadProcessor.cs

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -398,24 +398,8 @@ private async Task UploadBuildDefinitionBlobAsync(string account, BuildDefinitio
398398
Path = definition.Path,
399399
RepositoryId = definition.Repository.Id,
400400
RepositoryName = definition.Repository.Name,
401-
AuthoredByDescriptor = definition.AuthoredBy.Descriptor.ToString(),
402-
AuthoredByDisplayName = definition.AuthoredBy.DisplayName,
403-
AuthoredById = definition.AuthoredBy.Id,
404-
AuthoredByIsContainer = definition.AuthoredBy.IsContainer,
405-
AuthoredByUniqueName = definition.AuthoredBy.UniqueName,
406401
CreatedDate = definition.CreatedDate,
407402
DefaultBranch = definition.Repository.DefaultBranch,
408-
DraftOfId = default(string),
409-
DraftOfName = default(string),
410-
DraftOfProjectId = default(string),
411-
DraftOfProjectName = default(string),
412-
DraftOfProjectRevision = default(string),
413-
DraftOfProjectState = default(string),
414-
DraftOfProjectVisibility = default(string),
415-
DraftOfQueueStatus = default(string),
416-
DraftOfRevision = default(string),
417-
DraftOfType = default(string),
418-
DraftOfUri = default(string),
419403
ProjectName = definition.Project.Name,
420404
ProjectRevision = definition.Project.Revision,
421405
ProjectState = definition.Project.State,
@@ -427,7 +411,7 @@ private async Task UploadBuildDefinitionBlobAsync(string account, BuildDefinitio
427411
QueuePoolName = definition.Queue?.Pool?.Name,
428412
QueueStatus = definition.QueueStatus,
429413
Type = definition.Type,
430-
Uri = definition.Uri,
414+
Url = $"https://dev.azure.com/{account}/{definition.Project.Name}/_build?definitionId={definition.Id}",
431415
BadgeEnabled = definition.BadgeEnabled,
432416
BuildNumberFormat = definition.BuildNumberFormat,
433417
Comment = definition.Comment,
@@ -445,7 +429,7 @@ private async Task UploadBuildDefinitionBlobAsync(string account, BuildDefinitio
445429
Options = definition.Options,
446430
Variables = definition.Variables,
447431
Tags = definition.Tags,
448-
Data = definition,
432+
Triggers = definition.Triggers,
449433
EtlIngestDate = DateTimeOffset.UtcNow
450434
}, jsonSettings);
451435

@@ -548,10 +532,6 @@ private async Task UploadBuildBlobAsync(string account, Build build)
548532
StartTime = build.StartTime,
549533
FinishTime = build.FinishTime,
550534
KeepForever = build.KeepForever,
551-
LastChangedByDisplayName = build.LastChangedBy?.DisplayName,
552-
LastChangedById = build.LastChangedBy?.Id,
553-
LastChangedByIsContainer = build.LastChangedBy?.IsContainer,
554-
LastChangedByUniqueName = build.LastChangedBy?.UniqueName,
555535
LastChangedDate = build.LastChangedDate,
556536
LogsId = build.Logs?.Id,
557537
LogsType = build.Logs?.Type,
@@ -569,23 +549,14 @@ private async Task UploadBuildBlobAsync(string account, Build build)
569549
Reason = build.Reason,
570550
RepositoryCheckoutSubmodules = build.Repository?.CheckoutSubmodules,
571551
RepositoryType = build.Repository?.Type,
572-
RequestedByDisplayName = build.RequestedBy?.DisplayName,
573-
RequestedById = build.RequestedBy?.Id,
574-
RequestedByIsContainer = build.RequestedBy?.IsContainer,
575-
RequestedByUniqueName = build.RequestedBy?.UniqueName,
576-
RequestedForDisplayName = build.RequestedFor?.DisplayName,
577-
RequestedForId = build.RequestedFor?.Id,
578-
RequestedForIsContainer = build.RequestedFor?.IsContainer,
579-
RequestedForUniqueName = build.RequestedFor?.UniqueName,
580552
Result = build.Result,
581553
RetainedByRelease = build.RetainedByRelease,
582554
SourceBranch = build.SourceBranch,
583555
SourceVersion = build.SourceVersion,
584556
Status = build.Status,
585557
Tags = build.Tags?.Any() == true ? JsonConvert.SerializeObject(build.Tags, jsonSettings) : null,
586-
Uri = build.Uri,
558+
Url = $"https://dev.azure.com/{account}/{build.Project.Name}/_build/results?buildId={build.Id}",
587559
ValidationResults = build.ValidationResults,
588-
Data = JsonConvert.SerializeObject(build, jsonSettings),
589560
EtlIngestDate = DateTime.UtcNow,
590561
}, jsonSettings);
591562

@@ -869,7 +840,6 @@ private async Task UploadTestRunBlobAsync(string account, Build build, TestRun t
869840
: testRun.Release?.Id > 0 ? "Release"
870841
: "",
871842
OrganizationId = default(string),
872-
Data = default(string),
873843
EtlIngestDate = DateTime.UtcNow,
874844
}, jsonSettings);
875845

tools/pipeline-witness/infrastructure/kusto/tables/Build.kql

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818
StartTime: datetime,
1919
FinishTime: datetime,
2020
KeepForever: bool,
21-
LastChangedByDisplayName: string,
22-
LastChangedById: string,
23-
LastChangedByIsContainer: bool,
24-
LastChangedByUniqueName: string,
2521
LastChangedDate: datetime,
2622
LogsId: long,
2723
LogsType: string,
@@ -39,23 +35,14 @@
3935
Reason: string,
4036
RepositoryCheckoutSubmodules: bool,
4137
RepositoryType: string,
42-
RequestedByDisplayName: string,
43-
RequestedById: string,
44-
RequestedByIsContainer: bool,
45-
RequestedByUniqueName: string,
46-
RequestedForDisplayName: string,
47-
RequestedForId: string,
48-
RequestedForIsContainer: bool,
49-
RequestedForUniqueName: string,
5038
Result: string,
5139
RetainedByRelease: string,
5240
SourceBranch: string,
5341
SourceVersion: string,
5442
Status: string,
5543
Tags: string,
56-
Uri: string,
44+
Url: string,
5745
ValidationResults: string,
58-
Data: string,
5946
EtlIngestDate: datetime
6047
) with (folder='', docstring='')
6148

@@ -79,10 +66,6 @@
7966
{ "column": "StartTime", "path": "$['startTime']" },
8067
{ "column": "FinishTime", "path": "$['finishTime']" },
8168
{ "column": "KeepForever", "path": "$['keepForever']" },
82-
{ "column": "LastChangedByDisplayName", "path": "$['lastChangedByDisplayName']" },
83-
{ "column": "LastChangedById", "path": "$['lastChangedById']" },
84-
{ "column": "LastChangedByIsContainer", "path": "$['lastChangedByIsContainer']" },
85-
{ "column": "LastChangedByUniqueName", "path": "$['lastChangedByUniqueName']" },
8669
{ "column": "LastChangedDate", "path": "$['lastChangedDate']" },
8770
{ "column": "LogsId", "path": "$['logsId']" },
8871
{ "column": "LogsType", "path": "$['logsType']" },
@@ -100,22 +83,13 @@
10083
{ "column": "Reason", "path": "$['reason']" },
10184
{ "column": "RepositoryCheckoutSubmodules", "path": "$['repositoryCheckoutSubmodules']" },
10285
{ "column": "RepositoryType", "path": "$['repositoryType']" },
103-
{ "column": "RequestedByDisplayName", "path": "$['requestedByDisplayName']" },
104-
{ "column": "RequestedById", "path": "$['requestedById']" },
105-
{ "column": "RequestedByIsContainer", "path": "$['requestedByIsContainer']" },
106-
{ "column": "RequestedByUniqueName", "path": "$['requestedByUniqueName']" },
107-
{ "column": "RequestedForDisplayName", "path": "$['requestedForDisplayName']" },
108-
{ "column": "RequestedForId", "path": "$['requestedForId']" },
109-
{ "column": "RequestedForIsContainer", "path": "$['requestedForIsContainer']" },
110-
{ "column": "RequestedForUniqueName", "path": "$['requestedForUniqueName']" },
11186
{ "column": "Result", "path": "$['result']" },
11287
{ "column": "RetainedByRelease", "path": "$['retainedByRelease']" },
11388
{ "column": "SourceBranch", "path": "$['sourceBranch']" },
11489
{ "column": "SourceVersion", "path": "$['sourceVersion']" },
11590
{ "column": "Status", "path": "$['status']" },
11691
{ "column": "Tags", "path": "$['tags']" },
117-
{ "column": "Uri", "path": "$['uri']" },
92+
{ "column": "Url", "path": "$['url']" },
11893
{ "column": "ValidationResults", "path": "$['validationResults']" },
119-
{ "column": "Data", "path": "$['data']" },
12094
{ "column": "EtlIngestDate", "path": "$['etlIngestDate']" }
12195
]```

tools/pipeline-witness/infrastructure/kusto/tables/BuildDefinition.kql

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,8 @@
77
Path: string,
88
RepositoryId: string,
99
RepositoryName: string,
10-
AuthoredByDescriptor: string,
11-
AuthoredByDisplayName: string,
12-
AuthoredById: string,
13-
AuthoredByIsContainer: string,
14-
AuthoredByUniqueName: string,
1510
CreatedDate: datetime,
1611
DefaultBranch: string,
17-
DraftOfId: long,
18-
DraftOfName: string,
19-
DraftOfProjectId: string,
20-
DraftOfProjectName: string,
21-
DraftOfProjectRevision: long,
22-
DraftOfProjectState: string,
23-
DraftOfProjectVisibility: string,
24-
DraftOfQueueStatus: string,
25-
DraftOfRevision: long,
26-
DraftOfType: string,
27-
DraftOfUri: string,
2812
ProjectName: string,
2913
ProjectRevision: long,
3014
ProjectState: string,
@@ -36,7 +20,7 @@
3620
QueuePoolName: string,
3721
QueueStatus: string,
3822
Type: string,
39-
Uri: string,
23+
Url: string,
4024
BadgeEnabled: bool,
4125
BuildNumberFormat: string,
4226
Comment: string,
@@ -55,7 +39,7 @@
5539
Options: string,
5640
Variables: string,
5741
Tags: string,
58-
Data: string,
42+
Triggers: dynamic,
5943
EtlIngestDate: datetime
6044
) with (folder='', docstring='')
6145

@@ -68,24 +52,8 @@
6852
{ "column": "Path", "path": "$['path']" },
6953
{ "column": "RepositoryId", "path": "$['repositoryId']" },
7054
{ "column": "RepositoryName", "path": "$['repositoryName']" },
71-
{ "column": "AuthoredByDescriptor", "path": "$['authoredByDescriptor']" },
72-
{ "column": "AuthoredByDisplayName", "path": "$['authoredByDisplayName']" },
73-
{ "column": "AuthoredById", "path": "$['authoredById']" },
74-
{ "column": "AuthoredByIsContainer", "path": "$['authoredByIsContainer']" },
75-
{ "column": "AuthoredByUniqueName", "path": "$['authoredByUniqueName']" },
7655
{ "column": "CreatedDate", "path": "$['createdDate']" },
7756
{ "column": "DefaultBranch", "path": "$['defaultBranch']" },
78-
{ "column": "DraftOfId", "path": "$['draftOfId']" },
79-
{ "column": "DraftOfName", "path": "$['draftOfName']" },
80-
{ "column": "DraftOfProjectId", "path": "$['draftOfProjectId']" },
81-
{ "column": "DraftOfProjectName", "path": "$['draftOfProjectName']" },
82-
{ "column": "DraftOfProjectRevision", "path": "$['draftOfProjectRevision']" },
83-
{ "column": "DraftOfProjectState", "path": "$['draftOfProjectState']" },
84-
{ "column": "DraftOfProjectVisibility", "path": "$['draftOfProjectVisibility']" },
85-
{ "column": "DraftOfQueueStatus", "path": "$['draftOfQueueStatus']" },
86-
{ "column": "DraftOfRevision", "path": "$['draftOfRevision']" },
87-
{ "column": "DraftOfType", "path": "$['draftOfType']" },
88-
{ "column": "DraftOfUri", "path": "$['draftOfUri']" },
8957
{ "column": "ProjectName", "path": "$['projectName']" },
9058
{ "column": "ProjectRevision", "path": "$['projectRevision']" },
9159
{ "column": "ProjectState", "path": "$['projectState']" },
@@ -97,7 +65,7 @@
9765
{ "column": "QueuePoolName", "path": "$['queuePoolName']" },
9866
{ "column": "QueueStatus", "path": "$['queueStatus']" },
9967
{ "column": "Type", "path": "$['type']" },
100-
{ "column": "Uri", "path": "$['uri']" },
68+
{ "column": "Url", "path": "$['url']" },
10169
{ "column": "BadgeEnabled", "path": "$['badgeEnabled']" },
10270
{ "column": "BuildNumberFormat", "path": "$['buildNumberFormat']" },
10371
{ "column": "Comment", "path": "$['comment']" },
@@ -116,6 +84,6 @@
11684
{ "column": "Options", "path": "$['options']" },
11785
{ "column": "Variables", "path": "$['variables']" },
11886
{ "column": "Tags", "path": "$['tags']" },
119-
{ "column": "Data", "path": "$['data']" },
87+
{ "column": "Triggers", "path": "$['triggers']" },
12088
{ "column": "EtlIngestDate", "path": "$['etlIngestDate']" }
12189
]```

0 commit comments

Comments
 (0)