Changed to long types

122517
This commit is contained in:
Mike Phares 2024-10-21 13:58:48 -07:00
parent 983448cfb3
commit 1241bbe622
8 changed files with 368 additions and 33 deletions

View File

@ -3,6 +3,7 @@ using Adaptation.Shared;
using Adaptation.Shared.Duplicator; using Adaptation.Shared.Duplicator;
using Adaptation.Shared.Methods; using Adaptation.Shared.Methods;
using log4net; using log4net;
using Microsoft.VisualStudio.Services.Common;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
@ -62,9 +63,21 @@ public class ProcessData : IProcessData
if (!Directory.Exists(destinationDirectory)) if (!Directory.Exists(destinationDirectory))
_ = Directory.CreateDirectory(destinationDirectory); _ = Directory.CreateDirectory(destinationDirectory);
string json = File.ReadAllText(logistics.ReportFullPath); string json = File.ReadAllText(logistics.ReportFullPath);
WorkItem[]? workItems = JsonSerializer.Deserialize<WorkItem[]>(json); // WorkItem[]? workItems = JsonSerializer.Deserialize<WorkItem[]>(json);
if (workItems is null) // if (workItems is null)
throw new Exception(nameof(workItems)); // throw new Exception(nameof(workItems));
JsonElement[]? jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json);
if (jsonElements is null)
throw new Exception(nameof(jsonElements));
WorkItem? workItem;
List<WorkItem> workItems = new();
foreach (JsonElement jsonElement in jsonElements)
{
workItem = JsonSerializer.Deserialize<WorkItem>(jsonElement.ToString());
if (workItem is null)
continue;
workItems.Add(workItem);
}
List<char> spaces = new(); List<char> spaces = new();
List<string> lines = new(); List<string> lines = new();
ReadOnlyCollection<WorkItem> results; ReadOnlyCollection<WorkItem> results;
@ -72,7 +85,7 @@ public class ProcessData : IProcessData
ReadOnlyCollection<Record> records = new(keyValuePairs.Values.ToArray()); ReadOnlyCollection<Record> records = new(keyValuePairs.Values.ToArray());
ReadOnlyCollection<string> bugUserStoryWorkItemTypes = new(new string[] { "Bug", "User Story" }); ReadOnlyCollection<string> bugUserStoryWorkItemTypes = new(new string[] { "Bug", "User Story" });
ReadOnlyCollection<string> bugUserStoryTaskWorkItemTypes = new(new string[] { "Bug", "User Story", "Task" }); ReadOnlyCollection<string> bugUserStoryTaskWorkItemTypes = new(new string[] { "Bug", "User Story", "Task" });
WriteFiles(fileRead, destinationDirectory, fileInfoCollection, records, "with-parents"); WriteWithPartentsFile(fileRead, destinationDirectory, fileInfoCollection, records, "with-parents");
foreach (string workItemType in workItemTypes) foreach (string workItemType in workItemTypes)
{ {
lines.Clear(); lines.Clear();
@ -128,6 +141,15 @@ public class ProcessData : IProcessData
WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, "check-123067"); WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, "check-123067");
_Details.Add(results); _Details.Add(results);
} }
{
lines.Clear();
string workItemType = "Feature";
lines.Add($"# {nameof(FeatureCheckStart122517)}");
lines.Add(string.Empty);
results = FeatureCheckStart122517(url, lines, bugUserStoryTaskWorkItemTypes, records, workItemType);
WriteFiles(fileRead, destinationDirectory, fileInfoCollection, new(lines), results, "check-122517");
_Details.Add(results);
}
} }
private static void WriteFiles(IFileRead fileRead, string destinationDirectory, List<FileInfo> fileInfoCollection, ReadOnlyCollection<string> lines, ReadOnlyCollection<WorkItem> workItems, string fileName) private static void WriteFiles(IFileRead fileRead, string destinationDirectory, List<FileInfo> fileInfoCollection, ReadOnlyCollection<string> lines, ReadOnlyCollection<WorkItem> workItems, string fileName)
@ -155,7 +177,7 @@ public class ProcessData : IProcessData
fileInfoCollection.Add(new(jsonFile)); fileInfoCollection.Add(new(jsonFile));
} }
private static ReadOnlyDictionary<int, Record> GetWorkItems(WorkItem[] workItems) private static ReadOnlyDictionary<int, Record> GetWorkItems(IEnumerable<WorkItem> workItems)
{ {
ReadOnlyDictionary<int, Record> results; ReadOnlyDictionary<int, Record> results;
Dictionary<int, WorkItem> keyValuePairs = new(); Dictionary<int, WorkItem> keyValuePairs = new();
@ -165,9 +187,10 @@ public class ProcessData : IProcessData
return results; return results;
} }
private static void WriteFiles(IFileRead fileRead, string destinationDirectory, List<FileInfo> fileInfoCollection, ReadOnlyCollection<Record> records, string fileName) private static void WriteWithPartentsFile(IFileRead fileRead, string destinationDirectory, List<FileInfo> fileInfoCollection, ReadOnlyCollection<Record> records, string fileName)
{ {
string json = JsonSerializer.Serialize(records, new JsonSerializerOptions() { WriteIndented = true }); Record[] features = (from l in records where l.WorkItem.WorkItemType == "Feature" select l).ToArray();
string json = JsonSerializer.Serialize(features, new JsonSerializerOptions() { WriteIndented = true });
string jsonFile = Path.Combine(destinationDirectory, $"{fileName}.json"); string jsonFile = Path.Combine(destinationDirectory, $"{fileName}.json");
string jsonOld = !File.Exists(jsonFile) ? string.Empty : File.ReadAllText(jsonFile); string jsonOld = !File.Exists(jsonFile) ? string.Empty : File.ReadAllText(jsonFile);
if (json != jsonOld) if (json != jsonOld)
@ -612,6 +635,28 @@ public class ProcessData : IProcessData
return new(results); return new(results);
} }
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching122517(Record record, ReadOnlyCollection<WorkItem> workItems)
{
List<WorkItem> results = new();
if (record.WorkItem.StartDate is null)
throw new Exception();
DateTime dateTime = record.WorkItem.StartDate.Value;
List<KeyValuePair<long, WorkItem>> collection = new();
foreach (WorkItem workItem in workItems)
{
if (workItem.State is "Removed")
continue;
if (workItem.ActivatedDate is null)
continue;
if (dateTime >= workItem.ActivatedDate.Value)
continue;
collection.Add(new(workItem.ActivatedDate.Value.Ticks, workItem));
}
foreach (KeyValuePair<long, WorkItem> keyValuePair in collection.OrderByDescending(l => l.Key))
results.Add(keyValuePair.Value);
return new(results);
}
private static ReadOnlyCollection<WorkItem> FeatureCheckState123066(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyCollection<Record> records, string workItemType) private static ReadOnlyCollection<WorkItem> FeatureCheckState123066(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyCollection<Record> records, string workItemType)
{ {
List<WorkItem> results = new(); List<WorkItem> results = new();
@ -684,4 +729,42 @@ public class ProcessData : IProcessData
return new(results); return new(results);
} }
private static ReadOnlyCollection<WorkItem> FeatureCheckStart122517(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyCollection<Record> records, string workItemType)
{
List<WorkItem> results = new();
List<string> collection = new();
List<string> violations = new();
ReadOnlyCollection<WorkItem> childrenWorkItems;
ReadOnlyCollection<WorkItem> workItemsNotMatching;
foreach (Record record in records)
{
if (record.WorkItem.State is "Removed")
continue;
if (record.WorkItem.WorkItemType != workItemType)
continue;
collection.Clear();
violations.Clear();
if (record.Children.Count == 0)
continue;
if (record.WorkItem.StartDate is null)
continue;
childrenWorkItems = FilterChildren(workItemTypes, record);
workItemsNotMatching = GetWorkItemsNotMatching122517(record, childrenWorkItems);
if (workItemsNotMatching.Count == 0)
continue;
collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
collection.Add(string.Empty);
collection.Add($"- [{record.WorkItem.Id}]({url}{record.WorkItem.Id})");
foreach (WorkItem workItem in workItemsNotMatching)
collection.Add($"- [ ] [{workItem.Id}]({url}{workItem.Id}) {nameof(record.WorkItem.ActivatedDate)} != {record.WorkItem.ActivatedDate}");
collection.Add(string.Empty);
lines.AddRange(collection);
violations.Add($"StartDate:{record.WorkItem.StartDate};");
foreach (WorkItem workItem in workItemsNotMatching)
violations.Add($"<a target='_blank' href='{url}{workItem.Id}'>{workItem.Id}</a>:{workItem.ActivatedDate};");
results.Add(WorkItem.Get(record.WorkItem, string.Join(" ", violations)));
}
return new(results);
}
} }

