From c3b309347cd6a488457262e3cad4c7db9ac1ee9c Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Thu, 6 Feb 2025 08:58:26 -0700 Subject: [PATCH] Added RemainingWork and StoryPoints --- Adaptation/FileHandlers/json/FileRead.cs | 58 +++++---- .../FileHandlers/json/WorkItems/Fields.cs | 10 +- .../FileHandlers/json/WorkItems/Record.cs | 58 +++++---- .../FileHandlers/json/WorkItems/WorkItem.cs | 122 ++++++++++-------- Adaptation/MESAFIBACKLOG.yml | 39 +++--- 5 files changed, 150 insertions(+), 137 deletions(-) diff --git a/Adaptation/FileHandlers/json/FileRead.cs b/Adaptation/FileHandlers/json/FileRead.cs index 2692cbe..2dfbdf6 100644 --- a/Adaptation/FileHandlers/json/FileRead.cs +++ b/Adaptation/FileHandlers/json/FileRead.cs @@ -161,34 +161,36 @@ public class FileRead : Shared.FileRead, IFileRead relations.Add(relation); } } - workItem = new(fields.MicrosoftVSTSCommonActivatedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonActivatedDate, - fields.SystemAreaPath, - fields.SystemAssignedTo?.DisplayName, - fields.MicrosoftVSTSCommonBusinessValue is null or 0 ? null : (long)fields.MicrosoftVSTSCommonBusinessValue, - fields.SystemChangedDate, - fields.MicrosoftVSTSCommonClosedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonClosedDate, - fields.SystemCommentCount, - fields.SystemCreatedDate, - fields.SystemDescription, - fields.MicrosoftVSTSSchedulingEffort is null or 0 ? null : (long)fields.MicrosoftVSTSSchedulingEffort, - value.Id, - fields.SystemIterationPath, - fields.SystemParent == 0 ? null : fields.SystemParent, - fields.MicrosoftVSTSCommonPriority == 0 ? null : fields.MicrosoftVSTSCommonPriority, - relations.ToArray(), - fields.CustomRequester?.DisplayName, - fields.MicrosoftVSTSCommonResolvedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonResolvedDate, - value.Rev, - fields.CustomRRminusOE is null or 0 ? null : (long)fields.CustomRRminusOE, - fields.MicrosoftVSTSSchedulingStartDate == DateTime.MinValue ? null : fields.MicrosoftVSTSSchedulingStartDate, - fields.SystemState, - fields.SystemTags, - fields.MicrosoftVSTSSchedulingTargetDate == DateTime.MinValue ? null : fields.MicrosoftVSTSSchedulingTargetDate, - fields.MicrosoftVSTSCommonTimeCriticality is null or 0 ? null : (long)fields.MicrosoftVSTSCommonTimeCriticality, - fields.SystemTitle.Trim(), - null, - fields.CustomWSJF is null or 0 ? null : (long)fields.CustomWSJF, - fields.SystemWorkItemType); + workItem = new(activatedDate: fields.MicrosoftVSTSCommonActivatedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonActivatedDate, + areaPath: fields.SystemAreaPath, + assignedTo: fields.SystemAssignedTo?.DisplayName, + businessValue: fields.MicrosoftVSTSCommonBusinessValue is null or 0 ? null : (long)fields.MicrosoftVSTSCommonBusinessValue, + changedDate: fields.SystemChangedDate, + closedDate: fields.MicrosoftVSTSCommonClosedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonClosedDate, + commentCount: fields.SystemCommentCount, + createdDate: fields.SystemCreatedDate, + description: fields.SystemDescription, + effort: fields.MicrosoftVSTSSchedulingEffort is null or 0 ? null : (long)fields.MicrosoftVSTSSchedulingEffort, + id: value.Id, + iterationPath: fields.SystemIterationPath, + parent: fields.SystemParent == 0 ? null : fields.SystemParent, + priority: fields.MicrosoftVSTSCommonPriority == 0 ? null : fields.MicrosoftVSTSCommonPriority, + relations: relations.ToArray(), + remainingWork: fields.MicrosoftVSTSSchedulingRemainingWork is null ? null : (long)fields.MicrosoftVSTSSchedulingRemainingWork, + requester: fields.CustomRequester?.DisplayName, + resolvedDate: fields.MicrosoftVSTSCommonResolvedDate == DateTime.MinValue ? null : fields.MicrosoftVSTSCommonResolvedDate, + revision: value.Rev, + riskReductionMinusOpportunityEnablement: fields.CustomRRminusOE is null or 0 ? null : (long)fields.CustomRRminusOE, + startDate: fields.MicrosoftVSTSSchedulingStartDate == DateTime.MinValue ? null : fields.MicrosoftVSTSSchedulingStartDate, + state: fields.SystemState, + storyPoints: fields.MicrosoftVSTSSchedulingStoryPoints is null ? null : (long)fields.MicrosoftVSTSSchedulingStoryPoints, + tags: fields.SystemTags, + targetDate: fields.MicrosoftVSTSSchedulingTargetDate == DateTime.MinValue ? null : fields.MicrosoftVSTSSchedulingTargetDate, + timeCriticality: fields.MicrosoftVSTSCommonTimeCriticality is null or 0 ? null : (long)fields.MicrosoftVSTSCommonTimeCriticality, + title: fields.SystemTitle.Trim(), + violation: null, + weightedShortestJobFirst: fields.CustomWSJF is null or 0 ? null : (long)fields.CustomWSJF, + workItemType: fields.SystemWorkItemType); results.Add(workItem.Id, workItem); } return new(results); diff --git a/Adaptation/FileHandlers/json/WorkItems/Fields.cs b/Adaptation/FileHandlers/json/WorkItems/Fields.cs index 03d4804..e500955 100644 --- a/Adaptation/FileHandlers/json/WorkItems/Fields.cs +++ b/Adaptation/FileHandlers/json/WorkItems/Fields.cs @@ -20,7 +20,9 @@ internal class Fields DateTime microsoftVSTSCommonStateChangeDate, float? microsoftVSTSCommonTimeCriticality, float? microsoftVSTSSchedulingEffort, + float? microsoftVSTSSchedulingRemainingWork, DateTime microsoftVSTSSchedulingStartDate, + float? microsoftVSTSSchedulingStoryPoints, DateTime microsoftVSTSSchedulingTargetDate, string systemAreaPath, SystemAssignedTo systemAssignedTo, @@ -40,8 +42,8 @@ internal class Fields string systemTitle, string systemWorkItemType) { - CustomRequester = customRequester; CustomRRminusOE = customRRminusOE; + CustomRequester = customRequester; CustomWSJF = customWSJF; MicrosoftVSTSCommonActivatedDate = microsoftVSTSCommonActivatedDate; MicrosoftVSTSCommonBusinessValue = microsoftVSTSCommonBusinessValue; @@ -51,7 +53,9 @@ internal class Fields MicrosoftVSTSCommonStateChangeDate = microsoftVSTSCommonStateChangeDate; MicrosoftVSTSCommonTimeCriticality = microsoftVSTSCommonTimeCriticality; MicrosoftVSTSSchedulingEffort = microsoftVSTSSchedulingEffort; + MicrosoftVSTSSchedulingRemainingWork = microsoftVSTSSchedulingRemainingWork; MicrosoftVSTSSchedulingStartDate = microsoftVSTSSchedulingStartDate; + MicrosoftVSTSSchedulingStoryPoints = microsoftVSTSSchedulingStoryPoints; MicrosoftVSTSSchedulingTargetDate = microsoftVSTSSchedulingTargetDate; SystemAreaPath = systemAreaPath; SystemAssignedTo = systemAssignedTo; @@ -72,8 +76,8 @@ internal class Fields SystemWorkItemType = systemWorkItemType; } - [JsonPropertyName("Custom.Requester")] public CustomRequester? CustomRequester { get; } [JsonPropertyName("Custom.RRminusOE")] public float? CustomRRminusOE { get; } + [JsonPropertyName("Custom.Requester")] public CustomRequester? CustomRequester { get; } [JsonPropertyName("Custom.WSJF")] public float? CustomWSJF { get; } [JsonPropertyName("Microsoft.VSTS.Common.ActivatedDate")] public DateTime MicrosoftVSTSCommonActivatedDate { get; } [JsonPropertyName("Microsoft.VSTS.Common.BusinessValue")] public float? MicrosoftVSTSCommonBusinessValue { get; } @@ -83,7 +87,9 @@ internal class Fields [JsonPropertyName("Microsoft.VSTS.Common.StateChangeDate")] public DateTime MicrosoftVSTSCommonStateChangeDate { get; } [JsonPropertyName("Microsoft.VSTS.Common.TimeCriticality")] public float? MicrosoftVSTSCommonTimeCriticality { get; } [JsonPropertyName("Microsoft.VSTS.Scheduling.Effort")] public float? MicrosoftVSTSSchedulingEffort { get; } + [JsonPropertyName("Microsoft.VSTS.Scheduling.RemainingWork")] public float? MicrosoftVSTSSchedulingRemainingWork { get; } [JsonPropertyName("Microsoft.VSTS.Scheduling.StartDate")] public DateTime MicrosoftVSTSSchedulingStartDate { get; } + [JsonPropertyName("Microsoft.VSTS.Scheduling.StoryPoints")] public float? MicrosoftVSTSSchedulingStoryPoints { get; } [JsonPropertyName("Microsoft.VSTS.Scheduling.TargetDate")] public DateTime MicrosoftVSTSSchedulingTargetDate { get; } [JsonPropertyName("System.AreaPath")] public string SystemAreaPath { get; } [JsonPropertyName("System.AssignedTo")] public SystemAssignedTo? SystemAssignedTo { get; } diff --git a/Adaptation/FileHandlers/json/WorkItems/Record.cs b/Adaptation/FileHandlers/json/WorkItems/Record.cs index 94cc23c..37481fb 100644 --- a/Adaptation/FileHandlers/json/WorkItems/Record.cs +++ b/Adaptation/FileHandlers/json/WorkItems/Record.cs @@ -30,34 +30,36 @@ internal class Record internal static Record GetWithoutNesting(Record record, string? violation) { Record result; - WorkItem workItem = new(record.WorkItem.ActivatedDate, - record.WorkItem.AreaPath, - record.WorkItem.AssignedTo, - record.WorkItem.BusinessValue, - record.WorkItem.ChangedDate, - record.WorkItem.ClosedDate, - record.WorkItem.CommentCount, - record.WorkItem.CreatedDate, - record.WorkItem.Description, - record.WorkItem.Effort, - record.WorkItem.Id, - record.WorkItem.IterationPath, - record.WorkItem.Parent, - record.WorkItem.Priority, - record.WorkItem.Relations, - record.WorkItem.Requester, - record.WorkItem.ResolvedDate, - record.WorkItem.Revision, - record.WorkItem.RiskReductionMinusOpportunityEnablement, - record.WorkItem.StartDate, - record.WorkItem.State, - record.WorkItem.Tags, - record.WorkItem.TargetDate, - record.WorkItem.TimeCriticality, - record.WorkItem.Title, - record.WorkItem.Violation is null ? violation : record.WorkItem.Violation, - record.WorkItem.WeightedShortestJobFirst, - record.WorkItem.WorkItemType); + WorkItem workItem = new(activatedDate: record.WorkItem.ActivatedDate, + areaPath: record.WorkItem.AreaPath, + assignedTo: record.WorkItem.AssignedTo, + businessValue: record.WorkItem.BusinessValue, + changedDate: record.WorkItem.ChangedDate, + closedDate: record.WorkItem.ClosedDate, + commentCount: record.WorkItem.CommentCount, + createdDate: record.WorkItem.CreatedDate, + description: record.WorkItem.Description, + effort: record.WorkItem.Effort, + id: record.WorkItem.Id, + iterationPath: record.WorkItem.IterationPath, + parent: record.WorkItem.Parent, + priority: record.WorkItem.Priority, + relations: record.WorkItem.Relations, + remainingWork: record.WorkItem.RemainingWork, + requester: record.WorkItem.Requester, + resolvedDate: record.WorkItem.ResolvedDate, + revision: record.WorkItem.Revision, + riskReductionMinusOpportunityEnablement: record.WorkItem.RiskReductionMinusOpportunityEnablement, + startDate: record.WorkItem.StartDate, + state: record.WorkItem.State, + storyPoints: record.WorkItem.StoryPoints, + tags: record.WorkItem.Tags, + targetDate: record.WorkItem.TargetDate, + timeCriticality: record.WorkItem.TimeCriticality, + title: record.WorkItem.Title, + violation: record.WorkItem.Violation is null ? violation : record.WorkItem.Violation, + weightedShortestJobFirst: record.WorkItem.WeightedShortestJobFirst, + workItemType: record.WorkItem.WorkItemType); result = new(workItem, record.Parent, Array.Empty(), Array.Empty(), Array.Empty()); return result; } diff --git a/Adaptation/FileHandlers/json/WorkItems/WorkItem.cs b/Adaptation/FileHandlers/json/WorkItems/WorkItem.cs index 0738560..bf12702 100644 --- a/Adaptation/FileHandlers/json/WorkItems/WorkItem.cs +++ b/Adaptation/FileHandlers/json/WorkItems/WorkItem.cs @@ -24,12 +24,14 @@ internal class WorkItem int? parent, int? priority, Relation[]? relations, + long? remainingWork, string? requester, DateTime? resolvedDate, int revision, long? riskReductionMinusOpportunityEnablement, DateTime? startDate, string state, + long? storyPoints, string tags, DateTime? targetDate, long? timeCriticality, @@ -53,12 +55,14 @@ internal class WorkItem Parent = parent; Priority = priority; Relations = relations; + RemainingWork = remainingWork; Requester = requester; ResolvedDate = resolvedDate; Revision = revision; RiskReductionMinusOpportunityEnablement = riskReductionMinusOpportunityEnablement; StartDate = startDate; State = state; + StoryPoints = storyPoints; Tags = tags; TargetDate = targetDate; TimeCriticality = timeCriticality; @@ -72,67 +76,71 @@ internal class WorkItem public static WorkItem Get(WorkItem workItem, Relation[] relations) { - WorkItem result = new(workItem.ActivatedDate, - workItem.AreaPath, - workItem.AssignedTo, - workItem.BusinessValue, - workItem.ChangedDate, - workItem.ClosedDate, - workItem.CommentCount, - workItem.CreatedDate, - workItem.Description, - workItem.Effort, - workItem.Id, - workItem.IterationPath, - workItem.Parent, - workItem.Priority, - relations, - workItem.Requester, - workItem.ResolvedDate, - workItem.Revision, - workItem.RiskReductionMinusOpportunityEnablement, - workItem.StartDate, - workItem.State, - workItem.Tags, - workItem.TargetDate, - workItem.TimeCriticality, - workItem.Title, - workItem.Violation, - workItem.WeightedShortestJobFirst, - workItem.WorkItemType); + WorkItem result = new(activatedDate: workItem.ActivatedDate, + areaPath: workItem.AreaPath, + assignedTo: workItem.AssignedTo, + businessValue: workItem.BusinessValue, + changedDate: workItem.ChangedDate, + closedDate: workItem.ClosedDate, + commentCount: workItem.CommentCount, + createdDate: workItem.CreatedDate, + description: workItem.Description, + effort: workItem.Effort, + id: workItem.Id, + iterationPath: workItem.IterationPath, + parent: workItem.Parent, + priority: workItem.Priority, + relations: relations, + remainingWork: workItem.RemainingWork, + requester: workItem.Requester, + resolvedDate: workItem.ResolvedDate, + revision: workItem.Revision, + riskReductionMinusOpportunityEnablement: workItem.RiskReductionMinusOpportunityEnablement, + startDate: workItem.StartDate, + state: workItem.State, + storyPoints: workItem.StoryPoints, + tags: workItem.Tags, + targetDate: workItem.TargetDate, + timeCriticality: workItem.TimeCriticality, + title: workItem.Title, + violation: workItem.Violation, + weightedShortestJobFirst: workItem.WeightedShortestJobFirst, + workItemType: workItem.WorkItemType); return result; } public static WorkItem? GetWithOutRelations(WorkItem? workItem) { - WorkItem? result = workItem is null ? null : new(workItem.ActivatedDate, - workItem.AreaPath, - workItem.AssignedTo, - workItem.BusinessValue, - workItem.ChangedDate, - workItem.ClosedDate, - workItem.CommentCount, - workItem.CreatedDate, - workItem.Description, - workItem.Effort, - workItem.Id, - workItem.IterationPath, - workItem.Parent, - workItem.Priority, - Array.Empty(), - workItem.Requester, - workItem.ResolvedDate, - workItem.Revision, - workItem.RiskReductionMinusOpportunityEnablement, - workItem.StartDate, - workItem.State, - workItem.Tags, - workItem.TargetDate, - workItem.TimeCriticality, - workItem.Title, - workItem.Violation, - workItem.WeightedShortestJobFirst, - workItem.WorkItemType); + WorkItem? result = workItem is null ? null : new(activatedDate: workItem.ActivatedDate, + areaPath: workItem.AreaPath, + assignedTo: workItem.AssignedTo, + businessValue: workItem.BusinessValue, + changedDate: workItem.ChangedDate, + closedDate: workItem.ClosedDate, + commentCount: workItem.CommentCount, + createdDate: workItem.CreatedDate, + description: workItem.Description, + effort: workItem.Effort, + id: workItem.Id, + iterationPath: workItem.IterationPath, + parent: workItem.Parent, + priority: workItem.Priority, + relations: Array.Empty(), + remainingWork: workItem.RemainingWork, + requester: workItem.Requester, + resolvedDate: workItem.ResolvedDate, + revision: workItem.Revision, + riskReductionMinusOpportunityEnablement: workItem.RiskReductionMinusOpportunityEnablement, + startDate: workItem.StartDate, + state: workItem.State, + storyPoints: workItem.StoryPoints, + tags: workItem.Tags, + targetDate: workItem.TargetDate, + timeCriticality: workItem.TimeCriticality, + title: workItem.Title, + violation: workItem.Violation, + weightedShortestJobFirst: workItem.WeightedShortestJobFirst, + workItemType: workItem.WorkItemType); return result; } @@ -151,12 +159,14 @@ internal class WorkItem [JsonPropertyName("Parent")] public int? Parent { get; } [JsonPropertyName("Priority")] public int? Priority { get; } [JsonPropertyName("Relations")] public Relation[]? Relations { get; } + [JsonPropertyName("RemainingWork")] public long? RemainingWork { get; } [JsonPropertyName("Requester")] public string? Requester { get; } [JsonPropertyName("ResolvedDate")] public DateTime? ResolvedDate { get; } [JsonPropertyName("Revision")] public int Revision { get; } [JsonPropertyName("RiskReductionMinusOpportunityEnablement")] public long? RiskReductionMinusOpportunityEnablement { get; } [JsonPropertyName("StartDate")] public DateTime? StartDate { get; } [JsonPropertyName("State")] public string State { get; } + [JsonPropertyName("StoryPoints")] public long? StoryPoints { get; } [JsonPropertyName("Tags")] public string Tags { get; } [JsonPropertyName("TargetDate")] public DateTime? TargetDate { get; } [JsonPropertyName("TimeCriticality")] public long? TimeCriticality { get; } diff --git a/Adaptation/MESAFIBACKLOG.yml b/Adaptation/MESAFIBACKLOG.yml index dc6dc2c..4953d2e 100644 --- a/Adaptation/MESAFIBACKLOG.yml +++ b/Adaptation/MESAFIBACKLOG.yml @@ -60,24 +60,6 @@ stages: echo $(Configuration) displayName: Configuration - - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Restore /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=$(Configuration);TargetFrameworkVersion=v4.8 /p:RestoreSources=$(NugetSource)' - displayName: "MSBuild Restore" - - - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=$(Configuration);TargetFrameworkVersion=v4.8' - displayName: MSBuild - - - script: 'echo $(Build.Repository.Name)-$(Build.BuildId)-$(Build.SourceVersion)>bin\$(Configuration)\$(Build.Repository.Name).txt' - displayName: "Commit Id" - - - task: CopyFiles@2 - displayName: 'Copy Files to: D:\Framework4.8' - inputs: - Contents: "*$(Build.Repository.Name)*" - SourceFolder: 'bin\$(Configuration)' - TargetFolder: 'D:\Framework4.8\$(Build.Repository.Name)-$(Build.BuildId)-$(Build.SourceVersion)-$(Configuration)' - OverWrite: true - enabled: true - - script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)' workingDirectory: Adaptation displayName: "Core Build - Adaptation" @@ -99,9 +81,20 @@ stages: - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=$(Configuration);TargetFrameworkVersion=v4.8' displayName: MSBuild - - script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)' - workingDirectory: Adaptation - displayName: "Core Build - Adaptation" + - script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /detailedsummary /consoleloggerparameters:PerformanceSummary;ErrorsOnly; /property:Configuration=$(Configuration);TargetFrameworkVersion=v4.8' + displayName: MSBuild + + - script: 'echo $(Build.Repository.Name)-$(Build.BuildId)-$(Build.SourceVersion)>bin\$(Configuration)\$(Build.Repository.Name).txt' + displayName: "Commit Id" + + - task: CopyFiles@2 + displayName: 'Copy Files to: D:\EAF' + inputs: + Contents: "*$(Build.Repository.Name)*" + SourceFolder: 'bin\$(Configuration)' + TargetFolder: 'D:\EAF\EAF Deployment Storage\Adaptation_$(Build.Repository.Name)' + OverWrite: true + enabled: true - job: TestDebug dependsOn: @@ -220,11 +213,11 @@ stages: displayName: "Commit Id" - task: CopyFiles@2 - displayName: 'Copy Files to: D:\Framework4.8' + displayName: 'Copy Files to: D:\EAF' inputs: Contents: "*$(Build.Repository.Name)*" SourceFolder: 'bin\$(Configuration)' - TargetFolder: 'D:\Framework4.8\$(Build.Repository.Name)-$(Build.BuildId)-$(Build.SourceVersion)-$(Configuration)' + TargetFolder: 'D:\EAF\EAF Deployment Storage\Adaptation_$(Build.Repository.Name)' OverWrite: true - script: '"C:\program files\dotnet\dotnet.exe" build --configuration $(Configuration) --source $(NugetSource)'