MSBuild back to v2.58.0 because of Owin dependency
FeatureCheckIterationPath122508 ignore features not planned Removed ALIGNMENT-EQPT and ALIGNMENT Tests
This commit is contained in:
@ -400,47 +400,64 @@ public class ProcessData : IProcessData
|
||||
_ => 8
|
||||
};
|
||||
|
||||
private static string? GetMaxIterationPath122508(ReadOnlyCollection<Record> records)
|
||||
private static ReadOnlyCollection<Record> GetMaxIterationPaths122508(ReadOnlyCollection<Record> records)
|
||||
{
|
||||
string? result;
|
||||
List<string> results = new();
|
||||
List<Record> results;
|
||||
List<Record>? collection;
|
||||
Dictionary<string, List<Record>> keyValuePairs = new();
|
||||
foreach (Record record in records)
|
||||
{
|
||||
if (results.Contains(record.WorkItem.IterationPath))
|
||||
continue;
|
||||
results.Add(record.WorkItem.IterationPath);
|
||||
if (!keyValuePairs.TryGetValue(record.WorkItem.IterationPath, out collection))
|
||||
{
|
||||
keyValuePairs.Add(record.WorkItem.IterationPath, new());
|
||||
if (!keyValuePairs.TryGetValue(record.WorkItem.IterationPath, out collection))
|
||||
throw new Exception();
|
||||
|
||||
}
|
||||
collection.Add(record);
|
||||
}
|
||||
result = results.Count == 0 ? null : results.Max();
|
||||
return result;
|
||||
string? max = keyValuePairs.Keys.Max();
|
||||
results = string.IsNullOrEmpty(max) ? new() : keyValuePairs[max];
|
||||
return results.AsReadOnly();
|
||||
}
|
||||
|
||||
private static ReadOnlyCollection<Record> FeatureCheckIterationPath122508(string url, List<string> lines, ReadOnlyCollection<string> workItemTypes, ReadOnlyDictionary<int, Record> keyValuePairs, string workItemType)
|
||||
{
|
||||
List<Record> results = new();
|
||||
Record record;
|
||||
string? maxIterationPath;
|
||||
List<string> violations = new();
|
||||
List<string> collection = new();
|
||||
ReadOnlyCollection<Record> records;
|
||||
ReadOnlyCollection<Record> maxIterationPaths;
|
||||
foreach (KeyValuePair<int, Record> keyValuePair in keyValuePairs)
|
||||
{
|
||||
record = keyValuePair.Value;
|
||||
if (record.WorkItem.State is "Removed")
|
||||
continue;
|
||||
if (!record.WorkItem.IterationPath.Contains('\\'))
|
||||
continue;
|
||||
if (record.WorkItem.WorkItemType != workItemType)
|
||||
continue;
|
||||
collection.Clear();
|
||||
violations.Clear();
|
||||
if (record.Children is null || record.Children.Length == 0)
|
||||
continue;
|
||||
records = FilterChildren(workItemTypes, record);
|
||||
maxIterationPath = GetMaxIterationPath122508(records);
|
||||
if (string.IsNullOrEmpty(maxIterationPath) || record.WorkItem.IterationPath == maxIterationPath)
|
||||
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}) => {record.WorkItem.IterationPath} != {maxIterationPath}");
|
||||
collection.Add(string.Empty);
|
||||
lines.AddRange(collection);
|
||||
results.Add(Record.GetWithoutNesting(record, $"IterationPath:<a target='_blank' href='{url}{record.WorkItem.Id}'>{record.WorkItem.Id}</a>;{record.WorkItem.IterationPath} != {maxIterationPath}"));
|
||||
maxIterationPaths = GetMaxIterationPaths122508(records);
|
||||
foreach (Record r in maxIterationPaths)
|
||||
{
|
||||
if (string.IsNullOrEmpty(r.WorkItem.IterationPath) || record.WorkItem.IterationPath == r.WorkItem.IterationPath)
|
||||
continue;
|
||||
violations.Add($"<a target='_blank' href='{url}{r.WorkItem.Id}'>{r.WorkItem.Id}</a>:{r.WorkItem.IterationPath};");
|
||||
}
|
||||
if (violations.Count > 0)
|
||||
{
|
||||
collection.Insert(0, string.Empty);
|
||||
collection.Insert(0, $"## {record.WorkItem.AssignedTo} - {record.WorkItem.Id} - {record.WorkItem.Title}");
|
||||
lines.AddRange(collection);
|
||||
violations.Insert(0, $"IterationPath:{record.WorkItem.IterationPath};");
|
||||
results.Add(Record.GetWithoutNesting(record, string.Join(" ", violations)));
|
||||
}
|
||||
}
|
||||
return new(results);
|
||||
}
|
||||
|
Reference in New Issue
Block a user