View File

@ -119,15 +119,16 @@ public class FileRead : Shared.FileRead, IFileRead
foreach (Value value in valueWithReqCollection) foreach (Value value in valueWithReqCollection)
{ {
fields = value.Fields; fields = value.Fields;
workItem = new(fields.SystemAreaPath, workItem = new(fields.MicrosoftVSTSCommonActivatedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonActivatedDate,
fields.SystemAreaPath,
fields.SystemAssignedTo?.DisplayName, fields.SystemAssignedTo?.DisplayName,
fields.MicrosoftVSTSCommonBusinessValue == 0 ? null : fields.MicrosoftVSTSCommonBusinessValue, fields.MicrosoftVSTSCommonBusinessValue is null or 0 ? null : (long)fields.MicrosoftVSTSCommonBusinessValue,
fields.SystemChangedDate, fields.SystemChangedDate,
fields.MicrosoftVSTSCommonClosedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonClosedDate, fields.MicrosoftVSTSCommonClosedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonClosedDate,
fields.SystemCommentCount, fields.SystemCommentCount,
fields.SystemCreatedDate, fields.SystemCreatedDate,
fields.SystemDescription, fields.SystemDescription,
fields.MicrosoftVSTSSchedulingEffort == 0 ? null : fields.MicrosoftVSTSSchedulingEffort, fields.MicrosoftVSTSSchedulingEffort is null or 0 ? null : (long)fields.MicrosoftVSTSSchedulingEffort,
value.Id, value.Id,
fields.SystemIterationPath, fields.SystemIterationPath,
fields.SystemParent == 0 ? null : fields.SystemParent, fields.SystemParent == 0 ? null : fields.SystemParent,
@ -136,15 +137,15 @@ public class FileRead : Shared.FileRead, IFileRead
fields.CustomRequester?.DisplayName, fields.CustomRequester?.DisplayName,
fields.MicrosoftVSTSCommonResolvedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonResolvedDate, fields.MicrosoftVSTSCommonResolvedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonResolvedDate,
value.Rev, value.Rev,
fields.CustomRRminusOE == 0 ? null : fields.CustomRRminusOE, fields.CustomRRminusOE is null or 0 ? null : (long)fields.CustomRRminusOE,
fields.MicrosoftVSTSSchedulingStartDate == DateTime.MinValue ? null : fields.MicrosoftVSTSSchedulingStartDate, fields.MicrosoftVSTSSchedulingStartDate == DateTime.MinValue ? null : fields.MicrosoftVSTSSchedulingStartDate,
fields.SystemState, fields.SystemState,
fields.SystemTags, fields.SystemTags,
fields.MicrosoftVSTSSchedulingTargetDate == DateTime.MinValue ? null : fields.MicrosoftVSTSSchedulingTargetDate, fields.MicrosoftVSTSSchedulingTargetDate == DateTime.MinValue ? null : fields.MicrosoftVSTSSchedulingTargetDate,
fields.MicrosoftVSTSCommonTimeCriticality == 0 ? null : fields.MicrosoftVSTSCommonTimeCriticality, fields.MicrosoftVSTSCommonTimeCriticality is null or 0 ? null : (long)fields.MicrosoftVSTSCommonTimeCriticality,
fields.SystemTitle, fields.SystemTitle,
null, null,
fields.CustomWSJF == 0 ? null : fields.CustomWSJF, fields.CustomWSJF is null or 0 ? null : (long)fields.CustomWSJF,
fields.SystemWorkItemType); fields.SystemWorkItemType);
results.Add(workItem); results.Add(workItem);
} }

