Created Tests
This commit is contained in:
@ -7,48 +7,40 @@ namespace File_Folder_Helper.ADO2024.PI3;
|
||||
internal static partial class Helper20240911
|
||||
{
|
||||
|
||||
public record Attribute([property: JsonPropertyName("isLocked")] bool IsLocked,
|
||||
[property: JsonPropertyName("name")] string Name);
|
||||
private record Attribute([property: JsonPropertyName("isLocked")] bool IsLocked,
|
||||
[property: JsonPropertyName("name")] string Name);
|
||||
|
||||
public record Relation([property: JsonPropertyName("rel")] string Type,
|
||||
[property: JsonPropertyName("url")] string URL,
|
||||
[property: JsonPropertyName("attributes")] Attribute Attributes);
|
||||
private record Relation([property: JsonPropertyName("rel")] string Type,
|
||||
[property: JsonPropertyName("url")] string URL,
|
||||
[property: JsonPropertyName("attributes")] Attribute Attributes);
|
||||
|
||||
public record Record(WorkItem WorkItem, WorkItem? Parent, ReadOnlyCollection<Record> Children);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Record[]))]
|
||||
internal partial class RecordCollectionCommonSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
public record WorkItem(string AreaPath,
|
||||
string? AssignedTo,
|
||||
int? BusinessValue,
|
||||
DateTime ChangedDate,
|
||||
DateTime? ClosedDate,
|
||||
int CommentCount,
|
||||
DateTime CreatedDate,
|
||||
string Description,
|
||||
float? Effort,
|
||||
int Id,
|
||||
string IterationPath,
|
||||
int? Parent,
|
||||
int? Priority,
|
||||
Relation[] Relations,
|
||||
string? Requester,
|
||||
DateTime? ResolvedDate,
|
||||
int Revision,
|
||||
int? RiskReductionMinusOpportunityEnablement,
|
||||
DateTime? StartDate,
|
||||
string State,
|
||||
string Tags,
|
||||
DateTime? TargetDate,
|
||||
float? TimeCriticality,
|
||||
string Title,
|
||||
string? Violation,
|
||||
float? WeightedShortestJobFirst,
|
||||
string WorkItemType)
|
||||
private record WorkItem(string AreaPath,
|
||||
string? AssignedTo,
|
||||
int? BusinessValue,
|
||||
DateTime ChangedDate,
|
||||
DateTime? ClosedDate,
|
||||
int CommentCount,
|
||||
DateTime CreatedDate,
|
||||
string Description,
|
||||
float? Effort,
|
||||
int Id,
|
||||
string IterationPath,
|
||||
int? Parent,
|
||||
int? Priority,
|
||||
Relation[] Relations,
|
||||
string? Requester,
|
||||
DateTime? ResolvedDate,
|
||||
int Revision,
|
||||
int? RiskReductionMinusOpportunityEnablement,
|
||||
DateTime? StartDate,
|
||||
string State,
|
||||
string Tags,
|
||||
DateTime? TargetDate,
|
||||
float? TimeCriticality,
|
||||
string Title,
|
||||
string? Violation,
|
||||
float? WeightedShortestJobFirst,
|
||||
string WorkItemType)
|
||||
{
|
||||
|
||||
public override string ToString() => $"{Id} - {WorkItemType} - {Title}";
|
||||
@ -86,7 +78,17 @@ internal static partial class Helper20240911
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(WorkItem[]))]
|
||||
internal partial class WorkItemSourceGenerationContext : JsonSerializerContext
|
||||
private partial class WorkItemSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
private record Record(WorkItem WorkItem,
|
||||
WorkItem? Parent,
|
||||
ReadOnlyCollection<Record> Children);
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(Record[]))]
|
||||
private partial class RecordCollectionCommonSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
@ -110,6 +112,7 @@ internal static partial class Helper20240911
|
||||
{
|
||||
List<Record> results = [];
|
||||
int? childId;
|
||||
Record record;
|
||||
nests.Add(true);
|
||||
WorkItem? childWorkItem;
|
||||
WorkItem? parentWorkItem;
|
||||
@ -128,16 +131,17 @@ internal static partial class Helper20240911
|
||||
collection.Add(childWorkItem);
|
||||
}
|
||||
collection = (from l in collection orderby l.State != "Closed", l.Id select l).ToList();
|
||||
foreach (WorkItem item in collection)
|
||||
foreach (WorkItem w in collection)
|
||||
{
|
||||
if (nests.Count > 99)
|
||||
break;
|
||||
if (item.Parent is null)
|
||||
if (w.Parent is null)
|
||||
parentWorkItem = null;
|
||||
else
|
||||
_ = keyValuePairs.TryGetValue(item.Parent.Value, out parentWorkItem);
|
||||
records = GetKeyValuePairs(keyValuePairs, item, nests);
|
||||
results.Add(new(item, parentWorkItem, records));
|
||||
_ = keyValuePairs.TryGetValue(w.Parent.Value, out parentWorkItem);
|
||||
records = GetKeyValuePairs(keyValuePairs, w, nests);
|
||||
record = new(w, parentWorkItem, records);
|
||||
results.Add(record);
|
||||
}
|
||||
}
|
||||
return new(results);
|
||||
@ -219,90 +223,46 @@ internal static partial class Helper20240911
|
||||
return result;
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching(string tags, ReadOnlyCollection<WorkItem> workItems)
|
||||
{
|
||||
List<WorkItem> results = [];
|
||||
string[] segments;
|
||||
string[] parentTags = tags.Split(';');
|
||||
foreach (WorkItem workItem in workItems)
|
||||
{
|
||||
segments = tags.Split(';');
|
||||
if (segments.Length > 0 && parentTags.Any(l => segments.Contains(l)))
|
||||
continue;
|
||||
results.Add(workItem);
|
||||
}
|
||||
return new(results);
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching(int? priority, ReadOnlyCollection<WorkItem> workItems)
|
||||
{
|
||||
List<WorkItem> results = [];
|
||||
foreach (WorkItem workItem in workItems)
|
||||
{
|
||||
if (workItem.Priority == priority)
|
||||
continue;
|
||||
results.Add(workItem);
|
||||
}
|
||||
return new(results);
|
||||
}
|
||||
|
||||
private static int GetState(WorkItem workItem) =>
|
||||
workItem.State switch
|
||||
{
|
||||
"New" => 1,
|
||||
"Active" => 2,
|
||||
"Resolved" => 3,
|
||||
"Closed" => 4,
|
||||
"Removed" => 5,
|
||||
_ => 8
|
||||
};
|
||||
|
||||
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching(Record record, ReadOnlyCollection<WorkItem> workItems)
|
||||
{
|
||||
List<WorkItem> results = [];
|
||||
int check;
|
||||
int state = GetState(record.WorkItem);
|
||||
List<KeyValuePair<int, WorkItem>> collection = [];
|
||||
foreach (WorkItem workItem in workItems)
|
||||
{
|
||||
check = GetState(workItem);
|
||||
if (check == state)
|
||||
continue;
|
||||
collection.Add(new(check, workItem));
|
||||
}
|
||||
foreach (KeyValuePair<int, WorkItem> keyValuePair in collection.OrderByDescending(l => l.Key))
|
||||
results.Add(keyValuePair.Value);
|
||||
return new(results);
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<string> GetChildrenDirectories(ReadOnlyDictionary<int, Record> keyValuePairs, List<bool> nests, string parentDirectory, ReadOnlyCollection<Record> children)
|
||||
private static ReadOnlyCollection<string> GetChildrenDirectories(ReadOnlyDictionary<int, Record> keyValuePairs, List<bool> nests, string parentDirectory, Record record)
|
||||
{
|
||||
List<string> results = [];
|
||||
nests.Add(true);
|
||||
string directory;
|
||||
Record? childRecord;
|
||||
ReadOnlyCollection<string> childrenDirectories;
|
||||
foreach (Record record in children)
|
||||
foreach (Record r in record.Children)
|
||||
{
|
||||
// if (record.WorkItem.Id == 110730)
|
||||
// continue;
|
||||
// if (record.WorkItem.Id == 110732)
|
||||
// continue;
|
||||
directory = Path.Combine(parentDirectory, $"{record.WorkItem.WorkItemType[..1]}-{record.WorkItem.Id}-{record.WorkItem.Title.Trim()[..1]}");
|
||||
directory = Path.Combine(parentDirectory, $"{r.WorkItem.WorkItemType[..1]}-{r.WorkItem.Id}-{r.WorkItem.Title.Trim()[..1]}");
|
||||
results.Add(directory);
|
||||
if (!keyValuePairs.TryGetValue(record.WorkItem.Id, out childRecord))
|
||||
if (!keyValuePairs.TryGetValue(r.WorkItem.Id, out childRecord))
|
||||
continue;
|
||||
if (nests.Count > 99)
|
||||
break;
|
||||
childrenDirectories = GetChildrenDirectories(keyValuePairs, nests, directory, childRecord.Children);
|
||||
childrenDirectories = GetChildrenDirectories(keyValuePairs, nests, directory, childRecord);
|
||||
results.AddRange(childrenDirectories);
|
||||
}
|
||||
return new(results);
|
||||
}
|
||||
|
||||
private static void FilterChildren(ReadOnlyCollection<string> workItemTypes, Record record, List<WorkItem> results)
|
||||
{
|
||||
foreach (Record r in record.Children)
|
||||
{
|
||||
if (!workItemTypes.Contains(r.WorkItem.WorkItemType))
|
||||
continue;
|
||||
results.Add(r.WorkItem);
|
||||
FilterChildren(workItemTypes, r, results);
|
||||
}
|
||||
}
|
||||
|
||||
private static ReadOnlyDictionary<int, Record> GetKeyValuePairs(ReadOnlyDictionary<int, WorkItem> keyValuePairs)
|
||||
{
|
||||
Dictionary<int, Record> results = [];
|
||||
Record record;
|
||||
List<bool> nests = [];
|
||||
WorkItem? parentWorkItem;
|
||||
ReadOnlyCollection<Record> records;
|
||||
@ -316,12 +276,13 @@ internal static partial class Helper20240911
|
||||
try
|
||||
{
|
||||
records = GetKeyValuePairs(keyValuePairs, keyValuePair.Value, nests);
|
||||
results.Add(keyValuePair.Key, new(keyValuePair.Value, parentWorkItem, records));
|
||||
record = new(keyValuePair.Value, parentWorkItem, records);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
results.Add(keyValuePair.Key, new(keyValuePair.Value, parentWorkItem, new([])));
|
||||
record = new(keyValuePair.Value, parentWorkItem, new([]));
|
||||
}
|
||||
results.Add(keyValuePair.Key, record);
|
||||
}
|
||||
return new(results);
|
||||
}
|
||||
@ -347,40 +308,30 @@ internal static partial class Helper20240911
|
||||
// continue;
|
||||
nests.Clear();
|
||||
directory = Path.Combine(ticksDirectory, $"{record.WorkItem.WorkItemType[..1]}-{record.WorkItem.Id}-{record.WorkItem.Title.Trim()[..1]}");
|
||||
childrenDirectories = GetChildrenDirectories(keyValuePairs, nests, directory, record.Children);
|
||||
childrenDirectories = GetChildrenDirectories(keyValuePairs, nests, directory, record);
|
||||
results.AddRange(childrenDirectories);
|
||||
}
|
||||
return new(results.Distinct().ToArray());
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<WorkItem> FilterChildren(Record record, ReadOnlyCollection<string> workItemTypes)
|
||||
private static int GetState(WorkItem workItem) =>
|
||||
workItem.State switch
|
||||
{
|
||||
"New" => 1,
|
||||
"Active" => 2,
|
||||
"Resolved" => 3,
|
||||
"Closed" => 4,
|
||||
"Removed" => 5,
|
||||
_ => 8
|
||||
};
|
||||
|
||||
private static ReadOnlyCollection<WorkItem> FilterChildren(ReadOnlyCollection<string> workItemTypes, Record record)
|
||||
{
|
||||
List<WorkItem> results = [];
|
||||
WorkItem workItem;
|
||||
foreach (Record child in record.Children)
|
||||
{
|
||||
workItem = child.WorkItem;
|
||||
if (!workItemTypes.Contains(workItem.WorkItemType))
|
||||
continue;
|
||||
results.Add(workItem);
|
||||
}
|
||||
FilterChildren(workItemTypes, record, results);
|
||||
return new(results);
|
||||
}
|
||||
|
||||
private static string? GetMaxIterationPath(ReadOnlyCollection<WorkItem> workItems)
|
||||
{
|
||||
string? result;
|
||||
List<string> results = [];
|
||||
foreach (WorkItem workItem in workItems)
|
||||
{
|
||||
if (results.Contains(workItem.IterationPath))
|
||||
continue;
|
||||
results.Add(workItem.IterationPath);
|
||||
}
|
||||
result = results.Count == 0 ? null : results.Max();
|
||||
return result;
|
||||
}
|
||||
|
||||
private static ReadOnlyDictionary<int, Record> GetWorkItems(ILogger<Worker> logger, string developmentURL, string productionURL)
|
||||
{
|
||||
ReadOnlyDictionary<int, Record> results;
|
||||
@ -393,15 +344,18 @@ internal static partial class Helper20240911
|
||||
logger.LogWarning("{StatusCode} for {url}", httpResponseMessage.Result.StatusCode, developmentURL);
|
||||
Task<string> developmentJSON = httpResponseMessage.Result.Content.ReadAsStringAsync();
|
||||
developmentJSON.Wait();
|
||||
httpResponseMessage = httpClient.GetAsync(productionURL);
|
||||
httpResponseMessage.Wait();
|
||||
if (!httpResponseMessage.Result.IsSuccessStatusCode)
|
||||
logger.LogWarning("{StatusCode} for {url}", httpResponseMessage.Result.StatusCode, productionURL);
|
||||
Task<string> productionJSON = httpResponseMessage.Result.Content.ReadAsStringAsync();
|
||||
productionJSON.Wait();
|
||||
if (developmentJSON.Result != developmentJSON.Result)
|
||||
logger.LogWarning("developmentJSON doesn't match developmentJSON");
|
||||
WorkItem[]? workItems = JsonSerializer.Deserialize(productionJSON.Result, WorkItemSourceGenerationContext.Default.WorkItemArray);
|
||||
if (!string.IsNullOrEmpty(productionURL))
|
||||
{
|
||||
httpResponseMessage = httpClient.GetAsync(productionURL);
|
||||
httpResponseMessage.Wait();
|
||||
if (!httpResponseMessage.Result.IsSuccessStatusCode)
|
||||
logger.LogWarning("{StatusCode} for {url}", httpResponseMessage.Result.StatusCode, productionURL);
|
||||
Task<string> productionJSON = httpResponseMessage.Result.Content.ReadAsStringAsync();
|
||||
productionJSON.Wait();
|
||||
if (productionJSON.Result != developmentJSON.Result)
|
||||
logger.LogWarning("productionJSON doesn't match developmentJSON");
|
||||
}
|
||||
WorkItem[]? workItems = JsonSerializer.Deserialize(developmentJSON.Result, WorkItemSourceGenerationContext.Default.WorkItemArray);
|
||||
if (workItems is null)
|
||||
logger.LogWarning("workItems is null");
|
||||
else
|
||||
@ -453,6 +407,108 @@ internal static partial class Helper20240911
|
||||
File.WriteAllText(jsonFile, json);
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching122514(Record record, ReadOnlyCollection<WorkItem> workItems)
|
||||
{
|
||||
List<WorkItem> results = [];
|
||||
string[] segments;
|
||||
string[] parentTags = record.WorkItem.Tags.Split(';').Select(l => l.Trim()).ToArray();
|
||||
foreach (WorkItem workItem in workItems)
|
||||
{
|
||||
segments = string.IsNullOrEmpty(workItem.Tags) ? [] : workItem.Tags.Split(';').Select(l => l.Trim()).ToArray();
|
||||
if (segments.Length > 0 && parentTags.Any(l => segments.Contains(l)))
|
||||
continue;
|
||||
results.Add(workItem);
|
||||
}
|
||||
return new(results);
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching126169(Record record, ReadOnlyCollection<WorkItem> workItems)
|
||||
{
|
||||
List<WorkItem> results = [];
|
||||
foreach (WorkItem workItem in workItems)
|
||||
{
|
||||
if (record.WorkItem.Priority is null)
|
||||
{
|
||||
results.Add(record.WorkItem);
|
||||
break;
|
||||
}
|
||||
if (workItem.Priority == record.WorkItem.Priority.Value)
|
||||
continue;
|
||||
results.Add(workItem);
|
||||
}
|
||||
return new(results);
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching123066(Record record, ReadOnlyCollection<WorkItem> workItems)
|
||||
{
|
||||
List<WorkItem> results = [];
|
||||
int check;
|
||||
int state = GetState(record.WorkItem);
|
||||
List<KeyValuePair<int, WorkItem>> collection = [];
|
||||
foreach (WorkItem workItem in workItems)
|
||||
{
|
||||
if (workItem.State is "Removed")
|
||||
continue;
|
||||
check = GetState(workItem);
|
||||
if (check == state)
|
||||
continue;
|
||||
collection.Add(new(check, workItem));
|
||||
}
|
||||
if (collection.Count > 0)
|
||||
{
|
||||
KeyValuePair<int, WorkItem>[] notNewState = (from l in collection where l.Value.State != "New" select l).ToArray();
|
||||
if (notNewState.Length == 0 && record.WorkItem.State is "New" or "Active")
|
||||
collection.Clear();
|
||||
else if (notNewState.Length > 0)
|
||||
{
|
||||
int minimum = notNewState.Min(l => l.Key);
|
||||
if (minimum == state)
|
||||
collection.Clear();
|
||||
else if (minimum == 1 && record.WorkItem.State == "New")
|
||||
collection.Clear();
|
||||
else if (notNewState.Length > 0 && record.WorkItem.State == "Active")
|
||||
collection.Clear();
|
||||
}
|
||||
}
|
||||
foreach (KeyValuePair<int, WorkItem> keyValuePair in collection.OrderByDescending(l => l.Key))
|
||||
results.Add(keyValuePair.Value);
|
||||
return new(results);
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<WorkItem> GetWorkItemsNotMatching123067(Record record, ReadOnlyCollection<WorkItem> workItems)
|
||||
{
|
||||
List<WorkItem> results = [];
|
||||
int check;
|
||||
int state = GetState(record.WorkItem);
|
||||
List<KeyValuePair<int, WorkItem>> collection = [];
|
||||
foreach (WorkItem workItem in workItems)
|
||||
{
|
||||
if (record.WorkItem.State is "Removed" or "Resolved" or "Closed")
|
||||
continue;
|
||||
check = GetState(workItem);
|
||||
if (check == state)
|
||||
continue;
|
||||
collection.Add(new(check, workItem));
|
||||
}
|
||||
foreach (KeyValuePair<int, WorkItem> keyValuePair in collection.OrderByDescending(l => l.Key))
|
||||
results.Add(keyValuePair.Value);
|
||||
return new(results);
|
||||
}
|
||||
|
||||
private static string? GetMaxIterationPath122508(ReadOnlyCollection<WorkItem> workItems)
|
||||
{
|
||||
string? result;
|
||||
List<string> results = [];
|
||||
foreach (WorkItem workItem in workItems)
|
||||
{
|
||||
if (results.Contains(workItem.IterationPath))
|
||||
continue;
|
||||
results.Add(workItem.IterationPath);
|
||||
}
|
||||
result = results.Count == 0 ? null : results.Max();
|
||||
return result;
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<WorkItem> FeatureCheckIterationPath122508(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyCollection<Record> records, string workItemType)
|
||||
{
|
||||
List<WorkItem> results = [];
|
||||
@ -462,14 +518,16 @@ internal static partial class Helper20240911
|
||||
ReadOnlyCollection<WorkItem> childrenWorkItems;
|
||||
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;
|
||||
childrenWorkItems = FilterChildren(record, workItemTypes);
|
||||
maxIterationPath = GetMaxIterationPath(childrenWorkItems);
|
||||
childrenWorkItems = FilterChildren(workItemTypes, record);
|
||||
maxIterationPath = GetMaxIterationPath122508(childrenWorkItems);
|
||||
if (string.IsNullOrEmpty(maxIterationPath) || record.WorkItem.IterationPath == maxIterationPath)
|
||||
continue;
|
||||
collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
|
||||
@ -478,7 +536,7 @@ internal static partial class Helper20240911
|
||||
collection.Add($"- [ ] {record.WorkItem.Id} => {record.WorkItem.IterationPath} != {maxIterationPath}");
|
||||
collection.Add(string.Empty);
|
||||
lines.AddRange(collection);
|
||||
results.Add(WorkItem.Get(record.WorkItem, $"IterationPath:<a target='_blank' href='{url}{record.WorkItem.Id}'>{record.WorkItem.Id}</a>;{record.WorkItem.IterationPath} != {maxIterationPath}"));
|
||||
results.Add(WorkItem.Get(record.WorkItem, $"IterationPath:<a target='_blank' href=' {url}{record.WorkItem.Id} '>{record.WorkItem.Id}</a>;{record.WorkItem.IterationPath} != {maxIterationPath}"));
|
||||
}
|
||||
return new(results);
|
||||
}
|
||||
@ -492,6 +550,8 @@ internal static partial class Helper20240911
|
||||
ReadOnlyCollection<WorkItem> workItemsNotMatching;
|
||||
foreach (Record record in records)
|
||||
{
|
||||
if (record.WorkItem.State is "Removed")
|
||||
continue;
|
||||
if (record.WorkItem.WorkItemType != workItemType)
|
||||
continue;
|
||||
collection.Clear();
|
||||
@ -502,8 +562,8 @@ internal static partial class Helper20240911
|
||||
workItemsNotMatching = new([record.WorkItem]);
|
||||
else
|
||||
{
|
||||
childrenWorkItems = FilterChildren(record, workItemTypes);
|
||||
workItemsNotMatching = GetWorkItemsNotMatching(record.WorkItem.Tags, childrenWorkItems);
|
||||
childrenWorkItems = FilterChildren(workItemTypes, record);
|
||||
workItemsNotMatching = GetWorkItemsNotMatching122514(record, childrenWorkItems);
|
||||
if (!string.IsNullOrEmpty(record.WorkItem.Tags) && workItemsNotMatching.Count == 0)
|
||||
continue;
|
||||
}
|
||||
@ -516,7 +576,7 @@ internal static partial class Helper20240911
|
||||
lines.AddRange(collection);
|
||||
violations.Add($"Tag:{record.WorkItem.Tags};");
|
||||
foreach (WorkItem workItem in workItemsNotMatching)
|
||||
violations.Add($"<a target='_blank' href='{url}{workItem.Id}'>{workItem.Id}</a>:{workItem.Tags};");
|
||||
violations.Add($"<a target='_blank' href=' {url}{workItem.Id} '>{workItem.Id}</a>:{workItem.Tags};");
|
||||
results.Add(WorkItem.Get(record.WorkItem, string.Join(' ', violations)));
|
||||
}
|
||||
return new(results);
|
||||
@ -531,14 +591,16 @@ internal static partial class Helper20240911
|
||||
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;
|
||||
childrenWorkItems = FilterChildren(record, workItemTypes);
|
||||
workItemsNotMatching = GetWorkItemsNotMatching(record.WorkItem.Priority, childrenWorkItems);
|
||||
childrenWorkItems = FilterChildren(workItemTypes, record);
|
||||
workItemsNotMatching = GetWorkItemsNotMatching126169(record, childrenWorkItems);
|
||||
if (workItemsNotMatching.Count == 0)
|
||||
continue;
|
||||
collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
|
||||
@ -550,7 +612,7 @@ internal static partial class Helper20240911
|
||||
lines.AddRange(collection);
|
||||
violations.Add($"Priority:{record.WorkItem.Priority};");
|
||||
foreach (WorkItem workItem in workItemsNotMatching)
|
||||
violations.Add($"<a target='_blank' href='{url}{workItem.Id}'>{workItem.Id}</a>:{workItem.Priority};");
|
||||
violations.Add($"<a target='_blank' href=' {url}{workItem.Id} '>{workItem.Id}</a>:{workItem.Priority};");
|
||||
results.Add(WorkItem.Get(record.WorkItem, string.Join(' ', violations)));
|
||||
}
|
||||
return new(results);
|
||||
@ -565,16 +627,16 @@ internal static partial class Helper20240911
|
||||
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.WorkItem.State == "New")
|
||||
continue;
|
||||
if (record.Children.Count == 0)
|
||||
continue;
|
||||
childrenWorkItems = FilterChildren(record, workItemTypes);
|
||||
workItemsNotMatching = GetWorkItemsNotMatching(record, childrenWorkItems);
|
||||
childrenWorkItems = FilterChildren(workItemTypes, record);
|
||||
workItemsNotMatching = GetWorkItemsNotMatching123066(record, childrenWorkItems);
|
||||
if (workItemsNotMatching.Count == 0)
|
||||
continue;
|
||||
collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
|
||||
@ -586,7 +648,7 @@ internal static partial class Helper20240911
|
||||
lines.AddRange(collection);
|
||||
violations.Add($"State:{record.WorkItem.State};");
|
||||
foreach (WorkItem workItem in workItemsNotMatching)
|
||||
violations.Add($"<a target='_blank' href='{url}{workItem.Id}'>{workItem.Id}</a>:{workItem.State};");
|
||||
violations.Add($"<a target='_blank' href=' {url}{workItem.Id} '>{workItem.Id}</a>:{workItem.State};");
|
||||
results.Add(WorkItem.Get(record.WorkItem, string.Join(' ', violations)));
|
||||
}
|
||||
return new(results);
|
||||
@ -601,14 +663,16 @@ internal static partial class Helper20240911
|
||||
ReadOnlyCollection<WorkItem> workItemsNotMatching;
|
||||
foreach (Record record in records)
|
||||
{
|
||||
if (record.WorkItem.State is "Removed" or "New" or "Active")
|
||||
continue;
|
||||
if (record.WorkItem.WorkItemType != workItemType)
|
||||
continue;
|
||||
collection.Clear();
|
||||
violations.Clear();
|
||||
if (record.Children.Count == 0)
|
||||
continue;
|
||||
childrenWorkItems = FilterChildren(record, workItemTypes);
|
||||
workItemsNotMatching = GetWorkItemsNotMatching(record, childrenWorkItems);
|
||||
childrenWorkItems = FilterChildren(workItemTypes, record);
|
||||
workItemsNotMatching = GetWorkItemsNotMatching123067(record, childrenWorkItems);
|
||||
if (workItemsNotMatching.Count == 0)
|
||||
continue;
|
||||
collection.Add($"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
|
||||
@ -620,7 +684,7 @@ internal static partial class Helper20240911
|
||||
lines.AddRange(collection);
|
||||
violations.Add($"State:{record.WorkItem.State};");
|
||||
foreach (WorkItem workItem in workItemsNotMatching)
|
||||
violations.Add($"<a target='_blank' href='{url}{workItem.Id}'>{workItem.Id}</a>:{workItem.State};");
|
||||
violations.Add($"<a target='_blank' href=' {url}{workItem.Id} '>{workItem.Id}</a>:{workItem.State};");
|
||||
results.Add(WorkItem.Get(record.WorkItem, string.Join(' ', violations)));
|
||||
}
|
||||
return new(results);
|
||||
|
Reference in New Issue
Block a user