View File

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Infineon - 122517 - Children of a Feature should have the same priority</title>
<link href="/styles/bootstrap.min.css?no-cache=2024-10-04-08-34" rel="stylesheet" />
<link href="/igniteui/css/themes/bootstrap3/default/infragistics.theme.css?v=2024-10-07-18-50" rel="stylesheet" />
<link href="/igniteui/css/structure/infragistics.css?v=2024-10-07-18-50" rel="stylesheet" />
<link href="/styles/122517.css?no-cache=2024-10-04-08-34" rel="stylesheet" />
<script src="/js/jquery-3.6.0.min.js?v=2024-10-07-18-50" type="text/javascript"></script>
<script src="/js/jquery-ui.min.js?v=2024-10-07-18-50" type="text/javascript"></script>
<script src="/js/122517.js?v=2024-10-07-18-50" type="text/javascript"></script>
<script src="/igniteui/js/infragistics.core.js?v=2024-10-07-18-50" type="text/javascript"></script>
<script src="/igniteui/js/infragistics.lob.js?v=2024-10-07-18-50" type="text/javascript"></script>
<script src="/igniteui/js/infragistics.dv.js?v=2024-10-07-18-50" type="text/javascript"></script>
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div class="navbar-brand" style="min-width: 20px;">
<span id="siteHeader">&nbsp;</span> - 122517 - Children of a Feature should have the same priority
</div>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a target="_blank" href="https://tfs.intra.infineon.com/tfs/FactoryIntegration/ART%20SPS/_workitems/edit/122517">122517</a></li>
</ul>
<p class="navbar-text navbar-right">
&nbsp;
</p>
</div>
</div>
</div>
<div class="container-fluid body-content" style="margin-top: 10px;">
<div style="height: 550px;" id="HeaderGridDiv">
<table id="HeaderGrid"></table>
</div>
<br />&nbsp;
<div id="AllGridDiv">
<table id="AllGrid"></table>
</div>
</div>
<script>
$(document).ready(function () {
initIndex("/markdown/check-122517.json?v=2024-10-07-18-50");
});
</script>
</body>
</html>

View File

@ -0,0 +1,157 @@
function compareFunction(a, b) {
return a.Priority[0] - b.Priority[0] || a.TimeCriticality[0] - b.TimeCriticality[0] || b.State[0] - a.State[0] || a.Id - b.Id;
}
function showOne(rowData) {
if (rowData == null)
return;
var data = [];
data.push({ name: "Edit in ADO", value: '<a target="_blank" href="https://tfs.intra.infineon.com/tfs/FactoryIntegration/ART%20SPS/_workitems/edit/' + rowData["Id"] + '">Edit in ADO ' + rowData["Id"] + '</a>' });
for (const property in rowData) {
if (rowData[property] == null)
continue;
data.push({ name: property, value: rowData[property].toString() });
}
$("#AllGrid").igGrid({
autoGenerateColumns: true,
dataSource: data,
width: "100%",
showHeader: false,
});
}
function loadOne() {
var selectedRow = $("#HeaderGrid").data("igGridSelection").selectedRow();
if (selectedRow == null)
return;
var rowData = $("#HeaderGrid").data("igGrid").dataSource.dataView()[selectedRow.index];
showOne(rowData);
}
function detailSelectionChangedRunInfo(evt, ui) {
if (ui.row.index === 0)
return;
var rowData = ui.owner.grid.dataSource.dataView()[ui.row.index];
showOne(rowData);
}
function getState(state) {
var result;
if (state == null)
result = "9-Null";
else if (state === "New")
result = `1-${state}`;
else if (state === "Active")
result = `2-${state}`;
else if (state === "Resolved")
result = `3-${state}`;
else if (state === "Closed")
result = `4-${state}`;
else if (state === "Removed")
result = `5-${state}`;
else
result = `8-${state}`;
return result;
}
function getPriority(workItemType, priority) {
var result;
if (workItemType === "Bug")
result = "0-Bug";
else if (priority == null || priority === 0)
result = "9-Null";
else if (priority === 1)
result = `${priority}-High`;
else if (priority === 2)
result = `${priority}-Med`;
else if (priority === 3)
result = `${priority}-Low`;
else if (priority === 4)
result = `${priority}-TBD`;
else
result = "8-Not";
return result;
}
function getWorkItems(data) {
var workItem;
var workItems = [];
for (var i = data.length - 1; i > -1; i--) {
workItem = data[i];
if (workItem.Tags != null && workItem.Tags.includes("Ignore"))
continue;
if ((window.location.href.indexOf('=LEO') > -1 && workItem.AreaPath !== 'ART SPS\\LEO') || (window.location.href.indexOf('=MES') > -1 && workItem.AreaPath !== 'ART SPS\\MES'))
continue;
workItem["State"] = getState(workItem["State"])
workItem["Priority"] = getPriority(workItem["WorkItemType"], workItem["Priority"])
workItems.push(workItem);
}
workItems.sort(compareFunction);
return workItems;
}
function updateSite() {
if (window.location.href.indexOf('=LEO') > -1) {
document.title = document.title.replace("Infineon", "HiRel (Leominster)");
document.getElementById("siteHeader").innerText = "HiRel (Leominster)";
}
else if (window.location.href.indexOf('=MES') > -1) {
document.title = document.title.replace("Infineon", "Mesa");
document.getElementById("siteHeader").innerText = "Mesa";
}
else {
document.title = document.title.replace("Infineon", "Infineon");
document.getElementById("siteHeader").innerText = "Infineon";
}
}
function initIndex(url) {
updateSite();
$.getJSON(url, { _: new Date().getTime() }, function (data) {
var workItems = getWorkItems(data);
console.log(data.length);
if (data.length > 0)
console.log(data[0]);
$("#HeaderGrid").igGrid({
autoGenerateColumns: false,
dataSource: workItems,
height: "100%",
primaryKey: "Id",
width: "100%",
columns: [
{ key: "Violation", dataType: "string", hidden: true },
{ key: "Id", dataType: "number" },
{ key: "Requester", dataType: "string" },
{ headerText: "Assigned To", key: "AssignedTo", dataType: "string" },
{ key: "Title", dataType: "string", width: "20%" },
{ headerText: "System(s)", key: "Tags", dataType: "string" },
{ key: "Priority", dataType: "string" },
{ key: "State", dataType: "string" },
{ headerText: "Effort in Days", key: "Effort", dataType: "number" },
{ headerText: "UAT as of", key: "ResolvedDate", dataType: "date", format: "date" },
{ headerText: "CMP Date", key: "ClosedDate", dataType: "date", format: "date" },
{ headerText: "Target", key: "TargetDate", dataType: "date", format: "date" },
{ key: "AreaPath", dataType: "string", hidden: true },
{ key: "AssignedTo", dataType: "string", hidden: true },
{ key: "BusinessValue", dataType: "number", hidden: true },
{ key: "ChangedDate", dataType: "string", hidden: true },
{ key: "CommentCount", dataType: "number", hidden: true },
{ key: "CreatedDate", dataType: "string", hidden: true },
{ key: "Description", dataType: "string", hidden: true },
{ key: "IterationPath", dataType: "string", hidden: true },
{ key: "Revision", dataType: "number", hidden: true },
{ key: "RiskReductionMinusOpportunityEnablement", dataType: "string", hidden: true },
{ key: "StartDate", dataType: "string", hidden: true },
{ key: "WeightedShortestJobFirst", dataType: "number", hidden: true },
{ key: "WorkItemType", dataType: "string", hidden: true },
],
features: [
{ name: "Sorting", type: "local" },
{ name: "Filtering", type: "local" },
{ name: "Selection", mode: "row", multipleSelection: false, rowSelectionChanging: detailSelectionChangedRunInfo },
{ name: "Paging", type: "local", recordCountKey: "TotalRows", pageSize: 10, pageSizeUrlKey: "pageSize", "pageIndexUrlKey": "page", showPageSizeDropDown: true },
],
});
});
$("#HeaderGrid").on("dblclick", "tr", loadOne);
}

View File

@ -0,0 +1,12 @@
#HeaderGridDiv,
#DetailsGridDiv {
font-size: 12px;
}
#HeaderGrid {
font-family: monospace;
}
#AllGrid {
font-family: monospace;
}

View File

@ -9,15 +9,16 @@ public class Fields
#nullable enable #nullable enable
[JsonConstructor] [JsonConstructor]
public Fields(int customRRminusOE, public Fields(float? customRRminusOE,
CustomRequester? customRequester, CustomRequester? customRequester,
float customWSJF, float? customWSJF,
int microsoftVSTSCommonBusinessValue, DateTime microsoftVSTSCommonActivatedDate,
float? microsoftVSTSCommonBusinessValue,
DateTime microsoftVSTSCommonClosedDate, DateTime microsoftVSTSCommonClosedDate,
int microsoftVSTSCommonPriority, int microsoftVSTSCommonPriority,
DateTime microsoftVSTSCommonResolvedDate, DateTime microsoftVSTSCommonResolvedDate,
DateTime microsoftVSTSCommonStateChangeDate, DateTime microsoftVSTSCommonStateChangeDate,
float microsoftVSTSCommonTimeCriticality, float? microsoftVSTSCommonTimeCriticality,
float? microsoftVSTSSchedulingEffort, float? microsoftVSTSSchedulingEffort,
DateTime microsoftVSTSSchedulingStartDate, DateTime microsoftVSTSSchedulingStartDate,
DateTime microsoftVSTSSchedulingTargetDate, DateTime microsoftVSTSSchedulingTargetDate,
@ -42,6 +43,7 @@ public class Fields
CustomRequester = customRequester; CustomRequester = customRequester;
CustomRRminusOE = customRRminusOE; CustomRRminusOE = customRRminusOE;
CustomWSJF = customWSJF; CustomWSJF = customWSJF;
MicrosoftVSTSCommonActivatedDate = microsoftVSTSCommonActivatedDate;
MicrosoftVSTSCommonBusinessValue = microsoftVSTSCommonBusinessValue; MicrosoftVSTSCommonBusinessValue = microsoftVSTSCommonBusinessValue;
MicrosoftVSTSCommonClosedDate = microsoftVSTSCommonClosedDate; MicrosoftVSTSCommonClosedDate = microsoftVSTSCommonClosedDate;
MicrosoftVSTSCommonPriority = microsoftVSTSCommonPriority; MicrosoftVSTSCommonPriority = microsoftVSTSCommonPriority;
@ -71,14 +73,15 @@ public class Fields
} }
[JsonPropertyName("Custom.Requester")] public CustomRequester? CustomRequester { get; } // { init; get; } [JsonPropertyName("Custom.Requester")] public CustomRequester? CustomRequester { get; } // { init; get; }
[JsonPropertyName("Custom.RRminusOE")] public int CustomRRminusOE { get; } // { init; get; } [JsonPropertyName("Custom.RRminusOE")] public float? CustomRRminusOE { get; } // { init; get; }
[JsonPropertyName("Custom.WSJF")] public float CustomWSJF { get; } // { init; get; } [JsonPropertyName("Custom.WSJF")] public float? CustomWSJF { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.BusinessValue")] public int MicrosoftVSTSCommonBusinessValue { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Common.ActivatedDate")] public DateTime MicrosoftVSTSCommonActivatedDate { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.BusinessValue")] public float? MicrosoftVSTSCommonBusinessValue { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.ClosedDate")] public DateTime MicrosoftVSTSCommonClosedDate { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Common.ClosedDate")] public DateTime MicrosoftVSTSCommonClosedDate { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.Priority")] public int MicrosoftVSTSCommonPriority { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Common.Priority")] public int MicrosoftVSTSCommonPriority { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.ResolvedDate")] public DateTime MicrosoftVSTSCommonResolvedDate { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Common.ResolvedDate")] public DateTime MicrosoftVSTSCommonResolvedDate { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.StateChangeDate")] public DateTime MicrosoftVSTSCommonStateChangeDate { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Common.StateChangeDate")] public DateTime MicrosoftVSTSCommonStateChangeDate { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Common.TimeCriticality")] public float MicrosoftVSTSCommonTimeCriticality { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Common.TimeCriticality")] public float? MicrosoftVSTSCommonTimeCriticality { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Scheduling.Effort")] public float? MicrosoftVSTSSchedulingEffort { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Scheduling.Effort")] public float? MicrosoftVSTSSchedulingEffort { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Scheduling.StartDate")] public DateTime MicrosoftVSTSSchedulingStartDate { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Scheduling.StartDate")] public DateTime MicrosoftVSTSSchedulingStartDate { get; } // { init; get; }
[JsonPropertyName("Microsoft.VSTS.Scheduling.TargetDate")] public DateTime MicrosoftVSTSSchedulingTargetDate { get; } // { init; get; } [JsonPropertyName("Microsoft.VSTS.Scheduling.TargetDate")] public DateTime MicrosoftVSTSSchedulingTargetDate { get; } // { init; get; }

View File

@ -9,15 +9,16 @@ public class WorkItem
#nullable enable #nullable enable
[JsonConstructor] [JsonConstructor]
public WorkItem(string areaPath, public WorkItem(DateTime? activatedDate,
string areaPath,
string? assignedTo, string? assignedTo,
int? businessValue, long? businessValue,
DateTime changedDate, DateTime changedDate,
DateTime? closedDate, DateTime? closedDate,
int commentCount, int commentCount,
DateTime createdDate, DateTime createdDate,
string description, string description,
float? effort, long? effort,
int id, int id,
string iterationPath, string iterationPath,
int? parent, int? parent,
@ -26,17 +27,18 @@ public class WorkItem
string? requester, string? requester,
DateTime? resolvedDate, DateTime? resolvedDate,
int revision, int revision,
int? riskReductionMinusOpportunityEnablement, long? riskReductionMinusOpportunityEnablement,
DateTime? startDate, DateTime? startDate,
string state, string state,
string tags, string tags,
DateTime? targetDate, DateTime? targetDate,
float? timeCriticality, long? timeCriticality,
string title, string title,
string? violation, string? violation,
float? weightedShortestJobFirst, long? weightedShortestJobFirst,
string workItemType) string workItemType)
{ {
ActivatedDate = activatedDate;
AreaPath = areaPath; AreaPath = areaPath;
AssignedTo = assignedTo; AssignedTo = assignedTo;
BusinessValue = businessValue; BusinessValue = businessValue;
@ -70,7 +72,8 @@ public class WorkItem
public static WorkItem Get(WorkItem workItem, string? violation) public static WorkItem Get(WorkItem workItem, string? violation)
{ {
WorkItem result = new(workItem.AreaPath, WorkItem result = new(workItem.ActivatedDate,
workItem.AreaPath,
workItem.AssignedTo, workItem.AssignedTo,
workItem.BusinessValue, workItem.BusinessValue,
workItem.ChangedDate, workItem.ChangedDate,
@ -100,15 +103,16 @@ public class WorkItem
return result; return result;
} }
public DateTime? ActivatedDate { get; set; }
public string AreaPath { get; set; } public string AreaPath { get; set; }
public string? AssignedTo { get; set; } public string? AssignedTo { get; set; }
public int? BusinessValue { get; set; } public long? BusinessValue { get; set; }
public DateTime ChangedDate { get; set; } public DateTime ChangedDate { get; set; }
public DateTime? ClosedDate { get; set; } public DateTime? ClosedDate { get; set; }
public int CommentCount { get; set; } public int CommentCount { get; set; }
public DateTime CreatedDate { get; set; } public DateTime CreatedDate { get; set; }
public string Description { get; set; } public string Description { get; set; }
public float? Effort { get; set; } public long? Effort { get; set; }
public int Id { get; set; } public int Id { get; set; }
public string IterationPath { get; set; } public string IterationPath { get; set; }
public int? Parent { get; set; } public int? Parent { get; set; }
@ -117,15 +121,15 @@ public class WorkItem
public string? Requester { get; set; } public string? Requester { get; set; }
public DateTime? ResolvedDate { get; set; } public DateTime? ResolvedDate { get; set; }
public int Revision { get; set; } public int Revision { get; set; }
public int? RiskReductionMinusOpportunityEnablement { get; set; } public long? RiskReductionMinusOpportunityEnablement { get; set; }
public DateTime? StartDate { get; set; } public DateTime? StartDate { get; set; }
public string State { get; set; } public string State { get; set; }
public string Tags { get; set; } public string Tags { get; set; }
public DateTime? TargetDate { get; set; } public DateTime? TargetDate { get; set; }
public float? TimeCriticality { get; set; } public long? TimeCriticality { get; set; }
public string Title { get; set; } public string Title { get; set; }
public string? Violation { get; set; } public string? Violation { get; set; }
public string WorkItemType { get; set; } public string WorkItemType { get; set; }
public float? WeightedShortestJobFirst { get; set; } public long? WeightedShortestJobFirst { get; set; }
} }

View File

@ -124,6 +124,14 @@ public class MESAFIBACKLOG
// Assert.IsTrue(workItems.Count == 5); // Assert.IsTrue(workItems.Count == 5);
} }
private static void Verify122517(FileInfo fileInfo)
{
ReadOnlyCollection<WorkItem> workItems = GetWorkItems(fileInfo);
Assert.IsNotNull(workItems);
// Assert.IsTrue(workItems.Count == 14);
// Assert.IsTrue(workItems.Count == 14);
}
#if DEBUG #if DEBUG
[Ignore] [Ignore]
#endif #endif
@ -147,11 +155,13 @@ public class MESAFIBACKLOG
Assert.IsTrue(keyValuePairs.ContainsKey("check-126169.json")); Assert.IsTrue(keyValuePairs.ContainsKey("check-126169.json"));
Assert.IsTrue(keyValuePairs.ContainsKey("check-123066.json")); Assert.IsTrue(keyValuePairs.ContainsKey("check-123066.json"));
Assert.IsTrue(keyValuePairs.ContainsKey("check-123067.json")); Assert.IsTrue(keyValuePairs.ContainsKey("check-123067.json"));
Assert.IsTrue(keyValuePairs.ContainsKey("check-122517.json"));
Verify122508(keyValuePairs["check-122508.json"]); Verify122508(keyValuePairs["check-122508.json"]);
Verify122514(keyValuePairs["check-122514.json"]); Verify122514(keyValuePairs["check-122514.json"]);
Verify126169(keyValuePairs["check-126169.json"]); Verify126169(keyValuePairs["check-126169.json"]);
Verify123066(keyValuePairs["check-123066.json"]); Verify123066(keyValuePairs["check-123066.json"]);
Verify123067(keyValuePairs["check-123067.json"]); Verify123067(keyValuePairs["check-123067.json"]);
Verify122517(keyValuePairs["check-122517.json"]);
NonThrowTryCatch(); NonThrowTryCatch();
} }