From d8e6c11b1bb9af958751b49d89baef48019c0fef Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 4 Jul 2022 19:43:33 -0300 Subject: [PATCH 001/189] Adjust solution directory --- ...evopsTracker.sln => AzureDevopsTracker.sln | 14 +-- AzureDevopsTracker/DTOs/WorkItemDTO.cs | 100 ------------------ AzureDevopsTracker/Helpers/MarkdownHelper.cs | 10 -- .../Helpers/MicrosoftTeamsHelper.cs | 10 -- .../Integrations/MessageBaseIntegration.cs | 11 -- .../LICENSE.md.txt => LICENSE.md.txt | 0 .../Adapters/WorkItemAdapter.cs | 0 .../AzureDevopsTracker.csproj | 0 .../Configurations/Configuration.cs | 0 .../DTOs/Create/CreateWorkItemDTO.cs | 4 +- .../DTOs/Delete/DeleteWorkItemDTO.cs | 4 +- {AzureDevopsTracker => src}/DTOs/Fields.cs | 38 +++---- {AzureDevopsTracker => src}/DTOs/Resource.cs | 6 +- .../DTOs/Restore/RestoreWorkItemDTO.cs | 4 +- .../DTOs/Update/UpdateWorkItemDTO.cs | 36 +++---- src/DTOs/WorkItemDTO.cs | 100 ++++++++++++++++++ .../Data/ChangeLogItemRepository.cs | 0 .../Data/ChangeLogRepository.cs | 1 - .../Data/Context/AzureDevopsTrackerContext.cs | 0 .../Data/DataBaseConfig.cs | 0 .../Data/Mapping/ChangeLogItemMapping.cs | 0 .../Data/Mapping/ChangeLogMapping.cs | 0 .../Data/Mapping/CustomFieldMapping.cs | 0 .../Data/Repository.cs | 0 .../Data/WorkItemRepository.cs | 0 .../Entities/ChangeLog.cs | 29 ++--- .../Entities/ChangeLogItem.cs | 20 ++-- .../Entities/Entity.cs | 1 + .../Entities/TimeByState.cs | 7 +- .../Entities/WorkItem.cs | 25 +---- .../Entities/WorkItemChange.cs | 17 +-- .../Entities/WorkItemCustomField.cs | 11 +- .../Extensions/HelperExtenions.cs | 0 src/Helpers/MarkdownHelper.cs | 4 + src/Helpers/MicrosoftTeamsHelper.cs | 4 + .../Helpers/RawTextHelper.cs | 0 .../Helpers/ReadJsonHelper.cs | 0 .../Integrations/DiscordIntegration.cs | 0 .../Integrations/FakeIntegration.cs | 5 +- src/Integrations/MessageBaseIntegration.cs | 4 + .../Integrations/MessageConfig.cs | 6 +- .../Integrations/MessageFacade.cs | 0 .../Integrations/MessageIntegration.cs | 2 +- .../Integrations/MicrosoftTeamsIntegration.cs | 6 +- .../Interfaces/IAzureDevopsTrackerService.cs | 0 .../Interfaces/IChangeLogService.cs | 1 - .../Interfaces/IWorkItemAdapter.cs | 0 .../Internals/IChangeLogItemRepository.cs | 0 .../Internals/IChangeLogRepository.cs | 1 - .../Interfaces/Internals/IRepository.cs | 0 .../Internals/IWorkItemRepository.cs | 0 ...AzureDevopsStateTrackerInitial.Designer.cs | 0 ...19163846_AzureDevopsStateTrackerInitial.cs | 4 +- ...20105645_FunctionToTimeInitial.Designer.cs | 0 .../20210720105645_FunctionToTimeInitial.cs | 3 +- ...20210831213210_UpdatingColumns.Designer.cs | 0 .../20210831213210_UpdatingColumns.cs | 0 ...831213948_UpdatingCustomColumn.Designer.cs | 0 .../20210831213948_UpdatingCustomColumn.cs | 0 ...0211213213716_Adding_ChangeLog.Designer.cs | 0 .../20211213213716_Adding_ChangeLog.cs | 4 +- ...20211220212121_AddField_Number.Designer.cs | 0 .../20211220212121_AddField_Number.cs | 0 ...0607220158_WorkItem_AddDeleted.Designer.cs | 0 .../20220607220158_WorkItem_AddDeleted.cs | 0 .../20220621170433_CustomFields.Designer.cs | 0 .../Migrations/20220621170433_CustomFields.cs | 0 ...eDevopsStateTrackerContextModelSnapshot.cs | 0 .../Services/AzureDevopsTrackerService.cs | 0 .../Services/ChangeLogService.cs | 4 +- .../Statics/ConfigurationStatics.cs | 6 +- .../Statics/WorkItemStatics.cs | 0 {AzureDevopsTracker => src}/adt_icon.png | Bin 73 files changed, 220 insertions(+), 282 deletions(-) rename AzureDevopsTracker/AzureDevopsTracker.sln => AzureDevopsTracker.sln (63%) delete mode 100644 AzureDevopsTracker/DTOs/WorkItemDTO.cs delete mode 100644 AzureDevopsTracker/Helpers/MarkdownHelper.cs delete mode 100644 AzureDevopsTracker/Helpers/MicrosoftTeamsHelper.cs delete mode 100644 AzureDevopsTracker/Integrations/MessageBaseIntegration.cs rename AzureDevopsTracker/LICENSE.md.txt => LICENSE.md.txt (100%) rename {AzureDevopsTracker => src}/Adapters/WorkItemAdapter.cs (100%) rename {AzureDevopsTracker => src}/AzureDevopsTracker.csproj (100%) rename {AzureDevopsTracker => src}/Configurations/Configuration.cs (100%) rename {AzureDevopsTracker => src}/DTOs/Create/CreateWorkItemDTO.cs (69%) rename {AzureDevopsTracker => src}/DTOs/Delete/DeleteWorkItemDTO.cs (70%) rename {AzureDevopsTracker => src}/DTOs/Fields.cs (68%) rename {AzureDevopsTracker => src}/DTOs/Resource.cs (69%) rename {AzureDevopsTracker => src}/DTOs/Restore/RestoreWorkItemDTO.cs (69%) rename {AzureDevopsTracker => src}/DTOs/Update/UpdateWorkItemDTO.cs (59%) create mode 100644 src/DTOs/WorkItemDTO.cs rename {AzureDevopsTracker => src}/Data/ChangeLogItemRepository.cs (100%) rename {AzureDevopsTracker => src}/Data/ChangeLogRepository.cs (93%) rename {AzureDevopsTracker => src}/Data/Context/AzureDevopsTrackerContext.cs (100%) rename {AzureDevopsTracker => src}/Data/DataBaseConfig.cs (100%) rename {AzureDevopsTracker => src}/Data/Mapping/ChangeLogItemMapping.cs (100%) rename {AzureDevopsTracker => src}/Data/Mapping/ChangeLogMapping.cs (100%) rename {AzureDevopsTracker => src}/Data/Mapping/CustomFieldMapping.cs (100%) rename {AzureDevopsTracker => src}/Data/Repository.cs (100%) rename {AzureDevopsTracker => src}/Data/WorkItemRepository.cs (100%) rename {AzureDevopsTracker => src}/Entities/ChangeLog.cs (73%) rename {AzureDevopsTracker => src}/Entities/ChangeLogItem.cs (76%) rename {AzureDevopsTracker => src}/Entities/Entity.cs (99%) rename {AzureDevopsTracker => src}/Entities/TimeByState.cs (83%) rename {AzureDevopsTracker => src}/Entities/WorkItem.cs (94%) rename {AzureDevopsTracker => src}/Entities/WorkItemChange.cs (91%) rename {AzureDevopsTracker => src}/Entities/WorkItemCustomField.cs (69%) rename {AzureDevopsTracker => src}/Extensions/HelperExtenions.cs (100%) create mode 100644 src/Helpers/MarkdownHelper.cs create mode 100644 src/Helpers/MicrosoftTeamsHelper.cs rename {AzureDevopsTracker => src}/Helpers/RawTextHelper.cs (100%) rename {AzureDevopsTracker => src}/Helpers/ReadJsonHelper.cs (100%) rename {AzureDevopsTracker => src}/Integrations/DiscordIntegration.cs (100%) rename {AzureDevopsTracker => src}/Integrations/FakeIntegration.cs (64%) create mode 100644 src/Integrations/MessageBaseIntegration.cs rename {AzureDevopsTracker => src}/Integrations/MessageConfig.cs (77%) rename {AzureDevopsTracker => src}/Integrations/MessageFacade.cs (100%) rename {AzureDevopsTracker => src}/Integrations/MessageIntegration.cs (98%) rename {AzureDevopsTracker => src}/Integrations/MicrosoftTeamsIntegration.cs (94%) rename {AzureDevopsTracker => src}/Interfaces/IAzureDevopsTrackerService.cs (100%) rename {AzureDevopsTracker => src}/Interfaces/IChangeLogService.cs (89%) rename {AzureDevopsTracker => src}/Interfaces/IWorkItemAdapter.cs (100%) rename {AzureDevopsTracker => src}/Interfaces/Internals/IChangeLogItemRepository.cs (100%) rename {AzureDevopsTracker => src}/Interfaces/Internals/IChangeLogRepository.cs (86%) rename {AzureDevopsTracker => src}/Interfaces/Internals/IRepository.cs (100%) rename {AzureDevopsTracker => src}/Interfaces/Internals/IWorkItemRepository.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20210719163846_AzureDevopsStateTrackerInitial.Designer.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20210719163846_AzureDevopsStateTrackerInitial.cs (99%) rename {AzureDevopsTracker => src}/Migrations/20210720105645_FunctionToTimeInitial.Designer.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20210720105645_FunctionToTimeInitial.cs (95%) rename {AzureDevopsTracker => src}/Migrations/20210831213210_UpdatingColumns.Designer.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20210831213210_UpdatingColumns.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20210831213948_UpdatingCustomColumn.Designer.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20210831213948_UpdatingCustomColumn.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20211213213716_Adding_ChangeLog.Designer.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20211213213716_Adding_ChangeLog.cs (98%) rename {AzureDevopsTracker => src}/Migrations/20211220212121_AddField_Number.Designer.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20211220212121_AddField_Number.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20220607220158_WorkItem_AddDeleted.Designer.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20220607220158_WorkItem_AddDeleted.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20220621170433_CustomFields.Designer.cs (100%) rename {AzureDevopsTracker => src}/Migrations/20220621170433_CustomFields.cs (100%) rename {AzureDevopsTracker => src}/Migrations/AzureDevopsStateTrackerContextModelSnapshot.cs (100%) rename {AzureDevopsTracker => src}/Services/AzureDevopsTrackerService.cs (100%) rename {AzureDevopsTracker => src}/Services/ChangeLogService.cs (95%) rename {AzureDevopsTracker => src}/Statics/ConfigurationStatics.cs (57%) rename {AzureDevopsTracker => src}/Statics/WorkItemStatics.cs (100%) rename {AzureDevopsTracker => src}/adt_icon.png (100%) diff --git a/AzureDevopsTracker/AzureDevopsTracker.sln b/AzureDevopsTracker.sln similarity index 63% rename from AzureDevopsTracker/AzureDevopsTracker.sln rename to AzureDevopsTracker.sln index 5610a58..b715220 100644 --- a/AzureDevopsTracker/AzureDevopsTracker.sln +++ b/AzureDevopsTracker.sln @@ -1,9 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31402.337 +# Visual Studio Version 17 +VisualStudioVersion = 17.2.32616.157 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureDevopsTracker", "AzureDevopsTracker.csproj", "{26FE19B9-7CD6-4418-9112-2E3C363985BF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureDevopsTracker", "src\AzureDevopsTracker.csproj", "{36601E24-C989-4E11-BD8F-572F2F181ED1}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -11,10 +11,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {26FE19B9-7CD6-4418-9112-2E3C363985BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {26FE19B9-7CD6-4418-9112-2E3C363985BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {26FE19B9-7CD6-4418-9112-2E3C363985BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {26FE19B9-7CD6-4418-9112-2E3C363985BF}.Release|Any CPU.Build.0 = Release|Any CPU + {36601E24-C989-4E11-BD8F-572F2F181ED1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36601E24-C989-4E11-BD8F-572F2F181ED1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36601E24-C989-4E11-BD8F-572F2F181ED1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36601E24-C989-4E11-BD8F-572F2F181ED1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/AzureDevopsTracker/DTOs/WorkItemDTO.cs b/AzureDevopsTracker/DTOs/WorkItemDTO.cs deleted file mode 100644 index e79e1fd..0000000 --- a/AzureDevopsTracker/DTOs/WorkItemDTO.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; - -namespace AzureDevopsTracker.DTOs -{ - public class WorkItemDTO - { - [JsonProperty("id")] - public string Id { get; set; } - - [JsonProperty("created_at")] - public DateTime CreatedAt { get; set; } - - [JsonProperty("assigned_to")] - public string AssignedTo { get; set; } - - [JsonProperty("type")] - public string Type { get; set; } - - [JsonProperty("effort")] - public string Effort { get; set; } - - [JsonProperty("story_points")] - public string StoryPoints { get; set; } - - [JsonProperty("original_estimate")] - public string OriginalEstimate { get; set; } - - [JsonProperty("created_by")] - public string CreatedBy { get; set; } - - [JsonProperty("title")] - public string Title { get; set; } - - [JsonProperty("team_project")] - public string TeamProject { get; set; } - - [JsonProperty("iteration_path")] - public string IterationPath { get; set; } - - [JsonProperty("area_path")] - public string AreaPath { get; set; } - - [JsonProperty("current_status")] - public string CurrentStatus { get; set; } - - [JsonProperty("work_item_parent_id")] - public string WorkItemParentId { get; set; } - - [JsonProperty("activity")] - public string Activity { get; set; } - - [JsonProperty("tags")] - public IEnumerable Tags { get; set; } - - [JsonProperty("workItems_changes")] - public List WorkItemsChangesDTO { get; set; } - - [JsonProperty("times_by_state")] - public List TimesByStateDTO { get; set; } - } - - public class WorkItemChangeDTO - { - [JsonProperty("new_date")] - public DateTime NewDate { get; set; } - - [JsonProperty("new_state")] - public string NewState { get; set; } - - [JsonProperty("old_state")] - public string OldState { get; set; } - - [JsonProperty("old_date")] - public DateTime? OldDate { get; set; } - - [JsonProperty("changed_by")] - public string ChangedBy { get; set; } - } - - - public class TimeByStateDTO - { - [JsonProperty("created_at")] - public DateTime CreatedAt { get; set; } - - [JsonProperty("updated_at")] - public DateTime UpdatedAt { get; set; } - - [JsonProperty("state")] - public string State { get; set; } - - [JsonProperty("total_time")] - public string TotalTime { get; set; } - - [JsonProperty("total_worked_time")] - public string TotalWorkedTime { get; set; } - } -} diff --git a/AzureDevopsTracker/Helpers/MarkdownHelper.cs b/AzureDevopsTracker/Helpers/MarkdownHelper.cs deleted file mode 100644 index f2b062e..0000000 --- a/AzureDevopsTracker/Helpers/MarkdownHelper.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace AzureDevopsTracker.Helpers -{ - internal static class MarkdownHelper - { - } -} diff --git a/AzureDevopsTracker/Helpers/MicrosoftTeamsHelper.cs b/AzureDevopsTracker/Helpers/MicrosoftTeamsHelper.cs deleted file mode 100644 index e4e7e4c..0000000 --- a/AzureDevopsTracker/Helpers/MicrosoftTeamsHelper.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace AzureDevopsTracker.Helpers -{ - internal static class MicrosoftTeamsHelper - { - } -} diff --git a/AzureDevopsTracker/Integrations/MessageBaseIntegration.cs b/AzureDevopsTracker/Integrations/MessageBaseIntegration.cs deleted file mode 100644 index 6390c21..0000000 --- a/AzureDevopsTracker/Integrations/MessageBaseIntegration.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace AzureDevopsTracker.Integrations -{ - internal abstract class MessageBaseIntegration - { - - } -} diff --git a/AzureDevopsTracker/LICENSE.md.txt b/LICENSE.md.txt similarity index 100% rename from AzureDevopsTracker/LICENSE.md.txt rename to LICENSE.md.txt diff --git a/AzureDevopsTracker/Adapters/WorkItemAdapter.cs b/src/Adapters/WorkItemAdapter.cs similarity index 100% rename from AzureDevopsTracker/Adapters/WorkItemAdapter.cs rename to src/Adapters/WorkItemAdapter.cs diff --git a/AzureDevopsTracker/AzureDevopsTracker.csproj b/src/AzureDevopsTracker.csproj similarity index 100% rename from AzureDevopsTracker/AzureDevopsTracker.csproj rename to src/AzureDevopsTracker.csproj diff --git a/AzureDevopsTracker/Configurations/Configuration.cs b/src/Configurations/Configuration.cs similarity index 100% rename from AzureDevopsTracker/Configurations/Configuration.cs rename to src/Configurations/Configuration.cs diff --git a/AzureDevopsTracker/DTOs/Create/CreateWorkItemDTO.cs b/src/DTOs/Create/CreateWorkItemDTO.cs similarity index 69% rename from AzureDevopsTracker/DTOs/Create/CreateWorkItemDTO.cs rename to src/DTOs/Create/CreateWorkItemDTO.cs index e19f527..26e6126 100644 --- a/AzureDevopsTracker/DTOs/Create/CreateWorkItemDTO.cs +++ b/src/DTOs/Create/CreateWorkItemDTO.cs @@ -3,10 +3,10 @@ namespace AzureDevopsTracker.DTOs.Create { - public class CreateWorkItemDTO + public record CreateWorkItemDTO { [JsonPropertyName("resource")] [JsonProperty("resource")] - public Resource Resource { get; set; } + public Resource Resource { get; init; } } } \ No newline at end of file diff --git a/AzureDevopsTracker/DTOs/Delete/DeleteWorkItemDTO.cs b/src/DTOs/Delete/DeleteWorkItemDTO.cs similarity index 70% rename from AzureDevopsTracker/DTOs/Delete/DeleteWorkItemDTO.cs rename to src/DTOs/Delete/DeleteWorkItemDTO.cs index 6b2e982..53d8d27 100644 --- a/AzureDevopsTracker/DTOs/Delete/DeleteWorkItemDTO.cs +++ b/src/DTOs/Delete/DeleteWorkItemDTO.cs @@ -3,10 +3,10 @@ namespace AzureDevopsTracker.DTOs.Delete { - public class DeleteWorkItemDTO + public record DeleteWorkItemDTO { [JsonPropertyName("resource")] [JsonProperty("resource")] - public Resource Resource { get; set; } + public Resource Resource { get; init; } } } diff --git a/AzureDevopsTracker/DTOs/Fields.cs b/src/DTOs/Fields.cs similarity index 68% rename from AzureDevopsTracker/DTOs/Fields.cs rename to src/DTOs/Fields.cs index aef4bd1..5b37626 100644 --- a/AzureDevopsTracker/DTOs/Fields.cs +++ b/src/DTOs/Fields.cs @@ -4,77 +4,77 @@ namespace AzureDevopsTracker.DTOs { - public class Fields + public record Fields { [JsonPropertyName("System.AreaPath")] [JsonProperty("System.AreaPath")] - public string AreaPath { get; set; } + public string AreaPath { get; init; } [JsonPropertyName("System.TeamProject")] [JsonProperty("System.TeamProject")] - public string TeamProject { get; set; } + public string TeamProject { get; init; } [JsonPropertyName("System.IterationPath")] [JsonProperty("System.IterationPath")] - public string IterationPath { get; set; } + public string IterationPath { get; init; } [JsonPropertyName("System.AssignedTo")] [JsonProperty("System.AssignedTo")] - public string AssignedTo { get; set; } + public string AssignedTo { get; init; } [JsonPropertyName("System.WorkItemType")] [JsonProperty("System.WorkItemType")] - public string Type { get; set; } + public string Type { get; init; } [JsonPropertyName("System.CreatedDate")] [JsonProperty("System.CreatedDate")] - public DateTime CreatedDate { get; set; } + public DateTime CreatedDate { get; init; } [JsonPropertyName("System.CreatedBy")] [JsonProperty("System.CreatedBy")] - public string CreatedBy { get; set; } + public string CreatedBy { get; init; } [JsonPropertyName("System.ChangedBy")] [JsonProperty("System.ChangedBy")] - public string ChangedBy { get; set; } + public string ChangedBy { get; init; } [JsonPropertyName("System.State")] [JsonProperty("System.State")] - public string State { get; set; } + public string State { get; init; } [JsonPropertyName("System.Title")] [JsonProperty("System.Title")] - public string Title { get; set; } + public string Title { get; init; } [JsonPropertyName("System.Tags")] [JsonProperty("System.Tags")] - public string Tags { get; set; } + public string Tags { get; init; } [JsonPropertyName("System.Parent")] [JsonProperty("System.Parent")] - public string Parent { get; set; } + public string Parent { get; init; } [JsonPropertyName("Microsoft.VSTS.Scheduling.StoryPoints")] [JsonProperty("Microsoft.VSTS.Scheduling.StoryPoints")] - public string StoryPoints { get; set; } + public string StoryPoints { get; init; } [JsonPropertyName("Microsoft.VSTS.Scheduling.OriginalEstimate")] [JsonProperty("Microsoft.VSTS.Scheduling.OriginalEstimate")] - public string OriginalEstimate { get; set; } + public string OriginalEstimate { get; init; } [JsonPropertyName("Microsoft.VSTS.Scheduling.RemainingWork")] [JsonProperty("Microsoft.VSTS.Scheduling.RemainingWork")] - public string RemainingWork { get; set; } + public string RemainingWork { get; init; } [JsonPropertyName("Microsoft.VSTS.Scheduling.Effort")] [JsonProperty("Microsoft.VSTS.Scheduling.Effort")] - public string Effort { get; set; } + public string Effort { get; init; } [JsonPropertyName("Microsoft.VSTS.Common.Activity")] [JsonProperty("Microsoft.VSTS.Common.Activity")] - public string Activity { get; set; } + public string Activity { get; init; } [JsonProperty("Custom.ChangeLogDescription")] - public string ChangeLogDescription { get; set; } + public string ChangeLogDescription { get; init; } } } \ No newline at end of file diff --git a/AzureDevopsTracker/DTOs/Resource.cs b/src/DTOs/Resource.cs similarity index 69% rename from AzureDevopsTracker/DTOs/Resource.cs rename to src/DTOs/Resource.cs index 7127dd6..45cf0a3 100644 --- a/AzureDevopsTracker/DTOs/Resource.cs +++ b/src/DTOs/Resource.cs @@ -3,14 +3,14 @@ namespace AzureDevopsTracker.DTOs { - public class Resource + public record Resource { [JsonPropertyName("id")] [JsonProperty("id")] - public string Id { get; set; } + public string Id { get; init; } [JsonPropertyName("fields")] [JsonProperty("fields")] - public Fields Fields { get; set; } + public Fields Fields { get; init; } } } diff --git a/AzureDevopsTracker/DTOs/Restore/RestoreWorkItemDTO.cs b/src/DTOs/Restore/RestoreWorkItemDTO.cs similarity index 69% rename from AzureDevopsTracker/DTOs/Restore/RestoreWorkItemDTO.cs rename to src/DTOs/Restore/RestoreWorkItemDTO.cs index c5d2890..0aead27 100644 --- a/AzureDevopsTracker/DTOs/Restore/RestoreWorkItemDTO.cs +++ b/src/DTOs/Restore/RestoreWorkItemDTO.cs @@ -3,10 +3,10 @@ namespace AzureDevopsTracker.DTOs.Restore { - public class RestoreWorkItemDTO + public record RestoreWorkItemDTO { [JsonPropertyName("resource")] [JsonProperty("resource")] - public Resource Resource { get; set; } + public Resource Resource { get; init; } } } diff --git a/AzureDevopsTracker/DTOs/Update/UpdateWorkItemDTO.cs b/src/DTOs/Update/UpdateWorkItemDTO.cs similarity index 59% rename from AzureDevopsTracker/DTOs/Update/UpdateWorkItemDTO.cs rename to src/DTOs/Update/UpdateWorkItemDTO.cs index 8907979..714131d 100644 --- a/AzureDevopsTracker/DTOs/Update/UpdateWorkItemDTO.cs +++ b/src/DTOs/Update/UpdateWorkItemDTO.cs @@ -4,70 +4,70 @@ namespace AzureDevopsTracker.DTOs.Update { - public class UpdatedWorkItemDTO + public record UpdatedWorkItemDTO { [JsonPropertyName("resource")] [JsonProperty("resource")] - public Resource Resource { get; set; } + public Resource Resource { get; init; } } - public class Resource + public record Resource { [JsonPropertyName("workItemId")] [JsonProperty("workItemId")] - public string WorkItemId { get; set; } + public string WorkItemId { get; init; } [JsonPropertyName("fields")] [JsonProperty("fields")] - public ResourceFields Fields { get; set; } + public ResourceFields Fields { get; init; } [JsonPropertyName("revision")] [JsonProperty("revision")] - public Revision Revision { get; set; } + public Revision Revision { get; init; } } - public class Revision + public record Revision { [JsonPropertyName("fields")] [JsonProperty("fields")] - public Fields Fields { get; set; } + public Fields Fields { get; init; } } - public class ResourceFields + public record ResourceFields { [JsonPropertyName("System.State")] [JsonProperty("System.State")] - public OldNewValues State { get; set; } + public OldNewValues State { get; init; } [JsonPropertyName("Microsoft.VSTS.Common.StateChangeDate")] [JsonProperty("Microsoft.VSTS.Common.StateChangeDate")] - public DateTimeOldNewValues StateChangeDate { get; set; } + public DateTimeOldNewValues StateChangeDate { get; init; } [JsonPropertyName("System.ChangedBy")] [JsonProperty("System.ChangedBy")] - public OldNewValues ChangedBy { get; set; } + public OldNewValues ChangedBy { get; init; } } - public class OldNewValues + public record OldNewValues { [JsonPropertyName("oldValue")] [JsonProperty("oldValue")] - public string OldValue { get; set; } + public string OldValue { get; init; } [JsonPropertyName("newValue")] [JsonProperty("newValue")] - public string NewValue { get; set; } + public string NewValue { get; init; } } - public class DateTimeOldNewValues + public record DateTimeOldNewValues { [JsonPropertyName("oldValue")] [JsonProperty("oldValue")] - public DateTime OldValue { get; set; } + public DateTime OldValue { get; init; } [JsonPropertyName("newValue")] [JsonProperty("newValue")] - public DateTime NewValue { get; set; } + public DateTime NewValue { get; init; } } } \ No newline at end of file diff --git a/src/DTOs/WorkItemDTO.cs b/src/DTOs/WorkItemDTO.cs new file mode 100644 index 0000000..46ef511 --- /dev/null +++ b/src/DTOs/WorkItemDTO.cs @@ -0,0 +1,100 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; + +namespace AzureDevopsTracker.DTOs +{ + public record WorkItemDTO + { + [JsonProperty("id")] + public string Id { get; init; } + + [JsonProperty("created_at")] + public DateTime CreatedAt { get; init; } + + [JsonProperty("assigned_to")] + public string AssignedTo { get; init; } + + [JsonProperty("type")] + public string Type { get; init; } + + [JsonProperty("effort")] + public string Effort { get; init; } + + [JsonProperty("story_points")] + public string StoryPoints { get; init; } + + [JsonProperty("original_estimate")] + public string OriginalEstimate { get; init; } + + [JsonProperty("created_by")] + public string CreatedBy { get; init; } + + [JsonProperty("title")] + public string Title { get; init; } + + [JsonProperty("team_project")] + public string TeamProject { get; init; } + + [JsonProperty("iteration_path")] + public string IterationPath { get; init; } + + [JsonProperty("area_path")] + public string AreaPath { get; init; } + + [JsonProperty("current_status")] + public string CurrentStatus { get; init; } + + [JsonProperty("work_item_parent_id")] + public string WorkItemParentId { get; init; } + + [JsonProperty("activity")] + public string Activity { get; init; } + + [JsonProperty("tags")] + public IEnumerable Tags { get; init; } + + [JsonProperty("workItems_changes")] + public List WorkItemsChangesDTO { get; init; } + + [JsonProperty("times_by_state")] + public List TimesByStateDTO { get; init; } + } + + public record WorkItemChangeDTO + { + [JsonProperty("new_date")] + public DateTime NewDate { get; init; } + + [JsonProperty("new_state")] + public string NewState { get; init; } + + [JsonProperty("old_state")] + public string OldState { get; init; } + + [JsonProperty("old_date")] + public DateTime? OldDate { get; init; } + + [JsonProperty("changed_by")] + public string ChangedBy { get; init; } + } + + + public record TimeByStateDTO + { + [JsonProperty("created_at")] + public DateTime CreatedAt { get; init; } + + [JsonProperty("updated_at")] + public DateTime UpdatedAt { get; init; } + + [JsonProperty("state")] + public string State { get; init; } + + [JsonProperty("total_time")] + public string TotalTime { get; init; } + + [JsonProperty("total_worked_time")] + public string TotalWorkedTime { get; init; } + } +} diff --git a/AzureDevopsTracker/Data/ChangeLogItemRepository.cs b/src/Data/ChangeLogItemRepository.cs similarity index 100% rename from AzureDevopsTracker/Data/ChangeLogItemRepository.cs rename to src/Data/ChangeLogItemRepository.cs diff --git a/AzureDevopsTracker/Data/ChangeLogRepository.cs b/src/Data/ChangeLogRepository.cs similarity index 93% rename from AzureDevopsTracker/Data/ChangeLogRepository.cs rename to src/Data/ChangeLogRepository.cs index 7067039..503cbff 100644 --- a/AzureDevopsTracker/Data/ChangeLogRepository.cs +++ b/src/Data/ChangeLogRepository.cs @@ -2,7 +2,6 @@ using AzureDevopsTracker.Entities; using AzureDevopsTracker.Interfaces.Internals; using System; -using System.Collections.Generic; using System.Linq; namespace AzureDevopsTracker.Data diff --git a/AzureDevopsTracker/Data/Context/AzureDevopsTrackerContext.cs b/src/Data/Context/AzureDevopsTrackerContext.cs similarity index 100% rename from AzureDevopsTracker/Data/Context/AzureDevopsTrackerContext.cs rename to src/Data/Context/AzureDevopsTrackerContext.cs diff --git a/AzureDevopsTracker/Data/DataBaseConfig.cs b/src/Data/DataBaseConfig.cs similarity index 100% rename from AzureDevopsTracker/Data/DataBaseConfig.cs rename to src/Data/DataBaseConfig.cs diff --git a/AzureDevopsTracker/Data/Mapping/ChangeLogItemMapping.cs b/src/Data/Mapping/ChangeLogItemMapping.cs similarity index 100% rename from AzureDevopsTracker/Data/Mapping/ChangeLogItemMapping.cs rename to src/Data/Mapping/ChangeLogItemMapping.cs diff --git a/AzureDevopsTracker/Data/Mapping/ChangeLogMapping.cs b/src/Data/Mapping/ChangeLogMapping.cs similarity index 100% rename from AzureDevopsTracker/Data/Mapping/ChangeLogMapping.cs rename to src/Data/Mapping/ChangeLogMapping.cs diff --git a/AzureDevopsTracker/Data/Mapping/CustomFieldMapping.cs b/src/Data/Mapping/CustomFieldMapping.cs similarity index 100% rename from AzureDevopsTracker/Data/Mapping/CustomFieldMapping.cs rename to src/Data/Mapping/CustomFieldMapping.cs diff --git a/AzureDevopsTracker/Data/Repository.cs b/src/Data/Repository.cs similarity index 100% rename from AzureDevopsTracker/Data/Repository.cs rename to src/Data/Repository.cs diff --git a/AzureDevopsTracker/Data/WorkItemRepository.cs b/src/Data/WorkItemRepository.cs similarity index 100% rename from AzureDevopsTracker/Data/WorkItemRepository.cs rename to src/Data/WorkItemRepository.cs diff --git a/AzureDevopsTracker/Entities/ChangeLog.cs b/src/Entities/ChangeLog.cs similarity index 73% rename from AzureDevopsTracker/Entities/ChangeLog.cs rename to src/Entities/ChangeLog.cs index f8c2109..33cf708 100644 --- a/AzureDevopsTracker/Entities/ChangeLog.cs +++ b/src/Entities/ChangeLog.cs @@ -9,31 +9,23 @@ public class ChangeLog : Entity public string Response { get; private set; } public string Number { get; private set; } public int Revision { get; private set; } - - private readonly List _changeLogItems = new List(); + private readonly List _changeLogItems = new(); public IReadOnlyCollection ChangeLogItems => _changeLogItems; - private ChangeLog() { } + private ChangeLog() { } public ChangeLog(int newRevision) { Revision = newRevision; - Number = $"{ CreatedAt:yyyyMMdd}.{ Revision }"; + Number = $"{CreatedAt:yyyyMMdd}.{Revision}"; } - public ChangeLog(string number) - { - Number = number; - } + public ChangeLog(string number) => Number = number; - public void SetResponse(string response) - { - Response = response; - } + public void SetResponse(string response) => Response = response; - public void ClearResponse() - { - Response = string.Empty; - } + public void ClearResponse() => Response = string.Empty; + + private bool CheckChangeLogItem(ChangeLogItem changeLogItem) => _changeLogItems.Any(x => x.WorkItemId == changeLogItem.WorkItemId); public void AddChangeLogItem(ChangeLogItem changeLogItem) { @@ -57,10 +49,5 @@ public void AddChangeLogItems(IEnumerable changeLogItems) AddChangeLogItem(changeLogItem); } } - - private bool CheckChangeLogItem(ChangeLogItem changeLogItem) - { - return _changeLogItems.Any(x => x.WorkItemId == changeLogItem.WorkItemId); - } } } \ No newline at end of file diff --git a/AzureDevopsTracker/Entities/ChangeLogItem.cs b/src/Entities/ChangeLogItem.cs similarity index 76% rename from AzureDevopsTracker/Entities/ChangeLogItem.cs rename to src/Entities/ChangeLogItem.cs index 64ac837..b572ffd 100644 --- a/AzureDevopsTracker/Entities/ChangeLogItem.cs +++ b/src/Entities/ChangeLogItem.cs @@ -11,12 +11,13 @@ public class ChangeLogItem : Entity public string WorkItemType { get; private set; } public string ChangeLogId { get; private set; } public bool WasReleased => string.IsNullOrEmpty(ChangeLogId?.Trim()); - - /*EF*/ public ChangeLog ChangeLog { get; private set; } - private ChangeLogItem() { } - public ChangeLogItem(string workItemId, string title, string description, string workItemType) + private ChangeLogItem() { } + public ChangeLogItem(string workItemId, + string title, + string description, + string workItemType) { WorkItemId = workItemId; Title = title; @@ -26,18 +27,17 @@ public ChangeLogItem(string workItemId, string title, string description, string Validate(); } - public void Update(string title, string workItemType, string description) + public void Release(string changeLogId) => ChangeLogId = changeLogId; + + public void Update(string title, + string workItemType, + string description) { Title = title; WorkItemType = workItemType; Description = description; } - public void Release(string changeLogId) - { - ChangeLogId = changeLogId; - } - public void Validate() { if (WorkItemId.IsNullOrEmpty() || Convert.ToInt64(WorkItemId) <= 0) diff --git a/AzureDevopsTracker/Entities/Entity.cs b/src/Entities/Entity.cs similarity index 99% rename from AzureDevopsTracker/Entities/Entity.cs rename to src/Entities/Entity.cs index 46f0a70..1239024 100644 --- a/AzureDevopsTracker/Entities/Entity.cs +++ b/src/Entities/Entity.cs @@ -6,6 +6,7 @@ public abstract class Entity { public string Id { get; protected set; } public DateTime CreatedAt { get; private set; } + public Entity(string id) { Id = id ?? Guid.NewGuid().ToString(); diff --git a/AzureDevopsTracker/Entities/TimeByState.cs b/src/Entities/TimeByState.cs similarity index 83% rename from AzureDevopsTracker/Entities/TimeByState.cs rename to src/Entities/TimeByState.cs index febfbe5..fad334a 100644 --- a/AzureDevopsTracker/Entities/TimeByState.cs +++ b/src/Entities/TimeByState.cs @@ -9,12 +9,13 @@ public class TimeByState : Entity public string State { get; private set; } public double TotalTime { get; private set; } public double TotalWorkedTime { get; private set; } - public WorkItem WorkItem { get; private set; } private TimeByState() { } - - public TimeByState(string workItemId, string state, TimeSpan totalTime, TimeSpan totalWorkedTime) + public TimeByState(string workItemId, + string state, + TimeSpan totalTime, + TimeSpan totalWorkedTime) { WorkItemId = workItemId; State = state; diff --git a/AzureDevopsTracker/Entities/WorkItem.cs b/src/Entities/WorkItem.cs similarity index 94% rename from AzureDevopsTracker/Entities/WorkItem.cs rename to src/Entities/WorkItem.cs index cacdda3..03db258 100644 --- a/AzureDevopsTracker/Entities/WorkItem.cs +++ b/src/Entities/WorkItem.cs @@ -21,7 +21,6 @@ public class WorkItem : Entity public string WorkItemParentId { get; private set; } public string Activity { get; private set; } public bool Deleted { get; private set; } - public ChangeLogItem ChangeLogItem { get; private set; } private readonly List _workItemsChanges = new(); @@ -36,7 +35,6 @@ public class WorkItem : Entity public string LastStatus => _workItemsChanges?.OrderBy(x => x.CreatedAt)?.ToList()?.Skip(1)?.LastOrDefault()?.OldState; private WorkItem() { } - public WorkItem(string workItemId) : base(workItemId) { Validate(); @@ -68,15 +66,10 @@ public void Update(string title, Activity = activity; } - public void Restore() - { - Deleted = false; - } - - public void Delete() - { - Deleted = true; - } + public void Restore() => Deleted = false; + public void Delete() => Deleted = true; + public void ClearTimesByState() => _timeByState.Clear(); + public void RemoveChangeLogItem() => ChangeLogItem = null; public void Validate() { @@ -135,16 +128,6 @@ public void UpdateCustomFields(IEnumerable newCustomFields) AddCustomFields(newCustomFields); } - public void ClearTimesByState() - { - _timeByState.Clear(); - } - - public void RemoveChangeLogItem() - { - ChangeLogItem = null; - } - public void VinculateChangeLogItem(ChangeLogItem changeLogItem) { if (changeLogItem is null) diff --git a/AzureDevopsTracker/Entities/WorkItemChange.cs b/src/Entities/WorkItemChange.cs similarity index 91% rename from AzureDevopsTracker/Entities/WorkItemChange.cs rename to src/Entities/WorkItemChange.cs index 29a276e..a1f39fa 100644 --- a/AzureDevopsTracker/Entities/WorkItemChange.cs +++ b/src/Entities/WorkItemChange.cs @@ -13,12 +13,16 @@ public class WorkItemChange : Entity public string ChangedBy { get; private set; } public string IterationPath { get; private set; } public double TotalWorkedTime { get; private set; } - public WorkItem WorkItem { get; private set; } private WorkItemChange() { } - - public WorkItemChange(string workItemId, string changedBy, string iterationPath, DateTime newDate, string newState, string oldState, DateTime? oldDate) + public WorkItemChange(string workItemId, + string changedBy, + string iterationPath, + DateTime newDate, + string newState, + string oldState, + DateTime? oldDate) { WorkItemId = workItemId; NewDate = newDate; @@ -38,10 +42,7 @@ public void Validate() throw new Exception("WorkItemId is required"); } - public TimeSpan CalculateTotalTime() - { - return OldDate is null ? TimeSpan.Zero : NewDate.ToDateTimeFromTimeZoneInfo() - OldDate.Value.ToDateTimeFromTimeZoneInfo(); - } + public TimeSpan CalculateTotalTime() => OldDate is null ? TimeSpan.Zero : NewDate.ToDateTimeFromTimeZoneInfo() - OldDate.Value.ToDateTimeFromTimeZoneInfo(); public double CalculateTotalWorkedTime() { @@ -137,6 +138,7 @@ public double CalculateTotalWorkedTime() return secondsWorked; } + #region Private Methods private TimeSpan SubtractDates(DateTime biger, DateTime minor) { if (biger.Hour == minor.Hour) @@ -163,5 +165,6 @@ private TimeSpan SubtractDates(DateTime biger, DateTime minor) return biger.Subtract(minor); } } + #endregion } } \ No newline at end of file diff --git a/AzureDevopsTracker/Entities/WorkItemCustomField.cs b/src/Entities/WorkItemCustomField.cs similarity index 69% rename from AzureDevopsTracker/Entities/WorkItemCustomField.cs rename to src/Entities/WorkItemCustomField.cs index 919a695..2f9b36c 100644 --- a/AzureDevopsTracker/Entities/WorkItemCustomField.cs +++ b/src/Entities/WorkItemCustomField.cs @@ -1,5 +1,4 @@ using AzureDevopsTracker.Extensions; -using System; namespace AzureDevopsTracker.Entities { @@ -8,19 +7,17 @@ public class WorkItemCustomField public string WorkItemId { get; private set; } public string Key { get; private set; } public string Value { get; private set; } - public WorkItem WorkItem { get; private set; } - public WorkItemCustomField(string workItemId, string key, string value) + public WorkItemCustomField(string workItemId, + string key, + string value) { WorkItemId = workItemId; Key = key.Truncate(1000); Value = value.Truncate(); } - public void Update(string value) - { - Value = value; - } + public void Update(string value) => Value = value; } } \ No newline at end of file diff --git a/AzureDevopsTracker/Extensions/HelperExtenions.cs b/src/Extensions/HelperExtenions.cs similarity index 100% rename from AzureDevopsTracker/Extensions/HelperExtenions.cs rename to src/Extensions/HelperExtenions.cs diff --git a/src/Helpers/MarkdownHelper.cs b/src/Helpers/MarkdownHelper.cs new file mode 100644 index 0000000..cc6c352 --- /dev/null +++ b/src/Helpers/MarkdownHelper.cs @@ -0,0 +1,4 @@ +namespace AzureDevopsTracker.Helpers +{ + internal static class MarkdownHelper { } +} diff --git a/src/Helpers/MicrosoftTeamsHelper.cs b/src/Helpers/MicrosoftTeamsHelper.cs new file mode 100644 index 0000000..d98c620 --- /dev/null +++ b/src/Helpers/MicrosoftTeamsHelper.cs @@ -0,0 +1,4 @@ +namespace AzureDevopsTracker.Helpers +{ + internal static class MicrosoftTeamsHelper { } +} diff --git a/AzureDevopsTracker/Helpers/RawTextHelper.cs b/src/Helpers/RawTextHelper.cs similarity index 100% rename from AzureDevopsTracker/Helpers/RawTextHelper.cs rename to src/Helpers/RawTextHelper.cs diff --git a/AzureDevopsTracker/Helpers/ReadJsonHelper.cs b/src/Helpers/ReadJsonHelper.cs similarity index 100% rename from AzureDevopsTracker/Helpers/ReadJsonHelper.cs rename to src/Helpers/ReadJsonHelper.cs diff --git a/AzureDevopsTracker/Integrations/DiscordIntegration.cs b/src/Integrations/DiscordIntegration.cs similarity index 100% rename from AzureDevopsTracker/Integrations/DiscordIntegration.cs rename to src/Integrations/DiscordIntegration.cs diff --git a/AzureDevopsTracker/Integrations/FakeIntegration.cs b/src/Integrations/FakeIntegration.cs similarity index 64% rename from AzureDevopsTracker/Integrations/FakeIntegration.cs rename to src/Integrations/FakeIntegration.cs index 420fb38..f32fc57 100644 --- a/AzureDevopsTracker/Integrations/FakeIntegration.cs +++ b/src/Integrations/FakeIntegration.cs @@ -4,9 +4,6 @@ namespace AzureDevopsTracker.Integrations { internal class FakeIntegration : MessageIntegration { - internal override void Send(ChangeLog changeLog) - { - - } + internal override void Send(ChangeLog changeLog) { } } } diff --git a/src/Integrations/MessageBaseIntegration.cs b/src/Integrations/MessageBaseIntegration.cs new file mode 100644 index 0000000..ba71b58 --- /dev/null +++ b/src/Integrations/MessageBaseIntegration.cs @@ -0,0 +1,4 @@ +namespace AzureDevopsTracker.Integrations +{ + internal abstract class MessageBaseIntegration { } +} diff --git a/AzureDevopsTracker/Integrations/MessageConfig.cs b/src/Integrations/MessageConfig.cs similarity index 77% rename from AzureDevopsTracker/Integrations/MessageConfig.cs rename to src/Integrations/MessageConfig.cs index e484b9c..3a426ce 100644 --- a/AzureDevopsTracker/Integrations/MessageConfig.cs +++ b/src/Integrations/MessageConfig.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace AzureDevopsTracker.Integrations +namespace AzureDevopsTracker.Integrations { public class MessageConfig { diff --git a/AzureDevopsTracker/Integrations/MessageFacade.cs b/src/Integrations/MessageFacade.cs similarity index 100% rename from AzureDevopsTracker/Integrations/MessageFacade.cs rename to src/Integrations/MessageFacade.cs diff --git a/AzureDevopsTracker/Integrations/MessageIntegration.cs b/src/Integrations/MessageIntegration.cs similarity index 98% rename from AzureDevopsTracker/Integrations/MessageIntegration.cs rename to src/Integrations/MessageIntegration.cs index 56a954f..9bb9fa0 100644 --- a/AzureDevopsTracker/Integrations/MessageIntegration.cs +++ b/src/Integrations/MessageIntegration.cs @@ -42,7 +42,7 @@ protected internal string GetFileVersion() protected internal string GetNugetVersion() { - return $"Powered by **Typing Hard** • nuget version { GetFileVersion() }"; + return $"Powered by **Typing Hard** • nuget version {GetFileVersion()}"; } protected internal HttpResponseMessage Notify(object body) diff --git a/AzureDevopsTracker/Integrations/MicrosoftTeamsIntegration.cs b/src/Integrations/MicrosoftTeamsIntegration.cs similarity index 94% rename from AzureDevopsTracker/Integrations/MicrosoftTeamsIntegration.cs rename to src/Integrations/MicrosoftTeamsIntegration.cs index ff9fd42..1933002 100644 --- a/AzureDevopsTracker/Integrations/MicrosoftTeamsIntegration.cs +++ b/src/Integrations/MicrosoftTeamsIntegration.cs @@ -79,7 +79,7 @@ private string GetWorkItemsDescriptionSection(string sectionName, IEnumerable**{ workItem.WorkItemId }** - { description }
"; + return $"**{workItem.WorkItemId}** - {description}
"; } private string GetDescription(string description) @@ -100,7 +100,7 @@ private string GetDescription(string description) private string GetFooter() { - return $"
{ GetNugetVersion() }"; + return $"
{GetNugetVersion()}"; } } } diff --git a/AzureDevopsTracker/Interfaces/IAzureDevopsTrackerService.cs b/src/Interfaces/IAzureDevopsTrackerService.cs similarity index 100% rename from AzureDevopsTracker/Interfaces/IAzureDevopsTrackerService.cs rename to src/Interfaces/IAzureDevopsTrackerService.cs diff --git a/AzureDevopsTracker/Interfaces/IChangeLogService.cs b/src/Interfaces/IChangeLogService.cs similarity index 89% rename from AzureDevopsTracker/Interfaces/IChangeLogService.cs rename to src/Interfaces/IChangeLogService.cs index 6f21bf4..3c97c16 100644 --- a/AzureDevopsTracker/Interfaces/IChangeLogService.cs +++ b/src/Interfaces/IChangeLogService.cs @@ -1,5 +1,4 @@ using AzureDevopsTracker.Entities; -using System.Threading.Tasks; namespace AzureDevopsTracker.Interfaces { diff --git a/AzureDevopsTracker/Interfaces/IWorkItemAdapter.cs b/src/Interfaces/IWorkItemAdapter.cs similarity index 100% rename from AzureDevopsTracker/Interfaces/IWorkItemAdapter.cs rename to src/Interfaces/IWorkItemAdapter.cs diff --git a/AzureDevopsTracker/Interfaces/Internals/IChangeLogItemRepository.cs b/src/Interfaces/Internals/IChangeLogItemRepository.cs similarity index 100% rename from AzureDevopsTracker/Interfaces/Internals/IChangeLogItemRepository.cs rename to src/Interfaces/Internals/IChangeLogItemRepository.cs diff --git a/AzureDevopsTracker/Interfaces/Internals/IChangeLogRepository.cs b/src/Interfaces/Internals/IChangeLogRepository.cs similarity index 86% rename from AzureDevopsTracker/Interfaces/Internals/IChangeLogRepository.cs rename to src/Interfaces/Internals/IChangeLogRepository.cs index d1d5e87..07a8e15 100644 --- a/AzureDevopsTracker/Interfaces/Internals/IChangeLogRepository.cs +++ b/src/Interfaces/Internals/IChangeLogRepository.cs @@ -1,5 +1,4 @@ using AzureDevopsTracker.Entities; -using System.Collections.Generic; namespace AzureDevopsTracker.Interfaces.Internals { diff --git a/AzureDevopsTracker/Interfaces/Internals/IRepository.cs b/src/Interfaces/Internals/IRepository.cs similarity index 100% rename from AzureDevopsTracker/Interfaces/Internals/IRepository.cs rename to src/Interfaces/Internals/IRepository.cs diff --git a/AzureDevopsTracker/Interfaces/Internals/IWorkItemRepository.cs b/src/Interfaces/Internals/IWorkItemRepository.cs similarity index 100% rename from AzureDevopsTracker/Interfaces/Internals/IWorkItemRepository.cs rename to src/Interfaces/Internals/IWorkItemRepository.cs diff --git a/AzureDevopsTracker/Migrations/20210719163846_AzureDevopsStateTrackerInitial.Designer.cs b/src/Migrations/20210719163846_AzureDevopsStateTrackerInitial.Designer.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20210719163846_AzureDevopsStateTrackerInitial.Designer.cs rename to src/Migrations/20210719163846_AzureDevopsStateTrackerInitial.Designer.cs diff --git a/AzureDevopsTracker/Migrations/20210719163846_AzureDevopsStateTrackerInitial.cs b/src/Migrations/20210719163846_AzureDevopsStateTrackerInitial.cs similarity index 99% rename from AzureDevopsTracker/Migrations/20210719163846_AzureDevopsStateTrackerInitial.cs rename to src/Migrations/20210719163846_AzureDevopsStateTrackerInitial.cs index 60017e3..704ad44 100644 --- a/AzureDevopsTracker/Migrations/20210719163846_AzureDevopsStateTrackerInitial.cs +++ b/src/Migrations/20210719163846_AzureDevopsStateTrackerInitial.cs @@ -1,6 +1,6 @@ -using System; -using AzureDevopsTracker.Data; +using AzureDevopsTracker.Data; using Microsoft.EntityFrameworkCore.Migrations; +using System; namespace AzureDevopsTracker.Migrations { diff --git a/AzureDevopsTracker/Migrations/20210720105645_FunctionToTimeInitial.Designer.cs b/src/Migrations/20210720105645_FunctionToTimeInitial.Designer.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20210720105645_FunctionToTimeInitial.Designer.cs rename to src/Migrations/20210720105645_FunctionToTimeInitial.Designer.cs diff --git a/AzureDevopsTracker/Migrations/20210720105645_FunctionToTimeInitial.cs b/src/Migrations/20210720105645_FunctionToTimeInitial.cs similarity index 95% rename from AzureDevopsTracker/Migrations/20210720105645_FunctionToTimeInitial.cs rename to src/Migrations/20210720105645_FunctionToTimeInitial.cs index 51dce04..c2c0375 100644 --- a/AzureDevopsTracker/Migrations/20210720105645_FunctionToTimeInitial.cs +++ b/src/Migrations/20210720105645_FunctionToTimeInitial.cs @@ -1,5 +1,4 @@ -using AzureDevopsTracker.Data; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace AzureDevopsTracker.Migrations { diff --git a/AzureDevopsTracker/Migrations/20210831213210_UpdatingColumns.Designer.cs b/src/Migrations/20210831213210_UpdatingColumns.Designer.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20210831213210_UpdatingColumns.Designer.cs rename to src/Migrations/20210831213210_UpdatingColumns.Designer.cs diff --git a/AzureDevopsTracker/Migrations/20210831213210_UpdatingColumns.cs b/src/Migrations/20210831213210_UpdatingColumns.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20210831213210_UpdatingColumns.cs rename to src/Migrations/20210831213210_UpdatingColumns.cs diff --git a/AzureDevopsTracker/Migrations/20210831213948_UpdatingCustomColumn.Designer.cs b/src/Migrations/20210831213948_UpdatingCustomColumn.Designer.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20210831213948_UpdatingCustomColumn.Designer.cs rename to src/Migrations/20210831213948_UpdatingCustomColumn.Designer.cs diff --git a/AzureDevopsTracker/Migrations/20210831213948_UpdatingCustomColumn.cs b/src/Migrations/20210831213948_UpdatingCustomColumn.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20210831213948_UpdatingCustomColumn.cs rename to src/Migrations/20210831213948_UpdatingCustomColumn.cs diff --git a/AzureDevopsTracker/Migrations/20211213213716_Adding_ChangeLog.Designer.cs b/src/Migrations/20211213213716_Adding_ChangeLog.Designer.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20211213213716_Adding_ChangeLog.Designer.cs rename to src/Migrations/20211213213716_Adding_ChangeLog.Designer.cs diff --git a/AzureDevopsTracker/Migrations/20211213213716_Adding_ChangeLog.cs b/src/Migrations/20211213213716_Adding_ChangeLog.cs similarity index 98% rename from AzureDevopsTracker/Migrations/20211213213716_Adding_ChangeLog.cs rename to src/Migrations/20211213213716_Adding_ChangeLog.cs index c099cd9..58dc8bc 100644 --- a/AzureDevopsTracker/Migrations/20211213213716_Adding_ChangeLog.cs +++ b/src/Migrations/20211213213716_Adding_ChangeLog.cs @@ -1,6 +1,6 @@ -using System; -using AzureDevopsTracker.Data; +using AzureDevopsTracker.Data; using Microsoft.EntityFrameworkCore.Migrations; +using System; namespace AzureDevopsTracker.Migrations { diff --git a/AzureDevopsTracker/Migrations/20211220212121_AddField_Number.Designer.cs b/src/Migrations/20211220212121_AddField_Number.Designer.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20211220212121_AddField_Number.Designer.cs rename to src/Migrations/20211220212121_AddField_Number.Designer.cs diff --git a/AzureDevopsTracker/Migrations/20211220212121_AddField_Number.cs b/src/Migrations/20211220212121_AddField_Number.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20211220212121_AddField_Number.cs rename to src/Migrations/20211220212121_AddField_Number.cs diff --git a/AzureDevopsTracker/Migrations/20220607220158_WorkItem_AddDeleted.Designer.cs b/src/Migrations/20220607220158_WorkItem_AddDeleted.Designer.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20220607220158_WorkItem_AddDeleted.Designer.cs rename to src/Migrations/20220607220158_WorkItem_AddDeleted.Designer.cs diff --git a/AzureDevopsTracker/Migrations/20220607220158_WorkItem_AddDeleted.cs b/src/Migrations/20220607220158_WorkItem_AddDeleted.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20220607220158_WorkItem_AddDeleted.cs rename to src/Migrations/20220607220158_WorkItem_AddDeleted.cs diff --git a/AzureDevopsTracker/Migrations/20220621170433_CustomFields.Designer.cs b/src/Migrations/20220621170433_CustomFields.Designer.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20220621170433_CustomFields.Designer.cs rename to src/Migrations/20220621170433_CustomFields.Designer.cs diff --git a/AzureDevopsTracker/Migrations/20220621170433_CustomFields.cs b/src/Migrations/20220621170433_CustomFields.cs similarity index 100% rename from AzureDevopsTracker/Migrations/20220621170433_CustomFields.cs rename to src/Migrations/20220621170433_CustomFields.cs diff --git a/AzureDevopsTracker/Migrations/AzureDevopsStateTrackerContextModelSnapshot.cs b/src/Migrations/AzureDevopsStateTrackerContextModelSnapshot.cs similarity index 100% rename from AzureDevopsTracker/Migrations/AzureDevopsStateTrackerContextModelSnapshot.cs rename to src/Migrations/AzureDevopsStateTrackerContextModelSnapshot.cs diff --git a/AzureDevopsTracker/Services/AzureDevopsTrackerService.cs b/src/Services/AzureDevopsTrackerService.cs similarity index 100% rename from AzureDevopsTracker/Services/AzureDevopsTrackerService.cs rename to src/Services/AzureDevopsTrackerService.cs diff --git a/AzureDevopsTracker/Services/ChangeLogService.cs b/src/Services/ChangeLogService.cs similarity index 95% rename from AzureDevopsTracker/Services/ChangeLogService.cs rename to src/Services/ChangeLogService.cs index dce4a73..baef4fa 100644 --- a/AzureDevopsTracker/Services/ChangeLogService.cs +++ b/src/Services/ChangeLogService.cs @@ -18,7 +18,7 @@ public class ChangeLogService : IChangeLogService public ChangeLogService( IChangeLogItemRepository changeLogItemRepository, IChangeLogRepository changeLogRepository, - IConfiguration configuration, + IConfiguration configuration, MessageIntegration messageIntegration) { _changeLogItemRepository = changeLogItemRepository; @@ -50,7 +50,7 @@ public string SendToMessengers(ChangeLog changeLog) { _messageIntegration.Send(changeLog); - return $"The ChangeLog { changeLog.Number } was released."; + return $"The ChangeLog {changeLog.Number} was released."; } private ChangeLog CreateChangeLog() diff --git a/AzureDevopsTracker/Statics/ConfigurationStatics.cs b/src/Statics/ConfigurationStatics.cs similarity index 57% rename from AzureDevopsTracker/Statics/ConfigurationStatics.cs rename to src/Statics/ConfigurationStatics.cs index a39d50d..92f1a1b 100644 --- a/AzureDevopsTracker/Statics/ConfigurationStatics.cs +++ b/src/Statics/ConfigurationStatics.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace AzureDevopsTracker.Statics +namespace AzureDevopsTracker.Statics { internal class ConfigurationStatics { diff --git a/AzureDevopsTracker/Statics/WorkItemStatics.cs b/src/Statics/WorkItemStatics.cs similarity index 100% rename from AzureDevopsTracker/Statics/WorkItemStatics.cs rename to src/Statics/WorkItemStatics.cs diff --git a/AzureDevopsTracker/adt_icon.png b/src/adt_icon.png similarity index 100% rename from AzureDevopsTracker/adt_icon.png rename to src/adt_icon.png From cc4d39221dc601abed94a47e56133214f03e9964 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Tue, 5 Jul 2022 14:11:30 -0300 Subject: [PATCH 002/189] Add empty template for pull requests --- .github/pull_request_template.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..e69de29 From 2538bb66c1cd61fbc2aa9a5367cd906ac4fe4967 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Tue, 5 Jul 2022 14:15:26 -0300 Subject: [PATCH 003/189] Create codewoners --- .github/codewoners | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .github/codewoners diff --git a/.github/codewoners b/.github/codewoners new file mode 100644 index 0000000..e2e7c08 --- /dev/null +++ b/.github/codewoners @@ -0,0 +1,7 @@ +*.sln @diego-galante @elvissouza +*.csproj @diego-galante @elvissouza +*.cs @diego-galante @elvissouza + +*.* @diego-galante @elvissouza + +.github/ @diego-galante From fdc8c9e082e4c251d0a4ec19374a13d44f34693d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sat, 9 Jul 2022 17:45:26 -0300 Subject: [PATCH 004/189] Add some entity tests --- AzureDevopsTracker.sln | 14 +++ src/Entities/ChangeLog.cs | 7 +- .../AzureDevopsTracker.Tests.csproj | 29 +++++ .../Entities/ChangeLogTests.cs | 105 ++++++++++++++++++ .../Entities/TimeByStateTests.cs | 36 ++++++ .../Entities/WorkItemCustomFieldTests.cs | 31 ++++++ tests/AzureDevopsTracker.Tests/Usings.cs | 3 + 7 files changed, 219 insertions(+), 6 deletions(-) create mode 100644 tests/AzureDevopsTracker.Tests/AzureDevopsTracker.Tests.csproj create mode 100644 tests/AzureDevopsTracker.Tests/Entities/ChangeLogTests.cs create mode 100644 tests/AzureDevopsTracker.Tests/Entities/TimeByStateTests.cs create mode 100644 tests/AzureDevopsTracker.Tests/Entities/WorkItemCustomFieldTests.cs create mode 100644 tests/AzureDevopsTracker.Tests/Usings.cs diff --git a/AzureDevopsTracker.sln b/AzureDevopsTracker.sln index b715220..cf25253 100644 --- a/AzureDevopsTracker.sln +++ b/AzureDevopsTracker.sln @@ -5,6 +5,12 @@ VisualStudioVersion = 17.2.32616.157 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AzureDevopsTracker", "src\AzureDevopsTracker.csproj", "{36601E24-C989-4E11-BD8F-572F2F181ED1}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{816B80C1-D0DA-4925-817C-692A5995BCB2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{035AD571-2D23-4A55-9FBB-1E99758306C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzureDevopsTracker.Tests", "tests\AzureDevopsTracker.Tests\AzureDevopsTracker.Tests.csproj", "{BA1D5DF9-E25A-4984-8072-8CA3C5FC638D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,10 +21,18 @@ Global {36601E24-C989-4E11-BD8F-572F2F181ED1}.Debug|Any CPU.Build.0 = Debug|Any CPU {36601E24-C989-4E11-BD8F-572F2F181ED1}.Release|Any CPU.ActiveCfg = Release|Any CPU {36601E24-C989-4E11-BD8F-572F2F181ED1}.Release|Any CPU.Build.0 = Release|Any CPU + {BA1D5DF9-E25A-4984-8072-8CA3C5FC638D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA1D5DF9-E25A-4984-8072-8CA3C5FC638D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA1D5DF9-E25A-4984-8072-8CA3C5FC638D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA1D5DF9-E25A-4984-8072-8CA3C5FC638D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {36601E24-C989-4E11-BD8F-572F2F181ED1} = {035AD571-2D23-4A55-9FBB-1E99758306C8} + {BA1D5DF9-E25A-4984-8072-8CA3C5FC638D} = {816B80C1-D0DA-4925-817C-692A5995BCB2} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {53133A2B-5357-47B5-A1C4-30953F789623} EndGlobalSection diff --git a/src/Entities/ChangeLog.cs b/src/Entities/ChangeLog.cs index 33cf708..564eb4a 100644 --- a/src/Entities/ChangeLog.cs +++ b/src/Entities/ChangeLog.cs @@ -13,18 +13,15 @@ public class ChangeLog : Entity public IReadOnlyCollection ChangeLogItems => _changeLogItems; private ChangeLog() { } + public ChangeLog(string number) => Number = number; public ChangeLog(int newRevision) { Revision = newRevision; Number = $"{CreatedAt:yyyyMMdd}.{Revision}"; } - public ChangeLog(string number) => Number = number; - public void SetResponse(string response) => Response = response; - public void ClearResponse() => Response = string.Empty; - private bool CheckChangeLogItem(ChangeLogItem changeLogItem) => _changeLogItems.Any(x => x.WorkItemId == changeLogItem.WorkItemId); public void AddChangeLogItem(ChangeLogItem changeLogItem) @@ -45,9 +42,7 @@ public void AddChangeLogItems(IEnumerable changeLogItems) throw new Exception("ChangeLogItems is required"); foreach (var changeLogItem in changeLogItems) - { AddChangeLogItem(changeLogItem); - } } } } \ No newline at end of file diff --git a/tests/AzureDevopsTracker.Tests/AzureDevopsTracker.Tests.csproj b/tests/AzureDevopsTracker.Tests/AzureDevopsTracker.Tests.csproj new file mode 100644 index 0000000..97fe960 --- /dev/null +++ b/tests/AzureDevopsTracker.Tests/AzureDevopsTracker.Tests.csproj @@ -0,0 +1,29 @@ + + + + net6.0 + enable + enable + + false + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/tests/AzureDevopsTracker.Tests/Entities/ChangeLogTests.cs b/tests/AzureDevopsTracker.Tests/Entities/ChangeLogTests.cs new file mode 100644 index 0000000..b8488ae --- /dev/null +++ b/tests/AzureDevopsTracker.Tests/Entities/ChangeLogTests.cs @@ -0,0 +1,105 @@ +namespace AzureDevopsTracker.Tests.Entities +{ + public class ChangeLogTests + { + [Theory(DisplayName = "ChangeLog - New with NewRevision")] + [InlineData(12345)] + [InlineData(65489)] + public void ChangeLog_NewWithRevision(int newRevision) + { + var changeLog = new ChangeLog(newRevision); + + changeLog.Id.Should().NotBeNullOrEmpty(); + changeLog.Revision.Should().Be(newRevision); + changeLog.Number.Should().Be($"{changeLog.CreatedAt:yyyyMMdd}.{newRevision}"); + changeLog.ChangeLogItems.Should().BeEmpty(); + } + + [Theory(DisplayName = "ChangeLog - New with Number")] + [InlineData("12345")] + [InlineData("abcde")] + public void ChangeLog_NewWithNumber(string number) + { + var changeLog = new ChangeLog(number); + + changeLog.Id.Should().NotBeNullOrEmpty(); + changeLog.Number.Should().Be(number); + changeLog.Revision.Should().Be(0); + changeLog.ChangeLogItems.Should().BeEmpty(); + } + + [Fact(DisplayName = "ChangeLog - SetResponse")] + public void ChangeLog_SetResponse() + { + var newResponse = "new response"; + var changeLog = new ChangeLog("abc"); + + changeLog.SetResponse(newResponse); + + changeLog.Response.Should().Be(newResponse); + } + + [Fact(DisplayName = "ChangeLog - ClearResponse")] + public void ChangeLog_ClearResponse() + { + var newResponse = "new response"; + var changeLog = new ChangeLog("abc"); + changeLog.SetResponse(newResponse); + + changeLog.ClearResponse(); + + changeLog.Response.Should().BeEmpty(); + } + + [Theory(DisplayName = "ChangeLog - AddChangeLogItem")] + [InlineData("123", "test", "just a test", "bug", true)] + [InlineData("654", "test", "just a test", "feature", false)] + public void ChangeLog_CheckChangeLogItem(string workItemId, string title, string description, string type, bool exist) + { + var changeLog = new ChangeLog("abc"); + changeLog.AddChangeLogItem(new ChangeLogItem("123", title, description, type)); + + var changeLogItem = new ChangeLogItem(workItemId, title, description, type); + changeLog.AddChangeLogItem(changeLogItem); + + if (exist) + changeLog.ChangeLogItems.Should().NotContain(changeLogItem); + else + changeLog.ChangeLogItems.Should().Contain(changeLogItem); + } + + [Fact(DisplayName = "ChangeLog - AddChangeLogItem should throw exception")] + public void ChangeLog_AddChangeLogItem_ThrowException() + { + var changeLog = new ChangeLog("abc"); + var mensagemEsperada = Assert.Throws(() => changeLog.AddChangeLogItem(null)).Message; + + mensagemEsperada.Should().Be("ChangeLogItem is required"); + } + + [Fact(DisplayName = "ChangeLog - AddChangeLogItems")] + public void ChangeLog_AddChangeLogItems() + { + var changeLog = new ChangeLog("abc"); + var changeLogItems = new List + { + new ChangeLogItem("123", "test", "just a test", "bug"), + new ChangeLogItem("654", "test", "just a test", "feature") + }; + + changeLog.AddChangeLogItems(changeLogItems); + + changeLog.ChangeLogItems.Should().Contain(changeLogItems); + } + + [Fact(DisplayName = "ChangeLog - AddChangeLogItems should throw exception")] + public void ChangeLog_AddChangeLogItems_ThrowException() + { + var changeLog = new ChangeLog("abc"); + + var mensagemEsperada = Assert.Throws(() => changeLog.AddChangeLogItems(null)).Message; + + mensagemEsperada.Should().Be("ChangeLogItems is required"); + } + } +} \ No newline at end of file diff --git a/tests/AzureDevopsTracker.Tests/Entities/TimeByStateTests.cs b/tests/AzureDevopsTracker.Tests/Entities/TimeByStateTests.cs new file mode 100644 index 0000000..6980acd --- /dev/null +++ b/tests/AzureDevopsTracker.Tests/Entities/TimeByStateTests.cs @@ -0,0 +1,36 @@ +namespace AzureDevopsTracker.Tests.Entities +{ + public class TimeByStateTests + { + [Fact(DisplayName = "TimeByState - New")] + public void TimeByState_New() + { + var workItemId = "123"; + var state = "new"; + var totalTime = new TimeSpan(1, 0, 3); + var totalWorkedTime = new TimeSpan(2, 3, 40); + var timeByState = new TimeByState(workItemId, state, totalTime, totalWorkedTime); + + timeByState.Id.Should().NotBeNullOrEmpty(); + timeByState.WorkItemId.Should().Be(workItemId); + timeByState.State.Should().Be(state); + timeByState.TotalTime.Should().Be(totalTime.TotalSeconds); + timeByState.TotalWorkedTime.Should().Be(totalWorkedTime.TotalSeconds); + } + + [Theory(DisplayName = "TimeByState - Validate")] + [InlineData("", "new", "WorkItemId is required")] + [InlineData(null, "", "WorkItemId is required")] + [InlineData("123", "", "State is required")] + [InlineData("123", null, "State is required")] + public void TimeByState_Update(string workItemId, string state, string throwMessage) + { + var totalTime = new TimeSpan(1, 0, 3); + var totalWorkedTime = new TimeSpan(2, 3, 40); + + var mensagemEsperada = Assert.Throws(() => new TimeByState(workItemId, state, totalTime, totalWorkedTime)).Message; + + mensagemEsperada.Should().Be(throwMessage); + } + } +} \ No newline at end of file diff --git a/tests/AzureDevopsTracker.Tests/Entities/WorkItemCustomFieldTests.cs b/tests/AzureDevopsTracker.Tests/Entities/WorkItemCustomFieldTests.cs new file mode 100644 index 0000000..25b2903 --- /dev/null +++ b/tests/AzureDevopsTracker.Tests/Entities/WorkItemCustomFieldTests.cs @@ -0,0 +1,31 @@ +namespace AzureDevopsTracker.Tests.Entities +{ + public class WorkItemCustomFieldTests + { + [Theory(DisplayName = "CustomField - New")] + [InlineData("12345", "key", "value")] + [InlineData("65489", "key1", "value")] + [InlineData("test", "key", "value1")] + public void CustomField_New(string workItemId, string key, string value) + { + var customField = new WorkItemCustomField(workItemId, key, value); + + customField.WorkItemId.Should().Be(workItemId); + customField.Key.Should().Be(key); + customField.Value.Should().Be(value); + } + + [Theory(DisplayName = "CustomField - Update")] + [InlineData("value")] + [InlineData("new_value")] + [InlineData("value1")] + public void CustomField_Update(string value) + { + var customField = new WorkItemCustomField(Guid.NewGuid().ToString(), "key", ""); + + customField.Update(value); + + customField.Value.Should().Be(value); + } + } +} \ No newline at end of file diff --git a/tests/AzureDevopsTracker.Tests/Usings.cs b/tests/AzureDevopsTracker.Tests/Usings.cs new file mode 100644 index 0000000..209548e --- /dev/null +++ b/tests/AzureDevopsTracker.Tests/Usings.cs @@ -0,0 +1,3 @@ +global using Xunit; +global using AzureDevopsTracker.Entities; +global using FluentAssertions; \ No newline at end of file From d6cfe2f3bbe28e6c3468baa26a91bd1b85534b3f Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sat, 9 Jul 2022 18:02:03 -0300 Subject: [PATCH 005/189] Update pull_request_template.md --- .github/pull_request_template.md | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index e69de29..7856522 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -0,0 +1,34 @@ +# Description + +> Please include a summary of the change here and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. + +## Type of change + +Please delete options that are not relevant. + + - [ ] Bug fix (non-breaking change which fixes an issue) + - [ ] New feature (non-breaking change which adds functionality) + - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) + - [ ] This change requires a documentation update + +## Fixes +Please delete options that are not relevant. + +\# (issue) + +## How Has This Been Tested + +Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration + + - [ ] Unit Tests + - [ ] Integration Tests + - [ ] Web application using this dll + postman + +## Checklist +- [ ] My code follows the style guidelines of this project +- [ ] I have performed a self-review of my own code +- [ ] I checked the PR checks reports +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation +- [ ] My changes generate no new warnings +- [ ] I have added tests that prove my fix is effective or that my feature works From 4e3cc5f173242b0c6638f169efd75ef18a9ebd4d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sat, 9 Jul 2022 18:08:20 -0300 Subject: [PATCH 006/189] Update codewoners --- .github/codewoners | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/codewoners b/.github/codewoners index e2e7c08..e112dbf 100644 --- a/.github/codewoners +++ b/.github/codewoners @@ -1,7 +1,7 @@ -*.sln @diego-galante @elvissouza -*.csproj @diego-galante @elvissouza -*.cs @diego-galante @elvissouza +*.sln @DiegoGalante @ElvisCSouza +*.csproj @DiegoGalante @ElvisCSouza +*.cs @DiegoGalantee @ElvisCSouza -*.* @diego-galante @elvissouza +*.* @DiegoGalante @ElvisCSouza -.github/ @diego-galante +.github/ @DiegoGalante From eb4701fdc55435e76346369118d9a85ebf9d365d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 18:10:46 -0300 Subject: [PATCH 007/189] Set up CI with Azure Pipelines [skip ci] --- adt_pull_request.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 adt_pull_request.yml diff --git a/adt_pull_request.yml b/adt_pull_request.yml new file mode 100644 index 0000000..4b23ab8 --- /dev/null +++ b/adt_pull_request.yml @@ -0,0 +1,36 @@ +# ASP.NET Core +# Build and test ASP.NET Core projects targeting .NET Core. +# Add steps that run tests, create a NuGet package, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core + +#trigger: +#- version-5 + +pool: + vmImage: windows-latest + +variables: + buildConfiguration: 'Release' + prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] + +steps: +- script: dotnet build --configuration $(buildConfiguration) + displayName: 'dotnet build $(buildConfiguration)' + +- task: DotNetCoreCLI@2 + displayName: Rodando os testes da aplicação + inputs: + command: test + projects: '**/*[Tt]ests/*.csproj' + arguments: '--configuration $(BuildConfiguration) --collect "Code Coverage"' + +- task: DotNetCoreCLI@2 + displayName: 'Rodando SonarScanner ' + inputs: + command: custom + custom: tool + arguments: | + 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html + dotnet build –no-incremental + dotnet dotcover test --dcReportType=HTML + dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' \ No newline at end of file From 4ec7c2db4cdad7b65b249a9b6c82d1a2f989c608 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 18:14:35 -0300 Subject: [PATCH 008/189] Initial changes to run sonarqube on sonarcloud --- .gitignore | 6 +++ src/Adapters/WorkItemAdapter.cs | 48 ++++++++++---------- src/DTOs/Create/CreateWorkItemDTO.cs | 4 +- src/DTOs/Delete/DeleteWorkItemDTO.cs | 4 +- src/DTOs/Fields.cs | 2 +- src/DTOs/Resource.cs | 2 +- src/DTOs/Restore/RestoreWorkItemDTO.cs | 4 +- src/DTOs/Update/UpdateWorkItemDTO.cs | 4 +- src/DTOs/WorkItemDTO.cs | 12 ++--- src/Entities/Entity.cs | 4 +- src/Interfaces/IAzureDevopsTrackerService.cs | 20 ++++---- src/Interfaces/IWorkItemAdapter.cs | 6 +-- src/Services/AzureDevopsTrackerService.cs | 30 ++++++------ 13 files changed, 76 insertions(+), 70 deletions(-) diff --git a/.gitignore b/.gitignore index dfcfd56..3cab525 100644 --- a/.gitignore +++ b/.gitignore @@ -348,3 +348,9 @@ MigrationBackup/ # Ionide (cross platform F# VS Code tools) working folder .ionide/ + +.sonarqube + +*.bat + +*.xml \ No newline at end of file diff --git a/src/Adapters/WorkItemAdapter.cs b/src/Adapters/WorkItemAdapter.cs index 8b8492b..a7598ac 100644 --- a/src/Adapters/WorkItemAdapter.cs +++ b/src/Adapters/WorkItemAdapter.cs @@ -1,4 +1,4 @@ -using AzureDevopsTracker.DTOs; +using AzureDevopsTracker.Dtos; using AzureDevopsTracker.Entities; using AzureDevopsTracker.Extensions; using AzureDevopsTracker.Interfaces; @@ -10,11 +10,11 @@ namespace AzureDevopsTracker.Adapters { internal class WorkItemAdapter : IWorkItemAdapter { - public WorkItemDTO ToWorkItemDTO(WorkItem workItem) + public WorkItemDto ToWorkItemDto(WorkItem workItem) { if (workItem is null) return null; - return new WorkItemDTO() + return new WorkItemDto() { Id = workItem.Id, CreatedAt = workItem.CreatedAt, @@ -32,30 +32,30 @@ public WorkItemDTO ToWorkItemDTO(WorkItem workItem) WorkItemParentId = workItem.WorkItemParentId, Activity = workItem.Activity, Tags = workItem.Tags is null ? new List() : workItem.Tags.Split(';').ToList(), - WorkItemsChangesDTO = ToWorkItemsChangeDTO(workItem.WorkItemsChanges.OrderBy(x => x.CreatedAt).ToList()), - TimesByStateDTO = ToTimeByStatesDTO(workItem.CalculateTotalTimeByState().ToList()), + WorkItemsChangesDto = ToWorkItemsChangeDto(workItem.WorkItemsChanges.OrderBy(x => x.CreatedAt).ToList()), + TimesByStateDto = ToTimeByStatesDto(workItem.CalculateTotalTimeByState().ToList()), }; } - public List ToWorkItemsDTO(List workItems) + public List ToWorkItemsDto(List workItems) { - var workItemsDTO = new List(); + var workItemsDto = new List(); - if (workItems is null) return workItemsDTO; + if (workItems is null) return workItemsDto; workItems.ForEach( workItem => - workItemsDTO.Add(ToWorkItemDTO(workItem))); + workItemsDto.Add(ToWorkItemDto(workItem))); - return workItemsDTO + return workItemsDto .ToList(); } - public WorkItemChangeDTO ToWorkItemChangeDTO(WorkItemChange workIteChange) + public WorkItemChangeDto ToWorkItemChangeDto(WorkItemChange workIteChange) { if (workIteChange is null) return null; - return new WorkItemChangeDTO() + return new WorkItemChangeDto() { NewDate = workIteChange.NewDate, NewState = workIteChange.NewState, @@ -65,26 +65,26 @@ public WorkItemChangeDTO ToWorkItemChangeDTO(WorkItemChange workIteChange) }; } - public List ToWorkItemsChangeDTO(List workItemsChanges) + public List ToWorkItemsChangeDto(List workItemsChanges) { - var workItemsChangeDTO = new List(); + var workItemsChangeDto = new List(); - if (workItemsChanges is null) return workItemsChangeDTO; + if (workItemsChanges is null) return workItemsChangeDto; workItemsChanges.ForEach( workItemsChange => - workItemsChangeDTO.Add(ToWorkItemChangeDTO(workItemsChange))); + workItemsChangeDto.Add(ToWorkItemChangeDto(workItemsChange))); - return workItemsChangeDTO + return workItemsChangeDto .Where(w => w is not null) .ToList(); } - public TimeByStateDTO ToTimeByStateDTO(TimeByState workItemStatusTime) + public TimeByStateDto ToTimeByStateDto(TimeByState workItemStatusTime) { if (workItemStatusTime is null) return null; - return new TimeByStateDTO() + return new TimeByStateDto() { CreatedAt = workItemStatusTime.CreatedAt, State = workItemStatusTime.State, @@ -93,17 +93,17 @@ public TimeByStateDTO ToTimeByStateDTO(TimeByState workItemStatusTime) }; } - public List ToTimeByStatesDTO(List workItemStatusTimes) + public List ToTimeByStatesDto(List workItemStatusTimes) { - var workItemStatusTimeDTO = new List(); + var workItemStatusTimeDto = new List(); - if (workItemStatusTimes is null) return workItemStatusTimeDTO; + if (workItemStatusTimes is null) return workItemStatusTimeDto; workItemStatusTimes.ForEach( workItemStatusTime => - workItemStatusTimeDTO.Add(ToTimeByStateDTO(workItemStatusTime))); + workItemStatusTimeDto.Add(ToTimeByStateDto(workItemStatusTime))); - return workItemStatusTimeDTO + return workItemStatusTimeDto .Where(w => w is not null) .ToList(); } diff --git a/src/DTOs/Create/CreateWorkItemDTO.cs b/src/DTOs/Create/CreateWorkItemDTO.cs index 26e6126..12897a6 100644 --- a/src/DTOs/Create/CreateWorkItemDTO.cs +++ b/src/DTOs/Create/CreateWorkItemDTO.cs @@ -1,9 +1,9 @@ using Newtonsoft.Json; using System.Text.Json.Serialization; -namespace AzureDevopsTracker.DTOs.Create +namespace AzureDevopsTracker.Dtos.Create { - public record CreateWorkItemDTO + public record CreateWorkItemDto { [JsonPropertyName("resource")] [JsonProperty("resource")] diff --git a/src/DTOs/Delete/DeleteWorkItemDTO.cs b/src/DTOs/Delete/DeleteWorkItemDTO.cs index 53d8d27..ecea0c3 100644 --- a/src/DTOs/Delete/DeleteWorkItemDTO.cs +++ b/src/DTOs/Delete/DeleteWorkItemDTO.cs @@ -1,9 +1,9 @@ using Newtonsoft.Json; using System.Text.Json.Serialization; -namespace AzureDevopsTracker.DTOs.Delete +namespace AzureDevopsTracker.Dtos.Delete { - public record DeleteWorkItemDTO + public record DeleteWorkItemDto { [JsonPropertyName("resource")] [JsonProperty("resource")] diff --git a/src/DTOs/Fields.cs b/src/DTOs/Fields.cs index 5b37626..f1a0a2f 100644 --- a/src/DTOs/Fields.cs +++ b/src/DTOs/Fields.cs @@ -2,7 +2,7 @@ using System; using System.Text.Json.Serialization; -namespace AzureDevopsTracker.DTOs +namespace AzureDevopsTracker.Dtos { public record Fields { diff --git a/src/DTOs/Resource.cs b/src/DTOs/Resource.cs index 45cf0a3..2a4624b 100644 --- a/src/DTOs/Resource.cs +++ b/src/DTOs/Resource.cs @@ -1,7 +1,7 @@ using Newtonsoft.Json; using System.Text.Json.Serialization; -namespace AzureDevopsTracker.DTOs +namespace AzureDevopsTracker.Dtos { public record Resource { diff --git a/src/DTOs/Restore/RestoreWorkItemDTO.cs b/src/DTOs/Restore/RestoreWorkItemDTO.cs index 0aead27..82c1695 100644 --- a/src/DTOs/Restore/RestoreWorkItemDTO.cs +++ b/src/DTOs/Restore/RestoreWorkItemDTO.cs @@ -1,9 +1,9 @@ using Newtonsoft.Json; using System.Text.Json.Serialization; -namespace AzureDevopsTracker.DTOs.Restore +namespace AzureDevopsTracker.Dtos.Restore { - public record RestoreWorkItemDTO + public record RestoreWorkItemDto { [JsonPropertyName("resource")] [JsonProperty("resource")] diff --git a/src/DTOs/Update/UpdateWorkItemDTO.cs b/src/DTOs/Update/UpdateWorkItemDTO.cs index 714131d..3f59018 100644 --- a/src/DTOs/Update/UpdateWorkItemDTO.cs +++ b/src/DTOs/Update/UpdateWorkItemDTO.cs @@ -2,9 +2,9 @@ using System; using System.Text.Json.Serialization; -namespace AzureDevopsTracker.DTOs.Update +namespace AzureDevopsTracker.Dtos.Update { - public record UpdatedWorkItemDTO + public record UpdatedWorkItemDto { [JsonPropertyName("resource")] [JsonProperty("resource")] diff --git a/src/DTOs/WorkItemDTO.cs b/src/DTOs/WorkItemDTO.cs index 46ef511..9553f89 100644 --- a/src/DTOs/WorkItemDTO.cs +++ b/src/DTOs/WorkItemDTO.cs @@ -2,9 +2,9 @@ using System; using System.Collections.Generic; -namespace AzureDevopsTracker.DTOs +namespace AzureDevopsTracker.Dtos { - public record WorkItemDTO + public record WorkItemDto { [JsonProperty("id")] public string Id { get; init; } @@ -55,13 +55,13 @@ public record WorkItemDTO public IEnumerable Tags { get; init; } [JsonProperty("workItems_changes")] - public List WorkItemsChangesDTO { get; init; } + public List WorkItemsChangesDto { get; init; } [JsonProperty("times_by_state")] - public List TimesByStateDTO { get; init; } + public List TimesByStateDto { get; init; } } - public record WorkItemChangeDTO + public record WorkItemChangeDto { [JsonProperty("new_date")] public DateTime NewDate { get; init; } @@ -80,7 +80,7 @@ public record WorkItemChangeDTO } - public record TimeByStateDTO + public record TimeByStateDto { [JsonProperty("created_at")] public DateTime CreatedAt { get; init; } diff --git a/src/Entities/Entity.cs b/src/Entities/Entity.cs index 1239024..88a3328 100644 --- a/src/Entities/Entity.cs +++ b/src/Entities/Entity.cs @@ -7,13 +7,13 @@ public abstract class Entity public string Id { get; protected set; } public DateTime CreatedAt { get; private set; } - public Entity(string id) + protected Entity(string id) { Id = id ?? Guid.NewGuid().ToString(); CreatedAt = DateTime.UtcNow; } - public Entity() + protected Entity() { Id = Guid.NewGuid().ToString(); CreatedAt = DateTime.UtcNow; diff --git a/src/Interfaces/IAzureDevopsTrackerService.cs b/src/Interfaces/IAzureDevopsTrackerService.cs index 83dfe78..4e1b309 100644 --- a/src/Interfaces/IAzureDevopsTrackerService.cs +++ b/src/Interfaces/IAzureDevopsTrackerService.cs @@ -1,18 +1,18 @@ -using AzureDevopsTracker.DTOs; -using AzureDevopsTracker.DTOs.Create; -using AzureDevopsTracker.DTOs.Delete; -using AzureDevopsTracker.DTOs.Restore; -using AzureDevopsTracker.DTOs.Update; +using AzureDevopsTracker.Dtos; +using AzureDevopsTracker.Dtos.Create; +using AzureDevopsTracker.Dtos.Delete; +using AzureDevopsTracker.Dtos.Restore; +using AzureDevopsTracker.Dtos.Update; using System.Threading.Tasks; namespace AzureDevopsTracker.Interfaces { public interface IAzureDevopsTrackerService { - Task Create(CreateWorkItemDTO createDto, bool addWorkItemChange = true); - Task Update(UpdatedWorkItemDTO updateDto); - Task Delete(DeleteWorkItemDTO deleteDto); - Task Restore(RestoreWorkItemDTO restoreDto); - Task GetByWorkItemId(string workItemId); + Task Create(CreateWorkItemDto createDto, bool addWorkItemChange = true); + Task Update(UpdatedWorkItemDto updateDto); + Task Delete(DeleteWorkItemDto deleteDto); + Task Restore(RestoreWorkItemDto restoreDto); + Task GetByWorkItemId(string workItemId); } } \ No newline at end of file diff --git a/src/Interfaces/IWorkItemAdapter.cs b/src/Interfaces/IWorkItemAdapter.cs index 79f33b6..dc545e1 100644 --- a/src/Interfaces/IWorkItemAdapter.cs +++ b/src/Interfaces/IWorkItemAdapter.cs @@ -1,4 +1,4 @@ -using AzureDevopsTracker.DTOs; +using AzureDevopsTracker.Dtos; using AzureDevopsTracker.Entities; using System.Collections.Generic; @@ -6,7 +6,7 @@ namespace AzureDevopsTracker.Interfaces { public interface IWorkItemAdapter { - WorkItemDTO ToWorkItemDTO(WorkItem workItem); - List ToWorkItemsDTO(List workItems); + WorkItemDto ToWorkItemDto(WorkItem workItem); + List ToWorkItemsDto(List workItems); } } \ No newline at end of file diff --git a/src/Services/AzureDevopsTrackerService.cs b/src/Services/AzureDevopsTrackerService.cs index ce67781..06ccd9f 100644 --- a/src/Services/AzureDevopsTrackerService.cs +++ b/src/Services/AzureDevopsTrackerService.cs @@ -1,8 +1,8 @@ -using AzureDevopsTracker.DTOs; -using AzureDevopsTracker.DTOs.Create; -using AzureDevopsTracker.DTOs.Delete; -using AzureDevopsTracker.DTOs.Restore; -using AzureDevopsTracker.DTOs.Update; +using AzureDevopsTracker.Dtos; +using AzureDevopsTracker.Dtos.Create; +using AzureDevopsTracker.Dtos.Delete; +using AzureDevopsTracker.Dtos.Restore; +using AzureDevopsTracker.Dtos.Update; using AzureDevopsTracker.Entities; using AzureDevopsTracker.Extensions; using AzureDevopsTracker.Helpers; @@ -36,7 +36,7 @@ public AzureDevopsTrackerService( _httpContextAccessor = httpContextAccessor; } - public async Task Create(CreateWorkItemDTO create, bool addWorkItemChange = true) + public async Task Create(CreateWorkItemDto create, bool addWorkItemChange = true) { var workItem = new WorkItem(create.Resource.Id); @@ -67,9 +67,9 @@ public async Task Create(CreateWorkItemDTO create, bool addWorkItemChange = true public async Task Create(string workItemId, Fields fields) { - var createDto = new CreateWorkItemDTO() + var createDto = new CreateWorkItemDto() { - Resource = new DTOs.Resource() + Resource = new Dtos.Resource() { Fields = fields, Id = workItemId, @@ -79,7 +79,7 @@ public async Task Create(string workItemId, Fields fields) await Create(createDto, false); } - public async Task Update(UpdatedWorkItemDTO update) + public async Task Update(UpdatedWorkItemDto update) { if (!_workItemRepository.Exist(update.Resource.WorkItemId).Result) await Create(update.Resource.WorkItemId, update.Resource.Revision.Fields); @@ -112,7 +112,7 @@ public async Task Update(UpdatedWorkItemDTO update) await _workItemRepository.SaveChangesAsync(); } - public async Task Delete(DeleteWorkItemDTO delete) + public async Task Delete(DeleteWorkItemDto delete) { if (!_workItemRepository.Exist(delete.Resource.Id).Result) await Create(delete.Resource.Id, delete.Resource.Fields); @@ -143,7 +143,7 @@ public async Task Delete(DeleteWorkItemDTO delete) await _workItemRepository.SaveChangesAsync(); } - public async Task Restore(RestoreWorkItemDTO restore) + public async Task Restore(RestoreWorkItemDto restore) { if (!_workItemRepository.Exist(restore.Resource.Id).Result) await Create(restore.Resource.Id, restore.Resource.Fields); @@ -174,13 +174,13 @@ public async Task Restore(RestoreWorkItemDTO restore) await _workItemRepository.SaveChangesAsync(); } - public async Task GetByWorkItemId(string workItemId) + public async Task GetByWorkItemId(string workItemId) { var workItem = await _workItemRepository.GetByWorkItemId(workItemId); if (workItem is null) return null; - return _workItemAdapter.ToWorkItemDTO(workItem); + return _workItemAdapter.ToWorkItemDto(workItem); } #region Support Methods @@ -226,7 +226,7 @@ public WorkItemChange ToWorkItemChange( return new WorkItemChange(workItemId, changedBy.ExtractEmail(), iterationPath, newDate, newState, oldState, oldDate); } - public void AddWorkItemChange(WorkItem workItem, CreateWorkItemDTO create) + public void AddWorkItemChange(WorkItem workItem, CreateWorkItemDto create) { var workItemChange = ToWorkItemChange(workItem.Id, create.Resource.Fields.ChangedBy, @@ -240,7 +240,7 @@ public void AddWorkItemChange(WorkItem workItem, CreateWorkItemDTO create) workItem.AddWorkItemChange(workItemChange); } - public void AddWorkItemChange(WorkItem workItem, UpdatedWorkItemDTO update) + public void AddWorkItemChange(WorkItem workItem, UpdatedWorkItemDto update) { if (update.Resource.Fields.State is null) return; if (update.Resource.Fields.StateChangeDate is null) return; From cc745b78ace3a74053ffdc953f3689851c451dea Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 18:21:27 -0300 Subject: [PATCH 009/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 4b23ab8..b0dd16c 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -29,8 +29,7 @@ steps: inputs: command: custom custom: tool - arguments: | - 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html - dotnet build –no-incremental - dotnet dotcover test --dcReportType=HTML - dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' \ No newline at end of file + arguments: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html + dotnet build –no-incremental + dotnet dotcover test --dcReportType=HTML + dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' \ No newline at end of file From 8c217a990c9e1316ef6c1ef9134d81f79826d3b1 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 21:38:18 -0300 Subject: [PATCH 010/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index b0dd16c..41e3610 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -17,6 +17,13 @@ steps: - script: dotnet build --configuration $(buildConfiguration) displayName: 'dotnet build $(buildConfiguration)' +- task: UseDotNet@2 + displayName: 'Install .NET Core SDK' + inputs: + version: 5.0.x + performMultiLevelLookup: true + includePreviewVersions: true # Required + - task: DotNetCoreCLI@2 displayName: Rodando os testes da aplicação inputs: From cc8c08fef5970a1d52a486d7affb165d3134d243 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 21:53:35 -0300 Subject: [PATCH 011/189] Update adt_pull_request.yml --- adt_pull_request.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index b0dd16c..4d30d36 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -14,8 +14,19 @@ variables: prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] steps: -- script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' +- task: UseDotNet@2 + displayName: 'Install .NET Core SDK' + inputs: + version: 5.x + performMultiLevelLookup: true + includePreviewVersions: true # Required + +- task: DotNetCoreCLI@2 + displayName: Build + inputs: + command: build + projects: '**/*.csproj' + arguments: '--configuration $(buildConfiguration)' - task: DotNetCoreCLI@2 displayName: Rodando os testes da aplicação @@ -32,4 +43,4 @@ steps: arguments: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html dotnet build –no-incremental dotnet dotcover test --dcReportType=HTML - dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' \ No newline at end of file + dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' From 4a0f6cc91f92c4d780832ac7ee6c2e95a12088bf Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 22:07:26 -0300 Subject: [PATCH 012/189] Update adt_pull_request.yml --- adt_pull_request.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 4d30d36..8fc790a 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -21,6 +21,13 @@ steps: performMultiLevelLookup: true includePreviewVersions: true # Required +- task: DotNetCoreCLI@2 + displayName: 'Install sonarscanner' + inputs: + command: custom + custom: tool + arguments: 'dotnet tool install --global dotnet-sonarscanner' + - task: DotNetCoreCLI@2 displayName: Build inputs: From a71199fa82e4caf95093dca211ffac126c4c1394 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 22:13:59 -0300 Subject: [PATCH 013/189] Update adt_pull_request.yml --- adt_pull_request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 8fc790a..11681ea 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,8 +25,7 @@ steps: displayName: 'Install sonarscanner' inputs: command: custom - custom: tool - arguments: 'dotnet tool install --global dotnet-sonarscanner' + arguments: 'dotnet tool install --global dotnet-sonarscanner --version 5.8.0' - task: DotNetCoreCLI@2 displayName: Build From 148532634d3765ddd1ef9291dc9daa3d67f094b4 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 22:14:21 -0300 Subject: [PATCH 014/189] Create adt_pull_request.yml From 522c5aec8bfd07d428081e2a15814c0a77b9b463 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 22:20:12 -0300 Subject: [PATCH 015/189] Update adt_pull_request.yml --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 11681ea..d72604c 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,7 +25,7 @@ steps: displayName: 'Install sonarscanner' inputs: command: custom - arguments: 'dotnet tool install --global dotnet-sonarscanner --version 5.8.0' + arguments: 'dotnet tool install dotnet-sonarscanner --version 5.8.0' - task: DotNetCoreCLI@2 displayName: Build From 853f27041777e09557995d7c676bb1a38031fb7e Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 22:24:25 -0300 Subject: [PATCH 016/189] Update adt_pull_request.yml --- adt_pull_request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index d72604c..a3679dc 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,7 +25,8 @@ steps: displayName: 'Install sonarscanner' inputs: command: custom - arguments: 'dotnet tool install dotnet-sonarscanner --version 5.8.0' + custom: tool + arguments: 'dotnet tool install --global dotnet-sonarscanner --version 5.8.0' - task: DotNetCoreCLI@2 displayName: Build From 14cfbd6b8a5fcfb11158ed8486d3b49bff8e7e41 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 22:28:53 -0300 Subject: [PATCH 017/189] Update adt_pull_request.yml --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index a3679dc..212bf58 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -26,7 +26,7 @@ steps: inputs: command: custom custom: tool - arguments: 'dotnet tool install --global dotnet-sonarscanner --version 5.8.0' + arguments: 'dotnet tool install dotnet-sonarscanner --version 5.8.0' - task: DotNetCoreCLI@2 displayName: Build From 5725e58d4290adcd0935e5cf7490e1f87202dcc3 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 22:51:52 -0300 Subject: [PATCH 018/189] Update adt_pull_request.yml --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 212bf58..0f7ace4 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -26,7 +26,7 @@ steps: inputs: command: custom custom: tool - arguments: 'dotnet tool install dotnet-sonarscanner --version 5.8.0' + arguments: 'dotnet tool install --global JetBrains.dotCover.GlobalTool' - task: DotNetCoreCLI@2 displayName: Build From a95941dc9dfecd111377047a0a43109ab3902260 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 22:55:52 -0300 Subject: [PATCH 019/189] Update adt_pull_request.yml --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 0f7ace4..2465fdd 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -17,7 +17,7 @@ steps: - task: UseDotNet@2 displayName: 'Install .NET Core SDK' inputs: - version: 5.x + version: 6.x performMultiLevelLookup: true includePreviewVersions: true # Required From a6ff9c67019a92ca21cfd2a55b246e9e5ff13b99 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 23:04:46 -0300 Subject: [PATCH 020/189] Update adt_pull_request.yml --- adt_pull_request.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 2465fdd..fbaf0bd 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -21,11 +21,16 @@ steps: performMultiLevelLookup: true includePreviewVersions: true # Required -- task: DotNetCoreCLI@2 - displayName: 'Install sonarscanner' +-task: NuGetCommand@2 + displayName: 'Instalando sonarscanner' + inputs: + command: custom + arguments: 'dotnet tool install --global dotnet-sonarscanner' + +- task: NuGetCommand@2 + displayName: 'Instalando dotCover' inputs: command: custom - custom: tool arguments: 'dotnet tool install --global JetBrains.dotCover.GlobalTool' - task: DotNetCoreCLI@2 From 5d24a7e8a43e5801d33ede68cef534bd15ff6544 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 23:06:06 -0300 Subject: [PATCH 021/189] Update adt_pull_request.yml --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index fbaf0bd..e7828a3 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -21,7 +21,7 @@ steps: performMultiLevelLookup: true includePreviewVersions: true # Required --task: NuGetCommand@2 +- task: NuGetCommand@2 displayName: 'Instalando sonarscanner' inputs: command: custom From f1c9ccdf24b56bd8a82d3cd7219b1ad9e57b6255 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 23:13:48 -0300 Subject: [PATCH 022/189] Update adt_pull_request.yml --- adt_pull_request.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index e7828a3..c682a94 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -21,6 +21,15 @@ steps: performMultiLevelLookup: true includePreviewVersions: true # Required +- task: DotNetCoreCLI@2 + displayName: 'dotnet restore' + inputs: + command: 'restore' + feedsToUse: 'select' + feedRestore: 'projectName/feedName' + projects: '**/*.csproj' + includeNuGetOrg: true + - task: NuGetCommand@2 displayName: 'Instalando sonarscanner' inputs: From 72ca584eb81142fade0ba3b8c8d35f1fcb4bf87f Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 23:27:55 -0300 Subject: [PATCH 023/189] Update adt_pull_request.yml --- adt_pull_request.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index c682a94..3a86ae3 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -7,7 +7,7 @@ #- version-5 pool: - vmImage: windows-latest + vmImage: 'ubuntu-18.04' variables: buildConfiguration: 'Release' @@ -21,14 +21,13 @@ steps: performMultiLevelLookup: true includePreviewVersions: true # Required +steps: - task: DotNetCoreCLI@2 - displayName: 'dotnet restore' + displayName: Restore inputs: - command: 'restore' - feedsToUse: 'select' - feedRestore: 'projectName/feedName' + command: restore projects: '**/*.csproj' - includeNuGetOrg: true + feedsToUse: config - task: NuGetCommand@2 displayName: 'Instalando sonarscanner' From dd58ddeaf76b95ae7f7ad2bfff592cce0308d310 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 23:29:04 -0300 Subject: [PATCH 024/189] Update adt_pull_request.yml --- adt_pull_request.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 3a86ae3..1669079 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -21,7 +21,6 @@ steps: performMultiLevelLookup: true includePreviewVersions: true # Required -steps: - task: DotNetCoreCLI@2 displayName: Restore inputs: From babddb65fbd7f0fecd78afefabeb48468f57f466 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 23:35:50 -0300 Subject: [PATCH 025/189] Update adt_pull_request.yml --- adt_pull_request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 1669079..9dac519 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,8 +25,7 @@ steps: displayName: Restore inputs: command: restore - projects: '**/*.csproj' - feedsToUse: config + projects: '$(Parameters.RestoreBuildProjects)' - task: NuGetCommand@2 displayName: 'Instalando sonarscanner' From 9643563bf70d6c101efe23fab8c0b9f642d2003d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 23:39:06 -0300 Subject: [PATCH 026/189] Update adt_pull_request.yml --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 9dac519..f06b969 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -7,7 +7,7 @@ #- version-5 pool: - vmImage: 'ubuntu-18.04' + vmImage: 'windows-lastet' variables: buildConfiguration: 'Release' From b5df356e10c4cbd2e67cd3dc56780106aae8014e Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 23:40:59 -0300 Subject: [PATCH 027/189] Update adt_pull_request.yml --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index f06b969..5754609 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -7,7 +7,7 @@ #- version-5 pool: - vmImage: 'windows-lastet' + vmImage: 'windows-2019' variables: buildConfiguration: 'Release' From 3af6e9cc5913cd640e6a2d450f0d13434e48219f Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 23:43:48 -0300 Subject: [PATCH 028/189] Update adt_pull_request.yml --- adt_pull_request.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 5754609..f5c20b7 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -21,12 +21,6 @@ steps: performMultiLevelLookup: true includePreviewVersions: true # Required -- task: DotNetCoreCLI@2 - displayName: Restore - inputs: - command: restore - projects: '$(Parameters.RestoreBuildProjects)' - - task: NuGetCommand@2 displayName: 'Instalando sonarscanner' inputs: From 6832f38ba357f552cc3b8b0409ca8948b02bb769 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 23:48:59 -0300 Subject: [PATCH 029/189] Update adt_pull_request.yml --- adt_pull_request.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index f5c20b7..da76a40 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -21,6 +21,12 @@ steps: performMultiLevelLookup: true includePreviewVersions: true # Required +- task: NuGetCommand@2 + displayName: 'Instalando sonarscanner' + inputs: + command: custom + arguments: 'dotnet tool install --global dotnet-ef' + - task: NuGetCommand@2 displayName: 'Instalando sonarscanner' inputs: From 1f97cfed0ed2c5a7d0f525a47e95fb96d69da2aa Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sun, 28 Aug 2022 23:56:46 -0300 Subject: [PATCH 030/189] Update adt_pull_request.yml --- adt_pull_request.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index da76a40..2134070 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -21,11 +21,19 @@ steps: performMultiLevelLookup: true includePreviewVersions: true # Required -- task: NuGetCommand@2 - displayName: 'Instalando sonarscanner' +- task: DotNetCoreCLI@2 + displayName: Install dotnet-ef inputs: - command: custom - arguments: 'dotnet tool install --global dotnet-ef' + command: 'custom' + custom: 'tool' + arguments: 'install --global dotnet-ef' + +- task: DotNetCoreCLI@2 + displayName: Check dotnet-ef version + inputs: + command: 'custom' + custom: 'ef' + arguments: '--version' - task: NuGetCommand@2 displayName: 'Instalando sonarscanner' From d6df879540e8e63ffd051c8d4e611798db123792 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 00:31:13 -0300 Subject: [PATCH 031/189] Update adt_pull_request.yml --- adt_pull_request.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 2134070..6ee3864 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -38,14 +38,16 @@ steps: - task: NuGetCommand@2 displayName: 'Instalando sonarscanner' inputs: - command: custom - arguments: 'dotnet tool install --global dotnet-sonarscanner' + command: 'custom' + custom: 'tool' + arguments: 'install --global dotnet-sonarscanner' - task: NuGetCommand@2 displayName: 'Instalando dotCover' inputs: command: custom - arguments: 'dotnet tool install --global JetBrains.dotCover.GlobalTool' + custom: 'tool' + arguments: 'install --global JetBrains.dotCover.GlobalTool' - task: DotNetCoreCLI@2 displayName: Build From f1fedd0f574eba7129e203504bf3e6c2c754bd11 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 08:00:19 -0300 Subject: [PATCH 032/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 6ee3864..1da8d26 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -40,14 +40,14 @@ steps: inputs: command: 'custom' custom: 'tool' - arguments: 'install --global dotnet-sonarscanner' + arguments: 'install dotnet-sonarscanner' - task: NuGetCommand@2 displayName: 'Instalando dotCover' inputs: command: custom custom: 'tool' - arguments: 'install --global JetBrains.dotCover.GlobalTool' + arguments: 'install JetBrains.dotCover.GlobalTool' - task: DotNetCoreCLI@2 displayName: Build From c1923cf0d6a559dc0ced0684a4641b224c63f897 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 08:06:33 -0300 Subject: [PATCH 033/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 1da8d26..b827ae6 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -40,7 +40,7 @@ steps: inputs: command: 'custom' custom: 'tool' - arguments: 'install dotnet-sonarscanner' + arguments: 'install --global dotnet-sonarscanner --version 5.8.0' - task: NuGetCommand@2 displayName: 'Instalando dotCover' From 401cd9ab25df83c96a5414cf0bd30db2ce87346f Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 08:29:58 -0300 Subject: [PATCH 034/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 49 +++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index b827ae6..ff17f23 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -21,33 +21,40 @@ steps: performMultiLevelLookup: true includePreviewVersions: true # Required -- task: DotNetCoreCLI@2 - displayName: Install dotnet-ef - inputs: - command: 'custom' - custom: 'tool' - arguments: 'install --global dotnet-ef' +#- task: DotNetCoreCLI@2 +# displayName: Install dotnet-ef +# inputs: +# command: 'custom' +# custom: 'tool' +# arguments: 'install --global dotnet-ef' -- task: DotNetCoreCLI@2 - displayName: Check dotnet-ef version +#- task: DotNetCoreCLI@2 +# displayName: Check dotnet-ef version +# inputs: +# command: 'custom' +# custom: 'ef' +# arguments: '--version' + +- task: CmdLine@2 + displayName: 'Instalando dotnet-ef' inputs: - command: 'custom' - custom: 'ef' - arguments: '--version' + script: 'dotnet tool install --global dotnet-ef' + #workingDirectory: # Optional + #failOnStderr: false # Optional -- task: NuGetCommand@2 +- task: CmdLine@2 displayName: 'Instalando sonarscanner' inputs: - command: 'custom' - custom: 'tool' - arguments: 'install --global dotnet-sonarscanner --version 5.8.0' - -- task: NuGetCommand@2 - displayName: 'Instalando dotCover' + script: 'dotnet tool install --global dotnet-sonarscanner' + #workingDirectory: # Optional + #failOnStderr: false # Optional + +- task: CmdLine@2 + displayName: 'Instalando sonarscanner' inputs: - command: custom - custom: 'tool' - arguments: 'install JetBrains.dotCover.GlobalTool' + script: 'dotnet tool install --global JetBrains.dotCover.GlobalTool' + #workingDirectory: # Optional + #failOnStderr: false # Optional - task: DotNetCoreCLI@2 displayName: Build From d65c0486812c4cda201c621e47107b0d5eb8bd27 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 08:31:58 -0300 Subject: [PATCH 035/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index ff17f23..d39d597 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -39,22 +39,16 @@ steps: displayName: 'Instalando dotnet-ef' inputs: script: 'dotnet tool install --global dotnet-ef' - #workingDirectory: # Optional - #failOnStderr: false # Optional - task: CmdLine@2 displayName: 'Instalando sonarscanner' inputs: - script: 'dotnet tool install --global dotnet-sonarscanner' - #workingDirectory: # Optional - #failOnStderr: false # Optional - + script: 'dotnet tool install --global dotnet-sonarscanner' + - task: CmdLine@2 displayName: 'Instalando sonarscanner' inputs: script: 'dotnet tool install --global JetBrains.dotCover.GlobalTool' - #workingDirectory: # Optional - #failOnStderr: false # Optional - task: DotNetCoreCLI@2 displayName: Build From 3c13a01dacffa9d156b3e8aabfb8167e4ae0cd99 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 09:11:47 -0300 Subject: [PATCH 036/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index d39d597..d43af9a 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -64,12 +64,10 @@ steps: projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) --collect "Code Coverage"' -- task: DotNetCoreCLI@2 +- task: CmdLine@2 displayName: 'Rodando SonarScanner ' inputs: - command: custom - custom: tool - arguments: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html + script: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html dotnet build –no-incremental dotnet dotcover test --dcReportType=HTML - dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' + dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' From 8c33df13791e57c8940423f4b1bd7f49ecad66e2 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 15:43:32 -0300 Subject: [PATCH 037/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 80 ++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 55 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index d43af9a..671af50 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -1,73 +1,43 @@ -# ASP.NET Core -# Build and test ASP.NET Core projects targeting .NET Core. -# Add steps that run tests, create a NuGet package, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core - -#trigger: -#- version-5 - pool: - vmImage: 'windows-2019' + vmImage: ubuntu-latest variables: buildConfiguration: 'Release' prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] steps: -- task: UseDotNet@2 - displayName: 'Install .NET Core SDK' - inputs: - version: 6.x - performMultiLevelLookup: true - includePreviewVersions: true # Required - -#- task: DotNetCoreCLI@2 -# displayName: Install dotnet-ef -# inputs: -# command: 'custom' -# custom: 'tool' -# arguments: 'install --global dotnet-ef' - -#- task: DotNetCoreCLI@2 -# displayName: Check dotnet-ef version -# inputs: -# command: 'custom' -# custom: 'ef' -# arguments: '--version' - -- task: CmdLine@2 - displayName: 'Instalando dotnet-ef' - inputs: - script: 'dotnet tool install --global dotnet-ef' - -- task: CmdLine@2 - displayName: 'Instalando sonarscanner' +- task: SonarQubePrepare@5 inputs: - script: 'dotnet tool install --global dotnet-sonarscanner' + SonarQube: 'SonarQube Developer Edition' + scannerMode: 'MSBuild' + projectKey: '$(SONAR_PROJECT_KEY)' -- task: CmdLine@2 - displayName: 'Instalando sonarscanner' +- task: DotNetCoreCLI@2 + displayName: Test inputs: - script: 'dotnet tool install --global JetBrains.dotCover.GlobalTool' - + command: test + projects: '**/*[Tt]ests/*.csproj' + arguments: '--configuration $(BuildConfiguration) --collect "Code Coverage"' + - task: DotNetCoreCLI@2 - displayName: Build + displayName: 'Calculate code coverage' + continueOnError: false inputs: - command: build - projects: '**/*.csproj' - arguments: '--configuration $(buildConfiguration)' + command: test + projects: '**/*.Test.csproj' + arguments: '/p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /m:1' + publishTestResults: false - task: DotNetCoreCLI@2 - displayName: Rodando os testes da aplicação + displayName: 'Checkpoint: Total branch coverage >= $(codeCoverageBranchThreshold)' + continueOnError: false inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "Code Coverage"' - -- task: CmdLine@2 - displayName: 'Rodando SonarScanner ' + arguments: '/p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' + publishTestResults: false + +- task: SonarQubePublish@5 + displayName: 'Publishing sonarqube analizys' inputs: - script: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html - dotnet build –no-incremental - dotnet dotcover test --dcReportType=HTML - dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' + pollingTimeoutSec: '300' \ No newline at end of file From 0eb7a3c7faf41e7b71a6bb93771b3199ba3fba32 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 15:52:46 -0300 Subject: [PATCH 038/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 671af50..05d21b6 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -12,20 +12,13 @@ steps: scannerMode: 'MSBuild' projectKey: '$(SONAR_PROJECT_KEY)' -- task: DotNetCoreCLI@2 - displayName: Test - inputs: - command: test - projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "Code Coverage"' - - task: DotNetCoreCLI@2 displayName: 'Calculate code coverage' continueOnError: false inputs: command: test - projects: '**/*.Test.csproj' - arguments: '/p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /m:1' + projects: '**/*[Tt]ests/*.csproj' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /m:1' publishTestResults: false - task: DotNetCoreCLI@2 @@ -34,9 +27,9 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '/p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' publishTestResults: false - + - task: SonarQubePublish@5 displayName: 'Publishing sonarqube analizys' inputs: From ffcf43a730aaa0c10ae451556f19c9fc2327c75b Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 15:57:09 -0300 Subject: [PATCH 039/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 05d21b6..36a0390 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -1,5 +1,5 @@ pool: - vmImage: ubuntu-latest + vmImage: windows-latest variables: buildConfiguration: 'Release' From a36761be93ce76c51d1842351ea245e13bb4cefd Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 16:02:18 -0300 Subject: [PATCH 040/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 41e3610..c6ff702 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -17,26 +17,20 @@ steps: - script: dotnet build --configuration $(buildConfiguration) displayName: 'dotnet build $(buildConfiguration)' -- task: UseDotNet@2 - displayName: 'Install .NET Core SDK' - inputs: - version: 5.0.x - performMultiLevelLookup: true - includePreviewVersions: true # Required - - task: DotNetCoreCLI@2 - displayName: Rodando os testes da aplicação + displayName: 'Calculate code coverage' + continueOnError: false inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "Code Coverage"' - + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /m:1' + publishTestResults: false + - task: DotNetCoreCLI@2 - displayName: 'Rodando SonarScanner ' + displayName: 'Checkpoint: Total branch coverage >= $(codeCoverageBranchThreshold)' + continueOnError: false inputs: - command: custom - custom: tool - arguments: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html - dotnet build –no-incremental - dotnet dotcover test --dcReportType=HTML - dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' \ No newline at end of file + command: test + projects: '**/*[Tt]ests/*.csproj' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' + publishTestResults: false \ No newline at end of file From e1cf3d1f18e228c8341e0cd236b7067cf7956d63 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 16:13:49 -0300 Subject: [PATCH 041/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index c6ff702..7adc910 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -33,4 +33,11 @@ steps: command: test projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' - publishTestResults: false \ No newline at end of file + publishTestResults: false + +- task: DotNetCoreCLI@2 + displayName: 'Rodando SonarScanner ' + inputs: + command: custom + custom: tool + arguments: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=.\TestResults\coverage.json dotnet build –no-incremental dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' \ No newline at end of file From c20b5593d2a53cb112a233b6d406fbdbc8c875af Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 16:23:41 -0300 Subject: [PATCH 042/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 7adc910..739a2a9 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -40,4 +40,18 @@ steps: inputs: command: custom custom: tool - arguments: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=.\TestResults\coverage.json dotnet build –no-incremental dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' \ No newline at end of file + arguments: 'sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=.\TestResults\coverage.json' + +- task: DotNetCoreCLI@2 + displayName: 'Rodando SonarScanner ' + inputs: + command: custom + custom: tool + arguments: 'dotnet build –no-incremental' + +- task: DotNetCoreCLI@2 + displayName: 'Rodando SonarScanner ' + inputs: + command: custom + custom: tool + arguments: 'sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' \ No newline at end of file From 20b9b0b677c7a246f1d8f1a618ddcdfbbbdf73a9 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 16:27:56 -0300 Subject: [PATCH 043/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 739a2a9..4020694 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -35,23 +35,5 @@ steps: arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' publishTestResults: false -- task: DotNetCoreCLI@2 - displayName: 'Rodando SonarScanner ' - inputs: - command: custom - custom: tool - arguments: 'sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=.\TestResults\coverage.json' - -- task: DotNetCoreCLI@2 - displayName: 'Rodando SonarScanner ' - inputs: - command: custom - custom: tool - arguments: 'dotnet build –no-incremental' - -- task: DotNetCoreCLI@2 - displayName: 'Rodando SonarScanner ' - inputs: - command: custom - custom: tool - arguments: 'sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' \ No newline at end of file +- script: dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=.\TestResults\coverage.json dotnet build –no-incremental dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)" + displayName: 'Rodando SonarScanner ' \ No newline at end of file From 1fe5ced93569cb7c2071b3b79563acf559bdcf0e Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 16:33:58 -0300 Subject: [PATCH 044/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 4020694..20fc864 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -14,9 +14,12 @@ variables: prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] steps: +- script: dotnet tool install --global dotnet-sonarscanner + displayName: 'Instalando dependência global sonarscanner' + - script: dotnet build --configuration $(buildConfiguration) displayName: 'dotnet build $(buildConfiguration)' - + - task: DotNetCoreCLI@2 displayName: 'Calculate code coverage' continueOnError: false From a3b51c26991cea7fab188050066e90f5ad3194f7 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 16:38:07 -0300 Subject: [PATCH 045/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 20fc864..a1524ac 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -17,9 +17,12 @@ steps: - script: dotnet tool install --global dotnet-sonarscanner displayName: 'Instalando dependência global sonarscanner' +- script: dotnet tool install --global JetBrains.dotCover.GlobalTool + displayName: 'Instalando dependência global JetBrains.dotCover.GlobalTool' + - script: dotnet build --configuration $(buildConfiguration) displayName: 'dotnet build $(buildConfiguration)' - + - task: DotNetCoreCLI@2 displayName: 'Calculate code coverage' continueOnError: false From 346d0141ddfb8170316d553c874574766e103eae Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 16:45:00 -0300 Subject: [PATCH 046/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index a1524ac..e6f1c06 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -41,5 +41,8 @@ steps: arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' publishTestResults: false -- script: dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=.\TestResults\coverage.json dotnet build –no-incremental dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)" +- script: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html + dotnet build –no-incremental + dotnet dotcover test --dcReportType=HTML + dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' displayName: 'Rodando SonarScanner ' \ No newline at end of file From b9b0720ff42ddb2f7ef29e5b18cac57f8e64fde2 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 16:56:47 -0300 Subject: [PATCH 047/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index e6f1c06..a769852 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -41,8 +41,14 @@ steps: arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' publishTestResults: false -- script: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html - dotnet build –no-incremental - dotnet dotcover test --dcReportType=HTML - dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' +- script: dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html + displayName: 'Rodando SonarScanner ' + +- script: dotnet build –no-incremental + displayName: 'Rodando SonarScanner ' + +- script: dotnet dotcover test --dcReportType=HTML + displayName: 'Rodando SonarScanner ' + +- script: dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)" displayName: 'Rodando SonarScanner ' \ No newline at end of file From 5e17224816672357a14c926eff028f385348c477 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 17:07:53 -0300 Subject: [PATCH 048/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index a769852..f5ecb8f 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -41,7 +41,7 @@ steps: arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' publishTestResults: false -- script: dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html +- script: dotnet sonarscanner begin /k:"${env:SONAR_PROJECT_KEY}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="${env:SONAR_TOKEN}" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html displayName: 'Rodando SonarScanner ' - script: dotnet build –no-incremental @@ -50,5 +50,5 @@ steps: - script: dotnet dotcover test --dcReportType=HTML displayName: 'Rodando SonarScanner ' -- script: dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)" +- script: dotnet sonarscanner end /d:sonar.login="${env:SONAR_TOKEN}" displayName: 'Rodando SonarScanner ' \ No newline at end of file From 10ac7b05cf73f769a21fcd0344fafb31f3d9d629 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 17:13:15 -0300 Subject: [PATCH 049/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index f5ecb8f..a6df31e 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -41,7 +41,7 @@ steps: arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' publishTestResults: false -- script: dotnet sonarscanner begin /k:"${env:SONAR_PROJECT_KEY}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="${env:SONAR_TOKEN}" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html +- script: dotnet sonarscanner begin /k:"%SONAR_PROJECT_KEY%" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="%SONAR_TOKEN%" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html displayName: 'Rodando SonarScanner ' - script: dotnet build –no-incremental @@ -50,5 +50,5 @@ steps: - script: dotnet dotcover test --dcReportType=HTML displayName: 'Rodando SonarScanner ' -- script: dotnet sonarscanner end /d:sonar.login="${env:SONAR_TOKEN}" +- script: dotnet sonarscanner end /d:sonar.login="%SONAR_TOKEN%" displayName: 'Rodando SonarScanner ' \ No newline at end of file From 7cb458998d6d4e7038db56445621094f10e0ee4d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 17:30:24 -0300 Subject: [PATCH 050/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index a6df31e..a769852 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -41,7 +41,7 @@ steps: arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' publishTestResults: false -- script: dotnet sonarscanner begin /k:"%SONAR_PROJECT_KEY%" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="%SONAR_TOKEN%" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html +- script: dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html displayName: 'Rodando SonarScanner ' - script: dotnet build –no-incremental @@ -50,5 +50,5 @@ steps: - script: dotnet dotcover test --dcReportType=HTML displayName: 'Rodando SonarScanner ' -- script: dotnet sonarscanner end /d:sonar.login="%SONAR_TOKEN%" +- script: dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)" displayName: 'Rodando SonarScanner ' \ No newline at end of file From 2dbf937d140c02c3a4c6f1618cad1f24e9a508bd Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 17:34:16 -0300 Subject: [PATCH 051/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index a769852..e6f1c06 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -41,14 +41,8 @@ steps: arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' publishTestResults: false -- script: dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html - displayName: 'Rodando SonarScanner ' - -- script: dotnet build –no-incremental - displayName: 'Rodando SonarScanner ' - -- script: dotnet dotcover test --dcReportType=HTML - displayName: 'Rodando SonarScanner ' - -- script: dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)" +- script: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html + dotnet build –no-incremental + dotnet dotcover test --dcReportType=HTML + dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' displayName: 'Rodando SonarScanner ' \ No newline at end of file From 01953d578bb0598ab7c301c2cceed363087b2600 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Mon, 29 Aug 2022 17:44:38 -0300 Subject: [PATCH 052/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index e6f1c06..5fe9dcc 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -41,8 +41,5 @@ steps: arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' publishTestResults: false -- script: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html - dotnet build –no-incremental - dotnet dotcover test --dcReportType=HTML - dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' +- script: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html dotnet build –no-incremental dotnet dotcover test --dcReportType=HTML dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' displayName: 'Rodando SonarScanner ' \ No newline at end of file From 2228400fad30b118eb114257871e46986637d6fb Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 10:30:45 -0300 Subject: [PATCH 053/189] Update adt_pullrequest.yml for Azure Pipelines --- adt_pull_request.yml | 58 +++++++++++++++++++++++++++-------- src/AzureDevopsTracker.csproj | 6 ++++ 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index b0dd16c..5367796 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -14,22 +14,54 @@ variables: prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] steps: -- script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' +- task: SonarQubePrepare@5 + inputs: + SonarQube: 'SonarQube Developer Edition' + scannerMode: 'MSBuild' + projectKey: '$(SONAR_PROJECT_KEY)' + extraProperties: | + # Additional properties that will be passed to the scanner, + # Put one key=value per line, example: + # sonar.exclusions=**/*.bin + sonar.cs.vscoveragexml.reportsPaths=**/CodeCoverage/Cobertura.xml + +- task: CmdLine@2 + inputs: + script: dotnet build --no-incremental + displayName: 'Rodando dotnet build' +# Test with Coverage +# Run all tests with "/p:CollectCoverage=true /p:CoverletOutputFormat=cobertura" to generate the code coverage file - task: DotNetCoreCLI@2 - displayName: Rodando os testes da aplicação + displayName: Rodando os testes da aplicação inputs: command: test + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura' projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "Code Coverage"' - -- task: DotNetCoreCLI@2 - displayName: 'Rodando SonarScanner ' + nobuild: true + +- task: reportgenerator@5 + displayName: ReportGenerator + inputs: + reports: '$(Build.SourcesDirectory)/tests/\*\*/coverage.cobertura.xml' + targetdir: '$(Build.SourcesDirectory)/CodeCoverage' + reporttypes: 'HtmlInline\_AzurePipelines;Cobertura;Badges' + assemblyfilters: '-xunit\*' + +# Publish the code coverage result (summary and web site) +# The summary allows to view the coverage percentage in the summary tab +# The web site allows to view which lines are covered directly in Azure Pipeline +- task: PublishCodeCoverageResults@1 + displayName: 'Publish code coverage' + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/Cobertura.xml' + reportDirectory: '$(Build.SourcesDirectory)/CodeCoverage' + +- task: SonarQubeAnalyze@5 + displayName: 'Run SonarCloud analysis' + +- task: SonarQubePublish@5 + displayName: 'Publish sonarqube analysis' inputs: - command: custom - custom: tool - arguments: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html - dotnet build –no-incremental - dotnet dotcover test --dcReportType=HTML - dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' \ No newline at end of file + pollingTimeoutSec: '300' \ No newline at end of file diff --git a/src/AzureDevopsTracker.csproj b/src/AzureDevopsTracker.csproj index aa7c3b4..ed7485c 100644 --- a/src/AzureDevopsTracker.csproj +++ b/src/AzureDevopsTracker.csproj @@ -24,9 +24,15 @@ + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + From d5cb5b85386cf00dbe2fa5b307f26102c4b965b4 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 11:45:02 -0300 Subject: [PATCH 054/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 68 +++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 10a5fb1..42ff6e3 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -1,60 +1,62 @@ pool: - vmImage: windows-latest + name: Azure Pipelines + demands: java -variables: - buildConfiguration: 'Release' - prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] +#Your build pipeline references an undefined variable named ‘Parameters.RestoreBuildProjects’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972 +#Your build pipeline references an undefined variable named ‘Parameters.RestoreBuildProjects’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972 +#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 +#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 steps: -- task: SonarQubePrepare@5 +- task: DotNetCoreCLI@2 + displayName: Restore + inputs: + command: restore + projects: '$(Parameters.RestoreBuildProjects)' + +- task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 + displayName: 'Prepare analysis on SonarCloud' inputs: - SonarQube: 'SonarQube Developer Edition' - scannerMode: 'MSBuild' - projectKey: '$(SONAR_PROJECT_KEY)' + SonarCloud: 'SonarCloud-ADT' + organization: typinghard + projectKey: 'typinghard_azure-devops-tracker' extraProperties: | - # Additional properties that will be passed to the scanner, - # Put one key=value per line, example: - # sonar.exclusions=**/*.bin - sonar.cs.vscoveragexml.reportsPaths=**/CodeCoverage/Cobertura.xml + # Additional properties that will be passed to the scanner, + # Put one key=value per line, example: + # sonar.exclusions=**/*.bin + sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/tests/\*\*/coverage.cobertura.xml -- task: CmdLine@2 +- task: DotNetCoreCLI@2 + displayName: Build inputs: - script: dotnet build --no-incremental - displayName: 'Rodando dotnet build' + projects: '$(Parameters.RestoreBuildProjects)' + arguments: '--configuration $(BuildConfiguration)' -# Test with Coverage -# Run all tests with "/p:CollectCoverage=true /p:CoverletOutputFormat=cobertura" to generate the code coverage file - task: DotNetCoreCLI@2 displayName: 'Calculate code coverage' - continueOnError: false inputs: command: test - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura' projects: '**/*[Tt]ests/*.csproj' - nobuild: true + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura' -- task: reportgenerator@5 +- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: reports: '$(Build.SourcesDirectory)/tests/\*\*/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/CodeCoverage' reporttypes: 'HtmlInline\_AzurePipelines;Cobertura;Badges' assemblyfilters: '-xunit\*' + customSettings: assemblyfilters -# Publish the code coverage result (summary and web site) -# The summary allows to view the coverage percentage in the summary tab -# The web site allows to view which lines are covered directly in Azure Pipeline - task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage' + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/tests/\*\*/coverage.cobertura.xml' inputs: codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/Cobertura.xml' - reportDirectory: '$(Build.SourcesDirectory)/CodeCoverage' + summaryFileLocation: '$(Build.SourcesDirectory)/tests/\*\*/coverage.cobertura.xml' -- task: SonarQubeAnalyze@5 - displayName: 'Run SonarCloud analysis' +- task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 + displayName: 'Run Code Analysis' + +- task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1 + displayName: 'Publish Quality Gate Result' -- task: SonarQubePublish@5 - displayName: 'Publish sonarqube analysis' - inputs: - pollingTimeoutSec: '300' \ No newline at end of file From 27573f42354493cce3cf30d72858095516b04f0a Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 11:57:22 -0300 Subject: [PATCH 055/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 42ff6e3..41486ce 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -2,18 +2,7 @@ pool: name: Azure Pipelines demands: java -#Your build pipeline references an undefined variable named ‘Parameters.RestoreBuildProjects’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972 -#Your build pipeline references an undefined variable named ‘Parameters.RestoreBuildProjects’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972 -#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 -#Your build pipeline references the ‘BuildConfiguration’ variable, which you’ve selected to be settable at queue time. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it settable at queue time. See https://go.microsoft.com/fwlink/?linkid=865971 - steps: -- task: DotNetCoreCLI@2 - displayName: Restore - inputs: - command: restore - projects: '$(Parameters.RestoreBuildProjects)' - - task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 displayName: 'Prepare analysis on SonarCloud' inputs: From d25931f87a9c3f5ee2a54d99adf2f8fd89be1f62 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 11:59:10 -0300 Subject: [PATCH 056/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 41486ce..620b99b 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -15,11 +15,10 @@ steps: # sonar.exclusions=**/*.bin sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/tests/\*\*/coverage.cobertura.xml -- task: DotNetCoreCLI@2 - displayName: Build +- task: CmdLine@2 inputs: - projects: '$(Parameters.RestoreBuildProjects)' - arguments: '--configuration $(BuildConfiguration)' + script: dotnet build --no-incremental + displayName: 'Rodando dotnet build' - task: DotNetCoreCLI@2 displayName: 'Calculate code coverage' From 56039ac1ef6c80ecfb47d191d0195933bfc896ad Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:03:58 -0300 Subject: [PATCH 057/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 620b99b..298f360 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/tests/\*\*/coverage.cobertura.xml + sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/**/*[Tt]ests/**/coverage.cobertura.xml - task: CmdLine@2 inputs: @@ -30,17 +30,17 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: - reports: '$(Build.SourcesDirectory)/tests/\*\*/coverage.cobertura.xml' + reports: '$(Build.SourcesDirectory)//**/*[Tt]ests/**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/CodeCoverage' reporttypes: 'HtmlInline\_AzurePipelines;Cobertura;Badges' assemblyfilters: '-xunit\*' customSettings: assemblyfilters - task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from $(Build.SourcesDirectory)/tests/\*\*/coverage.cobertura.xml' + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/**/*[Tt]ests/**/coverage.cobertura.xml' inputs: codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/tests/\*\*/coverage.cobertura.xml' + summaryFileLocation: '$(Build.SourcesDirectory)/**/*[Tt]ests/**/coverage.cobertura.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From e40b098f822cfff211f9d7124023ccf123ee776b Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:06:25 -0300 Subject: [PATCH 058/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 298f360..5b621d5 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -30,7 +30,7 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: - reports: '$(Build.SourcesDirectory)//**/*[Tt]ests/**/coverage.cobertura.xml' + reports: '$(Build.SourcesDirectory)/**/*[Tt]ests/**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/CodeCoverage' reporttypes: 'HtmlInline\_AzurePipelines;Cobertura;Badges' assemblyfilters: '-xunit\*' From 9e02617fda1c97d02ce118643c3fa84cdd0a47ea Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:09:14 -0300 Subject: [PATCH 059/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 5b621d5..128d262 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/**/*[Tt]ests/**/coverage.cobertura.xml + sonar.cs.vscoveragexml.reportsPaths=**/*[Tt]ests/coverage.cobertura.xml' - task: CmdLine@2 inputs: @@ -30,17 +30,17 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: - reports: '$(Build.SourcesDirectory)/**/*[Tt]ests/**/coverage.cobertura.xml' + reports: '**/*[Tt]ests/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/CodeCoverage' reporttypes: 'HtmlInline\_AzurePipelines;Cobertura;Badges' assemblyfilters: '-xunit\*' customSettings: assemblyfilters - task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from $(Build.SourcesDirectory)/**/*[Tt]ests/**/coverage.cobertura.xml' + displayName: 'Publish code coverage from **/*[Tt]ests/coverage.cobertura.xml' inputs: codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/**/*[Tt]ests/**/coverage.cobertura.xml' + summaryFileLocation: '**/*[Tt]ests/coverage.cobertura.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 31cee747b397a872bd413d16900ee0d6c8b778a9 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:11:40 -0300 Subject: [PATCH 060/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 128d262..e3584d3 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -30,7 +30,7 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: - reports: '**/*[Tt]ests/coverage.cobertura.xml' + reports: '**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/CodeCoverage' reporttypes: 'HtmlInline\_AzurePipelines;Cobertura;Badges' assemblyfilters: '-xunit\*' From aa68320709206936f2894895c246bd850eb0f44a Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:16:56 -0300 Subject: [PATCH 061/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index e3584d3..00eebc5 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.cs.vscoveragexml.reportsPaths=**/*[Tt]ests/coverage.cobertura.xml' + sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/CodeCoverage/coverage.cobertura.xml' - task: CmdLine@2 inputs: @@ -30,17 +30,17 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: - reports: '**/coverage.cobertura.xml' + reports: 'coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/CodeCoverage' reporttypes: 'HtmlInline\_AzurePipelines;Cobertura;Badges' assemblyfilters: '-xunit\*' customSettings: assemblyfilters - task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from **/*[Tt]ests/coverage.cobertura.xml' + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/CodeCoverage/coverage.cobertura.xml' inputs: codeCoverageTool: Cobertura - summaryFileLocation: '**/*[Tt]ests/coverage.cobertura.xml' + summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/coverage.cobertura.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 14f5f3a528c59fc64f47dc7bb285f77c4dc738dc Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:23:36 -0300 Subject: [PATCH 062/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 00eebc5..08729e8 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -30,17 +30,17 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: - reports: 'coverage.cobertura.xml' + reports: '**/*[Tt]ests/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/CodeCoverage' - reporttypes: 'HtmlInline\_AzurePipelines;Cobertura;Badges' + reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges' assemblyfilters: '-xunit\*' - customSettings: assemblyfilters - task: PublishCodeCoverageResults@1 displayName: 'Publish code coverage from $(Build.SourcesDirectory)/CodeCoverage/coverage.cobertura.xml' inputs: codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/coverage.cobertura.xml' + summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/Cobertura.xml' + reportDirectory: '$(Build.SourcesDirectory)/CodeCoverage' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 255815ebed76db2fa28560dffe28f4e921fa5c7d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:26:15 -0300 Subject: [PATCH 063/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 08729e8..3b76b21 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -30,7 +30,7 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: - reports: '**/*[Tt]ests/coverage.cobertura.xml' + reports: 'coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/CodeCoverage' reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges' assemblyfilters: '-xunit\*' From 8f174c8870825f85a5ca96ecbca43c6e668b0dd8 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:28:40 -0300 Subject: [PATCH 064/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 3b76b21..14b6ea8 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -29,11 +29,6 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator - inputs: - reports: 'coverage.cobertura.xml' - targetdir: '$(Build.SourcesDirectory)/CodeCoverage' - reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges' - assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 displayName: 'Publish code coverage from $(Build.SourcesDirectory)/CodeCoverage/coverage.cobertura.xml' From d610620d0b8ba65beaf1d78d9036a6f92925d158 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:32:12 -0300 Subject: [PATCH 065/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 14b6ea8..07dd650 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -29,6 +29,11 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator + inputs: + reports: '$(Build.SourcesDirectory)/**/*[Tt]ests/coverage.cobertura.xml' + targetdir: '$(Build.SourcesDirectory)/CodeCoverage' + reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges' + assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 displayName: 'Publish code coverage from $(Build.SourcesDirectory)/CodeCoverage/coverage.cobertura.xml' From ab2db28b774ca136134e6d33e9e74f7e94c7e426 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:39:24 -0300 Subject: [PATCH 066/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 07dd650..02136db 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/CodeCoverage/coverage.cobertura.xml' + sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' - task: CmdLine@2 inputs: @@ -30,17 +30,16 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: - reports: '$(Build.SourcesDirectory)/**/*[Tt]ests/coverage.cobertura.xml' - targetdir: '$(Build.SourcesDirectory)/CodeCoverage' - reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges' - assemblyfilters: '-xunit\*' + reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' + targetdir: '$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' + #reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges' + #assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from $(Build.SourcesDirectory)/CodeCoverage/coverage.cobertura.xml' + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' inputs: codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/Cobertura.xml' - reportDirectory: '$(Build.SourcesDirectory)/CodeCoverage' + summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From f29586f533c4a7f29bfd56d4bd05c01b94eade27 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:42:47 -0300 Subject: [PATCH 067/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 02136db..d4e4297 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,15 +25,21 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura' - -- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 - displayName: ReportGenerator - inputs: - reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' - targetdir: '$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' - #reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges' - #assemblyfilters: '-xunit\*' + arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" -- RunConfiguration.DisableAppDomain=true' + +- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' + displayName: 'Install ReportGenerator tool' + +- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' + displayName: 'Create reports' + +#- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 +# displayName: ReportGenerator +# inputs: +# reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' +# targetdir: '$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' +# #reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges' +# #assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' From 9f7c14b83aa9f89bf85c7dc2fc675d406326891a Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:46:07 -0300 Subject: [PATCH 068/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index d4e4297..92c4e58 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' + sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/**/coverage.cobertura.xml - task: CmdLine@2 inputs: From fc2e90bbd58bbdb23ba80f81bf56feeb76428868 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 12:49:29 -0300 Subject: [PATCH 069/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 92c4e58..11064e7 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/**/coverage.cobertura.xml + sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml - task: CmdLine@2 inputs: From 39defa4a6e8e28920e3d21d02c4175ae906b1818 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 13:07:13 -0300 Subject: [PATCH 070/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 11064e7..2b249ad 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,8 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml + sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml + sonar.coverage.jacoco.xmlReportPaths=$(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml - task: CmdLine@2 inputs: From c59ea04e2cad7770f13c61ece74df852075bd127 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 13:23:59 -0300 Subject: [PATCH 071/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 2b249ad..d53f115 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,8 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml - sonar.coverage.jacoco.xmlReportPaths=$(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml + sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml - task: CmdLine@2 inputs: From 4859f022f5bffcebd2c67ed35498965f1e96adee Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 14:13:12 -0300 Subject: [PATCH 072/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index d53f115..574faac 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml + sonar.coverageReportPaths=./sonarqubecoverage/SonarQube.xml - task: CmdLine@2 inputs: @@ -25,12 +25,12 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" -- RunConfiguration.DisableAppDomain=true' + arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage"' - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' -- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' +- script: 'reportgenerator -reports:**/TestResults/*/coverage.cobertura.xml -targetdir:sonarqubecoverage -reporttypes:"SonarQube;Cobertura"' displayName: 'Create reports' #- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 @@ -42,10 +42,10 @@ steps: # #assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/**/TestResults/*/coverage.cobertura.xml' inputs: codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml' + summaryFileLocation: '$(Build.SourcesDirectory)/**/TestResults/*/Cobertura.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 5b86f9ff97553a9714d28653f6ef49145f97ac14 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 14:15:40 -0300 Subject: [PATCH 073/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 574faac..fcde3d4 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -30,7 +30,7 @@ steps: - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' -- script: 'reportgenerator -reports:**/TestResults/*/coverage.cobertura.xml -targetdir:sonarqubecoverage -reporttypes:"SonarQube;Cobertura"' +- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/TestResults/*/coverage.cobertura.xml -targetdir:sonarqubecoverage -reporttypes:"SonarQube;Cobertura"' displayName: 'Create reports' #- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 From cd58b41d85463b493aa182c01b7af8a7a424fdb0 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 14:19:25 -0300 Subject: [PATCH 074/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index fcde3d4..df186ab 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -30,7 +30,7 @@ steps: - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' -- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/TestResults/*/coverage.cobertura.xml -targetdir:sonarqubecoverage -reporttypes:"SonarQube;Cobertura"' +- script: 'reportgenerator -reports:$(Agent.TempDirectory)/TestResults/*/coverage.cobertura.xml -targetdir:sonarqubecoverage -reporttypes:"SonarQube;Cobertura"' displayName: 'Create reports' #- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 From 8c3f7a7e3216d48f664c16c4779c43cc0d9545a7 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 14:21:49 -0300 Subject: [PATCH 075/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index df186ab..53b6113 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -30,7 +30,7 @@ steps: - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' -- script: 'reportgenerator -reports:$(Agent.TempDirectory)/TestResults/*/coverage.cobertura.xml -targetdir:sonarqubecoverage -reporttypes:"SonarQube;Cobertura"' +- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:sonarqubecoverage -reporttypes:"SonarQube;Cobertura"' displayName: 'Create reports' #- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 From a9b6758bfec1e92179dc65abeeb59a73fd0b7519 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 14:25:42 -0300 Subject: [PATCH 076/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 53b6113..11f8308 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=./sonarqubecoverage/SonarQube.xml + sonar.coverageReportPaths='$(Build.SourcesDirectory)/**/sonarqubecoverage/SonarQube.xml - task: CmdLine@2 inputs: @@ -42,10 +42,10 @@ steps: # #assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from $(Build.SourcesDirectory)/**/TestResults/*/coverage.cobertura.xml' + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/**/SonarQube.xml' inputs: codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/**/TestResults/*/Cobertura.xml' + summaryFileLocation: '$(Build.SourcesDirectory)/**/SonarQube.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From f3b11d362b65afadf256e2d92808a80c69df826d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 14:30:03 -0300 Subject: [PATCH 077/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 77 +++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 5fe9dcc..49e7bda 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -1,45 +1,54 @@ -# ASP.NET Core -# Build and test ASP.NET Core projects targeting .NET Core. -# Add steps that run tests, create a NuGet package, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core - -#trigger: -#- version-5 - pool: - vmImage: windows-latest - -variables: - buildConfiguration: 'Release' - prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] + name: Azure Pipelines + demands: java steps: -- script: dotnet tool install --global dotnet-sonarscanner - displayName: 'Instalando dependência global sonarscanner' - -- script: dotnet tool install --global JetBrains.dotCover.GlobalTool - displayName: 'Instalando dependência global JetBrains.dotCover.GlobalTool' - -- script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' +- task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 + displayName: 'Prepare analysis on SonarCloud' + inputs: + SonarCloud: 'SonarCloud-ADT' + organization: typinghard + projectKey: 'typinghard_azure-devops-tracker' + extraProperties: | + # Additional properties that will be passed to the scanner, + # Put one key=value per line, example: + # sonar.exclusions=**/*.bin + sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml + +- task: CmdLine@2 + inputs: + script: dotnet build --no-incremental + displayName: 'Rodando dotnet build' - task: DotNetCoreCLI@2 displayName: 'Calculate code coverage' - continueOnError: false inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /m:1' - publishTestResults: false - -- task: DotNetCoreCLI@2 - displayName: 'Checkpoint: Total branch coverage >= $(codeCoverageBranchThreshold)' - continueOnError: false + arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" -- RunConfiguration.DisableAppDomain=true' + +- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' + displayName: 'Install ReportGenerator tool' + +- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' + displayName: 'Create reports' + +#- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 +# displayName: ReportGenerator +# inputs: +# reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' +# targetdir: '$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' +# #reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges' +# #assemblyfilters: '-xunit\*' + +- task: PublishCodeCoverageResults@1 + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' inputs: - command: test - projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=../TestResults/ /p:CoverletOutputFormat="json%2ccobertura" /p:MergeWith=../TestResults/coverage.json /p:ThresholdType=branch /p:Threshold=$(codeCoverageBranchThreshold) /p:ThresholdStat=total' - publishTestResults: false + codeCoverageTool: Cobertura + summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml' + +- task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 + displayName: 'Run Code Analysis' -- script: 'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html dotnet build –no-incremental dotnet dotcover test --dcReportType=HTML dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"' - displayName: 'Rodando SonarScanner ' \ No newline at end of file +- task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1 + displayName: 'Publish Quality Gate Result' \ No newline at end of file From b7fd94fb9c97bde73dd7480b24e42b07850f3315 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 14:34:55 -0300 Subject: [PATCH 078/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 49e7bda..e0044e8 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml + sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml - task: CmdLine@2 inputs: From 860588b1d37b79b763b0cffcd166e383600d615d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 14:38:12 -0300 Subject: [PATCH 079/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 11f8308..49e7bda 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths='$(Build.SourcesDirectory)/**/sonarqubecoverage/SonarQube.xml + sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml - task: CmdLine@2 inputs: @@ -25,12 +25,12 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage"' + arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" -- RunConfiguration.DisableAppDomain=true' - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' -- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:sonarqubecoverage -reporttypes:"SonarQube;Cobertura"' +- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' displayName: 'Create reports' #- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 @@ -42,14 +42,13 @@ steps: # #assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from $(Build.SourcesDirectory)/**/SonarQube.xml' + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' inputs: codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/**/SonarQube.xml' + summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' - task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1 - displayName: 'Publish Quality Gate Result' - + displayName: 'Publish Quality Gate Result' \ No newline at end of file From 6f070b1157c92d05eb9e766fe2afc808fbe72ef1 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 14:43:29 -0300 Subject: [PATCH 080/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 49e7bda..c765e02 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,21 +25,21 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" -- RunConfiguration.DisableAppDomain=true' + arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage"' - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' -- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' - displayName: 'Create reports' +#- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' +# displayName: 'Create reports' -#- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 -# displayName: ReportGenerator -# inputs: -# reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' -# targetdir: '$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' -# #reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges' -# #assemblyfilters: '-xunit\*' +- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 + displayName: ReportGenerator + inputs: + reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' + targetdir: '$(Build.SourcesDirectory)/coverlet/reports' + reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml' + assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' From dae6a06bfc1bb16d6e632b72ba49df814b4c9e4a Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 14:47:39 -0300 Subject: [PATCH 081/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index c765e02..4d0ab2e 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml + sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/index.html - task: CmdLine@2 inputs: From 38b62d782f4d1c67006dae928f9f7e7ba28ab3ac Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 14:50:49 -0300 Subject: [PATCH 082/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 4d0ab2e..333dca8 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/index.html + sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/Summary.xml - task: CmdLine@2 inputs: From b35f61aa3562fd3a73f9457e10450854873996ff Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 14:54:20 -0300 Subject: [PATCH 083/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 333dca8..2e028d0 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/Summary.xml + sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xsd - task: CmdLine@2 inputs: @@ -38,7 +38,7 @@ steps: inputs: reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml' + reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;XSD;Clover' assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 From b42a8dd8c9930cf3f739c35043f0db62d2268883 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:00:18 -0300 Subject: [PATCH 084/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 2e028d0..08617ec 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -38,7 +38,7 @@ steps: inputs: reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;XSD;Clover' + reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover' assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 From fc229b9f8b54d348c8c8d7fd5beb7177a07a3d29 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:07:35 -0300 Subject: [PATCH 085/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 08617ec..1c5a4a3 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,7 +25,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage"' + arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" /p:CoverletOutputFormat=opencover' - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' @@ -38,7 +38,7 @@ steps: inputs: reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover' + reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;Opencover' assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 From 7984fc28c1f07bc5380e31f42a5a754405a0b106 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:11:32 -0300 Subject: [PATCH 086/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 1c5a4a3..f0b2d38 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,7 +25,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" /p:CoverletOutputFormat=opencover' + arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" /p:CoverletOutputFormat=opencover --results-directory $(Build.SourcesDirectory)/coverlet/reports' - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' @@ -38,7 +38,7 @@ steps: inputs: reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;Opencover' + reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml' assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 From 00b75348f6472599656c77eb11e11bb34f316b3d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:18:20 -0300 Subject: [PATCH 087/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index f0b2d38..960a8e0 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -27,8 +27,8 @@ steps: projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" /p:CoverletOutputFormat=opencover --results-directory $(Build.SourcesDirectory)/coverlet/reports' -- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' - displayName: 'Install ReportGenerator tool' +#- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' +# displayName: 'Install ReportGenerator tool' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' From f341de90f187bf56daf412cc71e453e1cdbe45d9 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:20:04 -0300 Subject: [PATCH 088/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 960a8e0..8e5f5cb 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,10 +25,10 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" /p:CoverletOutputFormat=opencover --results-directory $(Build.SourcesDirectory)/coverlet/reports' + arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" /p:CoverletOutputFormat=opencover --targetdir $(Build.SourcesDirectory)/coverlet/reports' -#- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' -# displayName: 'Install ReportGenerator tool' +- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' + displayName: 'Install ReportGenerator tool' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' From 75d44a5f103956c767ba81e6e7f2af492dbde570 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:27:05 -0300 Subject: [PATCH 089/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 8e5f5cb..058113e 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,7 +25,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" /p:CoverletOutputFormat=opencover --targetdir $(Build.SourcesDirectory)/coverlet/reports' + arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" -r $(Build.SourcesDirectory)/coverlet/reports' - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' @@ -38,7 +38,7 @@ steps: inputs: reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml' + reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 From 2925b248947372de9e14569b9fcb75601b8128aa Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:30:28 -0300 Subject: [PATCH 090/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 058113e..c38333b 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,7 +25,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" -r $(Build.SourcesDirectory)/coverlet/reports' + arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" -r "$(Build.SourcesDirectory)/coverlet/reports"' - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' From d1cc27d65b43159c8555436a5395baa539e5c1a1 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:40:09 -0300 Subject: [PATCH 091/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index c38333b..5402dcb 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -21,11 +21,11 @@ steps: displayName: 'Rodando dotnet build' - task: DotNetCoreCLI@2 - displayName: 'Calculate code coverage' + displayName: 'Rodando dotnet test' inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" -r "$(Build.SourcesDirectory)/coverlet/reports"' + arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" --output $(Build.ArtifactStagingDirectory)/coverlet/reports' - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' From 8b2844099963f86acd7ec59708d849eb718b30b8 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:44:17 -0300 Subject: [PATCH 092/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 5402dcb..fbd9455 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xsd + sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml - task: CmdLine@2 inputs: From 3782de7c6fa82c53da6bc3c080ddd6a771b1168e Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:46:32 -0300 Subject: [PATCH 093/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index fbd9455..21371f6 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml + sonar.coverageReportPaths=coverage.cobertura.xml - task: CmdLine@2 inputs: From 67927af17d05bfc1de8a1ba079893af04286f01d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:46:54 -0300 Subject: [PATCH 094/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 21371f6..a7f3daf 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=coverage.cobertura.xml + sonar.coverageReportPaths=$(Build.SourcesDirectory)/**/coverage.cobertura.xml - task: CmdLine@2 inputs: From e5fdec3dc35f814710a9bcaa0c2fa750058f828b Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:50:58 -0300 Subject: [PATCH 095/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index a7f3daf..808eb3f 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -26,6 +26,7 @@ steps: command: test projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" --output $(Build.ArtifactStagingDirectory)/coverlet/reports' + targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' From 8fbea86836b4453105c3af15d6de08ee8096dc66 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:54:54 -0300 Subject: [PATCH 096/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 808eb3f..c10b633 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Build.SourcesDirectory)/**/coverage.cobertura.xml + sonar.coverageReportPaths=$(Agent.TempDirectory)/**/coverage.cobertura.xml - task: CmdLine@2 inputs: From de37c1b7b7933a793f4f575bdabbbb52d2a39a95 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:57:30 -0300 Subject: [PATCH 097/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index c10b633..70906b1 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Agent.TempDirectory)/**/coverage.cobertura.xml + sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/coverage.cobertura.xml - task: CmdLine@2 inputs: @@ -37,7 +37,7 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: - reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' + reports: '$(Agent.TempDirectory)/coverlet/reports/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' assemblyfilters: '-xunit\*' From 3d9a164ceb80411f488123d9f9aa7b488bc7115b Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 15:59:51 -0300 Subject: [PATCH 098/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 70906b1..1fe0f0e 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -27,6 +27,7 @@ steps: projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" --output $(Build.ArtifactStagingDirectory)/coverlet/reports' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' + reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' - script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' displayName: 'Install ReportGenerator tool' @@ -37,7 +38,7 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: - reports: '$(Agent.TempDirectory)/coverlet/reports/coverage.cobertura.xml' + reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' assemblyfilters: '-xunit\*' From a1b73e038e18eeea59be20d093ca2bd3343ae1ba Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 16:07:27 -0300 Subject: [PATCH 099/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 1fe0f0e..8ab5af4 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,8 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/coverage.cobertura.xml + #sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/coverage.cobertura.xml + sonar.cs.dotcover.reportsPaths=dotCover.Output.html - task: CmdLine@2 inputs: @@ -26,28 +27,35 @@ steps: command: test projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" --output $(Build.ArtifactStagingDirectory)/coverlet/reports' - targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' + #targetdir: '$(Build.SourcesDirectory)/coverlet/reports' + #reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' -- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' - displayName: 'Install ReportGenerator tool' +#- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' +# displayName: 'Install ReportGenerator tool' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' - -- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 - displayName: ReportGenerator - inputs: - reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' - targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' - assemblyfilters: '-xunit\*' -- task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml' +- script: dotnet tool install --global JetBrains.dotCover.GlobalTool + displayName: 'Instalando ferramenta global JetBrains.dotCover.GlobalTool' + +- script: dotnet dotcover test --dcReportType=HTML + displayName: 'Rodando dotcover' + + +#- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 +# displayName: ReportGenerator +# inputs: +# reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' +# targetdir: '$(Build.SourcesDirectory)/coverlet/reports' +# reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' +# assemblyfilters: '-xunit\*' + +#- task: PublishCodeCoverageResults@1 +# displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' +# inputs: +# codeCoverageTool: Cobertura +# summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 988c1127fc93c5e405525caeffcf2f31df4d1d62 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 16:14:03 -0300 Subject: [PATCH 100/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 8ab5af4..9e29df2 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -16,6 +16,14 @@ steps: #sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/coverage.cobertura.xml sonar.cs.dotcover.reportsPaths=dotCover.Output.html +- script: dotnet tool install --global JetBrains.dotCover.GlobalTool + displayName: 'Instalando ferramenta global JetBrains.dotCover.GlobalTool' + +- task: CmdLine@2 + inputs: + script: dotnet restore + displayName: 'Rodando dotnet restore' + - task: CmdLine@2 inputs: script: dotnet build --no-incremental @@ -36,9 +44,6 @@ steps: #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' -- script: dotnet tool install --global JetBrains.dotCover.GlobalTool - displayName: 'Instalando ferramenta global JetBrains.dotCover.GlobalTool' - - script: dotnet dotcover test --dcReportType=HTML displayName: 'Rodando dotcover' From 426c7f0090583779db76f47faac1c0759c1da369 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 16:18:33 -0300 Subject: [PATCH 101/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 46 ++++++++++++++++---------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 9e29df2..d23ff97 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -14,15 +14,7 @@ steps: # Put one key=value per line, example: # sonar.exclusions=**/*.bin #sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/coverage.cobertura.xml - sonar.cs.dotcover.reportsPaths=dotCover.Output.html - -- script: dotnet tool install --global JetBrains.dotCover.GlobalTool - displayName: 'Instalando ferramenta global JetBrains.dotCover.GlobalTool' - -- task: CmdLine@2 - inputs: - script: dotnet restore - displayName: 'Rodando dotnet restore' + sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/coverlet/reports/dotCover.Output.html - task: CmdLine@2 inputs: @@ -35,32 +27,28 @@ steps: command: test projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" --output $(Build.ArtifactStagingDirectory)/coverlet/reports' - #targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - #reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' + targetdir: '$(Build.SourcesDirectory)/coverlet/reports' + reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' -#- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' -# displayName: 'Install ReportGenerator tool' +- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' + displayName: 'Install ReportGenerator tool' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' -- script: dotnet dotcover test --dcReportType=HTML - displayName: 'Rodando dotcover' - - -#- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 -# displayName: ReportGenerator -# inputs: -# reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' -# targetdir: '$(Build.SourcesDirectory)/coverlet/reports' -# reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' -# assemblyfilters: '-xunit\*' +- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 + displayName: ReportGenerator + inputs: + reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' + targetdir: '$(Build.SourcesDirectory)/coverlet/reports' + reporttypes: 'dotCover' + assemblyfilters: '-xunit\*' -#- task: PublishCodeCoverageResults@1 -# displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' -# inputs: -# codeCoverageTool: Cobertura -# summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml' +- task: PublishCodeCoverageResults@1 + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From df2a9c7769034dce3d7ac252aa63df021f956954 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 16:26:42 -0300 Subject: [PATCH 102/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index d23ff97..ce6ef44 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,8 +13,8 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - #sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/coverage.cobertura.xml - sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/coverlet/reports/dotCover.Output.html + ##sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/Cobertura.xml + sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/coverlet/reports/index.html - task: CmdLine@2 inputs: @@ -30,8 +30,8 @@ steps: targetdir: '$(Build.SourcesDirectory)/coverlet/reports' reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' -- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' - displayName: 'Install ReportGenerator tool' +#- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' +# displayName: 'Install ReportGenerator tool' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' @@ -41,7 +41,7 @@ steps: inputs: reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'dotCover' + reporttypes: '-reporttypes:Html;Clover;Cobertura;SonarQube' assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 From bab4e24b412662fa56651bf46759e58e82c59d32 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 16:29:15 -0300 Subject: [PATCH 103/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index ce6ef44..6643b09 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -28,7 +28,7 @@ steps: projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" --output $(Build.ArtifactStagingDirectory)/coverlet/reports' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges;Xml;Clover;' + reporttypes: 'HtmlInline_AzurePipelines;Xml;Html;Clover;Cobertura;SonarQube' #- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' # displayName: 'Install ReportGenerator tool' @@ -41,7 +41,7 @@ steps: inputs: reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: '-reporttypes:Html;Clover;Cobertura;SonarQube' + reporttypes: 'HtmlInline_AzurePipelines;Xml;Html;Clover;Cobertura;SonarQube' assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 From 7fa3efa428eadb60029b8fdf63fc3f235c6885c4 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 16:32:51 -0300 Subject: [PATCH 104/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 6643b09..4ee253b 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -14,7 +14,7 @@ steps: # Put one key=value per line, example: # sonar.exclusions=**/*.bin ##sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/Cobertura.xml - sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/coverlet/reports/index.html + sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/coverlet/reports/SonarQube.xml - task: CmdLine@2 inputs: From 50fecbdd1c9b0aa6c850edc36e1760195d69a1b8 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 16:41:55 -0300 Subject: [PATCH 105/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 47 ++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 4ee253b..04614e6 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,36 +13,27 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - ##sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/Cobertura.xml - sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/coverlet/reports/SonarQube.xml - -- task: CmdLine@2 - inputs: - script: dotnet build --no-incremental - displayName: 'Rodando dotnet build' - -- task: DotNetCoreCLI@2 - displayName: 'Rodando dotnet test' + sonar.coverageReportPaths=$(Build.SourcesDirectory)/results/coverage.cobertura.xml + #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/coverlet/reports/SonarQube.xml + +- script: dotnet build --configuration $(buildConfiguration) + displayName: 'dotnet build $(buildConfiguration)' +- script: | + mkdir $(Build.SourcesDirectory)\results + dotnet teste --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura **/*[Tt]ests/*.csproj + copy $(Agent.TempDirectory)\coverage.cobertura.xml $(Build.SourcesDirectory)\results + dotnet tool install dotnet-reportgenerator-globaltool --tool-path . --version 4.0.0-rc4 + .\reportgenerator "-reports:$(Agent.TempDirectory)\coverage.cobertura.xml" "-targetdir:results" "-reporttypes:HTMLInline;HTMLChart" + displayName: 'Unit testing' +- task: PublishTestResults@2 inputs: - command: test - projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" --output $(Build.ArtifactStagingDirectory)/coverlet/reports' - targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'HtmlInline_AzurePipelines;Xml;Html;Clover;Cobertura;SonarQube' - -#- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' -# displayName: 'Install ReportGenerator tool' - -#- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' -# displayName: 'Create reports' - -- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 - displayName: ReportGenerator + testRunner: VSTest + testResultsFiles: '**/*.trx' +- task: PublishCodeCoverageResults@1 inputs: - reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' - targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'HtmlInline_AzurePipelines;Xml;Html;Clover;Cobertura;SonarQube' - assemblyfilters: '-xunit\*' + summaryFileLocation: $(Build.SourcesDirectory)\results\coverage.cobertura.xml + reportDirectory: $(Build.SourcesDirectory)\results + codecoverageTool: cobertura - task: PublishCodeCoverageResults@1 displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' From 6d6328d7c533e0955d9694281cd4471f6f08506b Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 16:44:29 -0300 Subject: [PATCH 106/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 04614e6..fadcbe0 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -20,7 +20,7 @@ steps: displayName: 'dotnet build $(buildConfiguration)' - script: | mkdir $(Build.SourcesDirectory)\results - dotnet teste --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura **/*[Tt]ests/*.csproj + dotnet teste --configuration $(buildConfiguration) --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura **/*[Tt]ests/*.csproj copy $(Agent.TempDirectory)\coverage.cobertura.xml $(Build.SourcesDirectory)\results dotnet tool install dotnet-reportgenerator-globaltool --tool-path . --version 4.0.0-rc4 .\reportgenerator "-reports:$(Agent.TempDirectory)\coverage.cobertura.xml" "-targetdir:results" "-reporttypes:HTMLInline;HTMLChart" From 0fa748dd8d1803f8838d1183851bca51ac2c9bdd Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 16:50:13 -0300 Subject: [PATCH 107/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 47 ++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index fadcbe0..79236e7 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,27 +13,36 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Build.SourcesDirectory)/results/coverage.cobertura.xml - #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/coverlet/reports/SonarQube.xml - -- script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' -- script: | - mkdir $(Build.SourcesDirectory)\results - dotnet teste --configuration $(buildConfiguration) --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura **/*[Tt]ests/*.csproj - copy $(Agent.TempDirectory)\coverage.cobertura.xml $(Build.SourcesDirectory)\results - dotnet tool install dotnet-reportgenerator-globaltool --tool-path . --version 4.0.0-rc4 - .\reportgenerator "-reports:$(Agent.TempDirectory)\coverage.cobertura.xml" "-targetdir:results" "-reporttypes:HTMLInline;HTMLChart" - displayName: 'Unit testing' -- task: PublishTestResults@2 + #sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/SonarQube.xml + sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/coverlet/reports/DetailedXML.xml + +- task: CmdLine@2 inputs: - testRunner: VSTest - testResultsFiles: '**/*.trx' -- task: PublishCodeCoverageResults@1 + script: dotnet build --no-incremental + displayName: 'Rodando dotnet build' + +- task: DotNetCoreCLI@2 + displayName: 'Rodando dotnet test' + inputs: + command: test + projects: '**/*[Tt]ests/*.csproj' + arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" --output $(Build.ArtifactStagingDirectory)/coverlet/reports' + targetdir: '$(Build.SourcesDirectory)/coverlet/reports' + reporttypes: 'HtmlInline_AzurePipelines;Xml;Html;Clover;Cobertura;SonarQube;DetailedXML' + +#- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' +# displayName: 'Install ReportGenerator tool' + +#- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' +# displayName: 'Create reports' + +- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 + displayName: ReportGenerator inputs: - summaryFileLocation: $(Build.SourcesDirectory)\results\coverage.cobertura.xml - reportDirectory: $(Build.SourcesDirectory)\results - codecoverageTool: cobertura + reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' + targetdir: '$(Build.SourcesDirectory)/coverlet/reports' + reporttypes: 'HtmlInline_AzurePipelines;Xml;Html;Clover;Cobertura;SonarQube;DetailedXML' + assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' From e6684812bc25f0692c1523e30213b915adf7cf79 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 16:59:21 -0300 Subject: [PATCH 108/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 79236e7..0476a36 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -28,7 +28,7 @@ steps: projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" --output $(Build.ArtifactStagingDirectory)/coverlet/reports' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'HtmlInline_AzurePipelines;Xml;Html;Clover;Cobertura;SonarQube;DetailedXML' + reporttypes: 'SonarQube' #- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' # displayName: 'Install ReportGenerator tool' @@ -41,7 +41,7 @@ steps: inputs: reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' - reporttypes: 'HtmlInline_AzurePipelines;Xml;Html;Clover;Cobertura;SonarQube;DetailedXML' + reporttypes: 'SonarQube' assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 From 36c16017406b2a8567b796cf7e8bb6872752c761 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 17:02:51 -0300 Subject: [PATCH 109/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 0476a36..efb6315 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,8 +13,8 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - #sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/SonarQube.xml - sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/coverlet/reports/DetailedXML.xml + sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/SonarQube.xml + #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/coverlet/reports/DetailedXML.xml - task: CmdLine@2 inputs: From 22cf1acafa0240d5de15794159834755db6e418e Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 18:02:02 -0300 Subject: [PATCH 110/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index efb6315..933e200 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,8 +13,9 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Agent.TempDirectory)/coverlet/reports/SonarQube.xml - #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/coverlet/reports/DetailedXML.xml + sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx + #sonar.coverageReportPaths=$(Agent.TempDirectory)/reports/SonarQube.xml + #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml - task: CmdLine@2 inputs: @@ -26,8 +27,8 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" --output $(Build.ArtifactStagingDirectory)/coverlet/reports' - targetdir: '$(Build.SourcesDirectory)/coverlet/reports' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' + targetdir: '$(Build.SourcesDirectory)/reports' reporttypes: 'SonarQube' #- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' @@ -40,15 +41,20 @@ steps: displayName: ReportGenerator inputs: reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' - targetdir: '$(Build.SourcesDirectory)/coverlet/reports' + targetdir: '$(Build.SourcesDirectory)/reports' reporttypes: 'SonarQube' assemblyfilters: '-xunit\*' +- task: PublishTestResults@2 + inputs: + testResultsFormat: 'VSTest' + testResultsFiles: '$(Agent.TempDirectory)/**.*trx' + - task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/reports/coverage.cobertura.xml' inputs: codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml' + summaryFileLocation: '$(Build.SourcesDirectory)/reports/Cobertura.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 8c6030579515d648a3ede1bedcfcfcf7316f38db Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 18:12:55 -0300 Subject: [PATCH 111/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 933e200..9a2147f 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -40,16 +40,11 @@ steps: - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: - reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' + reports: '$(Agent.TempDirectory)/coverage.cobertura.xml' targetdir: '$(Build.SourcesDirectory)/reports' reporttypes: 'SonarQube' assemblyfilters: '-xunit\*' -- task: PublishTestResults@2 - inputs: - testResultsFormat: 'VSTest' - testResultsFiles: '$(Agent.TempDirectory)/**.*trx' - - task: PublishCodeCoverageResults@1 displayName: 'Publish code coverage from $(Build.SourcesDirectory)/reports/coverage.cobertura.xml' inputs: From 8036423554cc93d97b24158a270db1858f946fee Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 18:43:00 -0300 Subject: [PATCH 112/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 9a2147f..da16b43 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -31,12 +31,6 @@ steps: targetdir: '$(Build.SourcesDirectory)/reports' reporttypes: 'SonarQube' -#- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' -# displayName: 'Install ReportGenerator tool' - -#- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' -# displayName: 'Create reports' - - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: From b46c8cdd9fc37d639b628189f0e9a46296036f27 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 18:45:46 -0300 Subject: [PATCH 113/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index da16b43..5829729 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -27,9 +27,15 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' - targetdir: '$(Build.SourcesDirectory)/reports' - reporttypes: 'SonarQube' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" --output $(Build.ArtifactStagingDirectory)/reports' + targetdir: '$(Build.SourcesDirectory)/coverlet/reports' + reporttypes: 'HtmlInline_AzurePipelines;Xml;Html;Clover;Cobertura;SonarQube' + +#- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' +# displayName: 'Install ReportGenerator tool' + +#- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' +# displayName: 'Create reports' - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator From 44e1dd286c588b3132ad5ef4a536a7c0765224f7 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 18:47:51 -0300 Subject: [PATCH 114/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 5829729..2ec4f97 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -27,7 +27,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" --output $(Build.ArtifactStagingDirectory)/reports' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' targetdir: '$(Build.SourcesDirectory)/coverlet/reports' reporttypes: 'HtmlInline_AzurePipelines;Xml;Html;Clover;Cobertura;SonarQube' From 1d97a6cef72dcbb9bac0214f0ea2cdfd035cbb83 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 18:48:04 -0300 Subject: [PATCH 115/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 2ec4f97..4bb9553 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -28,7 +28,7 @@ steps: command: test projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' - targetdir: '$(Build.SourcesDirectory)/coverlet/reports' + targetdir: '$(Build.SourcesDirectory)/reports' reporttypes: 'HtmlInline_AzurePipelines;Xml;Html;Clover;Cobertura;SonarQube' #- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' From 24812df140cbf5a2acf1735846f416dd3990dc14 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 18:48:49 -0300 Subject: [PATCH 116/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 4bb9553..a47b2d2 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -28,8 +28,6 @@ steps: command: test projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' - targetdir: '$(Build.SourcesDirectory)/reports' - reporttypes: 'HtmlInline_AzurePipelines;Xml;Html;Clover;Cobertura;SonarQube' #- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' # displayName: 'Install ReportGenerator tool' @@ -37,6 +35,11 @@ steps: #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' +- task: PublishTestResults@2 + inputs: + testResultsFormat: 'VSTest' + testResultsFiles: '$(Agent.TempDirectory)/**.*trx' + - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 displayName: ReportGenerator inputs: From fe56b47227bfd263d2aacb8f3fb4a5ac8b3e6752 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 18:52:25 -0300 Subject: [PATCH 117/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index a47b2d2..fd74481 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -40,13 +40,13 @@ steps: testResultsFormat: 'VSTest' testResultsFiles: '$(Agent.TempDirectory)/**.*trx' -- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 - displayName: ReportGenerator - inputs: - reports: '$(Agent.TempDirectory)/coverage.cobertura.xml' - targetdir: '$(Build.SourcesDirectory)/reports' - reporttypes: 'SonarQube' - assemblyfilters: '-xunit\*' +#- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 +# displayName: ReportGenerator +# inputs: +# reports: '$(Agent.TempDirectory)/coverage.cobertura.xml' +# targetdir: '$(Build.SourcesDirectory)/reports' +# reporttypes: 'SonarQube' +3 assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 displayName: 'Publish code coverage from $(Build.SourcesDirectory)/reports/coverage.cobertura.xml' From 39331aad5c2c27292f9ed82233892aef9853dde5 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 18:54:02 -0300 Subject: [PATCH 118/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index fd74481..7d5b57e 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -46,7 +46,7 @@ steps: # reports: '$(Agent.TempDirectory)/coverage.cobertura.xml' # targetdir: '$(Build.SourcesDirectory)/reports' # reporttypes: 'SonarQube' -3 assemblyfilters: '-xunit\*' +# assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 displayName: 'Publish code coverage from $(Build.SourcesDirectory)/reports/coverage.cobertura.xml' From 793adc129c10ad551ce76fb1eaee242ea64fc961 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 18:58:14 -0300 Subject: [PATCH 119/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 7d5b57e..0bceb3c 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,8 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx + sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx + #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx #sonar.coverageReportPaths=$(Agent.TempDirectory)/reports/SonarQube.xml #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml @@ -48,11 +49,11 @@ steps: # reporttypes: 'SonarQube' # assemblyfilters: '-xunit\*' -- task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from $(Build.SourcesDirectory)/reports/coverage.cobertura.xml' - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/reports/Cobertura.xml' +#- task: PublishCodeCoverageResults@1 +# displayName: 'Publish code coverage from $(Build.SourcesDirectory)/reports/coverage.cobertura.xml' +# inputs: +# codeCoverageTool: Cobertura +# summaryFileLocation: '$(Build.SourcesDirectory)/reports/Cobertura.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From e984ff665d7934d2d2b5e013b0b1634316bd13d9 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 19:02:56 -0300 Subject: [PATCH 120/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 0bceb3c..c1562f3 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,8 +13,8 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx - #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx + #sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx + sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx #sonar.coverageReportPaths=$(Agent.TempDirectory)/reports/SonarQube.xml #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml From b4d2cdfa5f592aff7ddcc017583a9413fb028ca0 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 19:06:09 -0300 Subject: [PATCH 121/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index c1562f3..d0bcdf1 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -14,9 +14,11 @@ steps: # Put one key=value per line, example: # sonar.exclusions=**/*.bin #sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx - sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx + #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx #sonar.coverageReportPaths=$(Agent.TempDirectory)/reports/SonarQube.xml #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml + sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml + sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx - task: CmdLine@2 inputs: From f7c10477b835a4e8fb8b5aacc3d438766a8c9fdf Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 19:22:29 -0300 Subject: [PATCH 122/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index d0bcdf1..73768d0 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -19,6 +19,10 @@ steps: #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx + sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx + sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx + sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml + sonar.verbose=true - task: CmdLine@2 inputs: From 0dffa6448fc98d34897b258df9b7d40d229e8bfc Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 19:28:12 -0300 Subject: [PATCH 123/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 73768d0..fde6be1 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -22,6 +22,7 @@ steps: sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml + sonar.cs.vscoveragexml.reportsPaths=coverage.xml sonar.verbose=true - task: CmdLine@2 @@ -36,12 +37,15 @@ steps: projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' -#- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' -# displayName: 'Install ReportGenerator tool' +- script: 'dotnet tool install --global coverlet.console' + displayName: 'Install coverlet tool' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' +- script: dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml' + displayName: 'Run dotnet-coverage' + - task: PublishTestResults@2 inputs: testResultsFormat: 'VSTest' From d372c82869596c6f82d741030316100b7ab14691 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 21:05:27 -0300 Subject: [PATCH 124/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index fde6be1..c08e151 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -40,6 +40,10 @@ steps: - script: 'dotnet tool install --global coverlet.console' displayName: 'Install coverlet tool' +- script: Install-Package coverlet.collector -Version 3.1.2 + displayName: 'Install coverlet collector tool' + + #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' From 98e1097ac8b68a6f9af643bbefb866b8d4d40842 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 21:30:47 -0300 Subject: [PATCH 125/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index c08e151..7f00a53 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -23,6 +23,7 @@ steps: sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml sonar.cs.vscoveragexml.reportsPaths=coverage.xml + sonar.cs.opencover.reportsPaths=coverage.xml sonar.verbose=true - task: CmdLine@2 @@ -40,14 +41,10 @@ steps: - script: 'dotnet tool install --global coverlet.console' displayName: 'Install coverlet tool' -- script: Install-Package coverlet.collector -Version 3.1.2 - displayName: 'Install coverlet collector tool' - - #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' -- script: dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml' +- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.xml" displayName: 'Run dotnet-coverage' - task: PublishTestResults@2 From 5ec34a42b820b60aee7488982d2991050e4ba385 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 21:34:06 -0300 Subject: [PATCH 126/189] Updating csproj and yml file --- adt_pull_request.yml | 4 ++-- src/AzureDevopsTracker.csproj | 6 ------ .../AzureDevopsTracker.Tests.csproj | 4 ++++ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 7f00a53..8b2f749 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -39,13 +39,13 @@ steps: arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' - script: 'dotnet tool install --global coverlet.console' - displayName: 'Install coverlet tool' + displayName: 'Install coverlet global tool' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' - script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.xml" - displayName: 'Run dotnet-coverage' + displayName: 'Run coverlet' - task: PublishTestResults@2 inputs: diff --git a/src/AzureDevopsTracker.csproj b/src/AzureDevopsTracker.csproj index ed7485c..aa7c3b4 100644 --- a/src/AzureDevopsTracker.csproj +++ b/src/AzureDevopsTracker.csproj @@ -24,15 +24,9 @@ - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - diff --git a/tests/AzureDevopsTracker.Tests/AzureDevopsTracker.Tests.csproj b/tests/AzureDevopsTracker.Tests/AzureDevopsTracker.Tests.csproj index 97fe960..4167967 100644 --- a/tests/AzureDevopsTracker.Tests/AzureDevopsTracker.Tests.csproj +++ b/tests/AzureDevopsTracker.Tests/AzureDevopsTracker.Tests.csproj @@ -9,6 +9,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + From 7ea5899dfa7618a8f80eb1359fd0d95432fb3613 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 21:38:22 -0300 Subject: [PATCH 127/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 8b2f749..a74f486 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -17,14 +17,13 @@ steps: #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx #sonar.coverageReportPaths=$(Agent.TempDirectory)/reports/SonarQube.xml #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml - sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml - sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx - sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx - sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx - sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml - sonar.cs.vscoveragexml.reportsPaths=coverage.xml + #sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml + #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx + #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx + #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx + #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml + #sonar.cs.vscoveragexml.reportsPaths=coverage.xml sonar.cs.opencover.reportsPaths=coverage.xml - sonar.verbose=true - task: CmdLine@2 inputs: From 11065e310580318ec4662047677dea6d33909b5d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 21:38:35 -0300 Subject: [PATCH 128/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index a74f486..9f73ed1 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,7 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - #sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx + sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx #sonar.coverageReportPaths=$(Agent.TempDirectory)/reports/SonarQube.xml #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml From 2f37489b7533f0008d4be305241d16131e2a05bd Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 21:42:50 -0300 Subject: [PATCH 129/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index e0044e8..dcd76c8 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,8 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml + sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx + sonar.cs.opencover.reportsPaths=coverage.xml - task: CmdLine@2 inputs: @@ -21,31 +22,22 @@ steps: displayName: 'Rodando dotnet build' - task: DotNetCoreCLI@2 - displayName: 'Calculate code coverage' + displayName: 'Rodando dotnet test' inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) --collect "XPlat Code coverage" -- RunConfiguration.DisableAppDomain=true' - -- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool --version 4.5.8' - displayName: 'Install ReportGenerator tool' - -- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' - displayName: 'Create reports' - -#- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 -# displayName: ReportGenerator -# inputs: -# reports: '$(Agent.TempDirectory)/**/coverage.cobertura.xml' -# targetdir: '$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' -# #reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges' -# #assemblyfilters: '-xunit\*' - -- task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverlet/reports/coverage.cobertura.xml' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' + +- script: 'dotnet tool install --global coverlet.console' + displayName: 'Install coverlet global tool' + +- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.xml" + displayName: 'Run coverlet' + +- task: PublishTestResults@2 inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml' + testResultsFormat: 'VSTest' + testResultsFiles: '$(Agent.TempDirectory)/**.*trx' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 4277905789344e0ebdbb759a961d2e73e767eb3c Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 21:45:46 -0300 Subject: [PATCH 130/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index dcd76c8..c1b99c5 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,7 +13,6 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx sonar.cs.opencover.reportsPaths=coverage.xml - task: CmdLine@2 From 6b04d1a7a7add6d680fefef15c57280812104c8a Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 21:46:38 -0300 Subject: [PATCH 131/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index c1b99c5..a29330f 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -28,15 +28,10 @@ steps: arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' - script: 'dotnet tool install --global coverlet.console' - displayName: 'Install coverlet global tool' + displayName: 'Instalando ferramenta global coverlet.console' - script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.xml" - displayName: 'Run coverlet' - -- task: PublishTestResults@2 - inputs: - testResultsFormat: 'VSTest' - testResultsFiles: '$(Agent.TempDirectory)/**.*trx' + displayName: 'Rodando coverlet' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 93e218b16995a7a098fa3b2a87f121541c4a0cac Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 21:49:53 -0300 Subject: [PATCH 132/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index a29330f..f9508ce 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,7 +25,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' + arguments: '--configuration $(BuildConfiguration) -collect:"XPlat Code Coverage" -r "_codeCoverage"' - script: 'dotnet tool install --global coverlet.console' displayName: 'Instalando ferramenta global coverlet.console' From b1be128a7b0b38189a0890d4c8cfc541f6639f38 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 21:52:11 -0300 Subject: [PATCH 133/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 9f73ed1..e5f330c 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -14,28 +14,21 @@ steps: # Put one key=value per line, example: # sonar.exclusions=**/*.bin sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx - #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx - #sonar.coverageReportPaths=$(Agent.TempDirectory)/reports/SonarQube.xml - #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml - #sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml - #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx - #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx - #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx - #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml - #sonar.cs.vscoveragexml.reportsPaths=coverage.xml sonar.cs.opencover.reportsPaths=coverage.xml - task: CmdLine@2 inputs: script: dotnet build --no-incremental displayName: 'Rodando dotnet build' +#- task: DotNetCoreCLI@2 +# displayName: 'Rodando dotnet test' +# inputs: +# command: test +# projects: '**/*[Tt]ests/*.csproj' +# arguments: '--configuration $(BuildConfiguration) --collect "Code Coverage"' -- task: DotNetCoreCLI@2 - displayName: 'Rodando dotnet test' - inputs: - command: test - projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' +- script: 'dotnet test --collect:"XPlat Code Coverage"' + displayName: 'Rodando Testes' - script: 'dotnet tool install --global coverlet.console' displayName: 'Install coverlet global tool' From ba5abb9dd2342757c4c3b94e4b16bd93a95a42f5 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 1 Sep 2022 21:52:44 -0300 Subject: [PATCH 134/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index f9508ce..1171f96 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -20,12 +20,15 @@ steps: script: dotnet build --no-incremental displayName: 'Rodando dotnet build' -- task: DotNetCoreCLI@2 - displayName: 'Rodando dotnet test' - inputs: - command: test - projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) -collect:"XPlat Code Coverage" -r "_codeCoverage"' +#- task: DotNetCoreCLI@2 +# displayName: 'Rodando dotnet test' +# inputs: +# command: test +# projects: '**/*[Tt]ests/*.csproj' +# arguments: '--configuration $(BuildConfiguration) --collect "Code Coverage"' + +- script: 'dotnet test --collect:"XPlat Code Coverage"' + displayName: 'Rodando Testes' - script: 'dotnet tool install --global coverlet.console' displayName: 'Instalando ferramenta global coverlet.console' From cad3534d4fbaaf106c9dc40d4f60c7caf4980ae3 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 08:06:16 -0300 Subject: [PATCH 135/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 54 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 12 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 1171f96..20a8258 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,28 +13,58 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.cs.opencover.reportsPaths=coverage.xml + #sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx + #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx + #sonar.coverageReportPaths=$(Agent.TempDirectory)/reports/SonarQube.xml + #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml + #sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml + #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx + #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx + #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx + #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml + #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\coverage.opencover.xml + sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\coverage.opencover.xml + #sonar.cs.opencover.reportsPaths=coverage.xml - task: CmdLine@2 inputs: script: dotnet build --no-incremental displayName: 'Rodando dotnet build' -#- task: DotNetCoreCLI@2 -# displayName: 'Rodando dotnet test' -# inputs: -# command: test -# projects: '**/*[Tt]ests/*.csproj' -# arguments: '--configuration $(BuildConfiguration) --collect "Code Coverage"' - -- script: 'dotnet test --collect:"XPlat Code Coverage"' - displayName: 'Rodando Testes' +- task: DotNetCoreCLI@2 + displayName: 'Rodando dotnet test' + inputs: + command: test + projects: '**/*[Tt]ests/*.csproj' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' - script: 'dotnet tool install --global coverlet.console' - displayName: 'Instalando ferramenta global coverlet.console' + displayName: 'Install coverlet global tool' + +#- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' +# displayName: 'Create reports' - script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.xml" - displayName: 'Rodando coverlet' + displayName: 'Run coverlet' + +- task: PublishTestResults@2 + inputs: + testResultsFormat: 'VSTest' + testResultsFiles: '$(Agent.TempDirectory)/**.*trx' + +#- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 +# displayName: ReportGenerator +# inputs: +# reports: '$(Agent.TempDirectory)/coverage.cobertura.xml' +# targetdir: '$(Build.SourcesDirectory)/reports' +# reporttypes: 'SonarQube' +# assemblyfilters: '-xunit\*' + +#- task: PublishCodeCoverageResults@1 +# displayName: 'Publish code coverage from $(Build.SourcesDirectory)/reports/coverage.cobertura.xml' +# inputs: +# codeCoverageTool: Cobertura +# summaryFileLocation: '$(Build.SourcesDirectory)/reports/Cobertura.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From ac59357dc4dcbc098a6d539d8d447be0291e6e3e Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 08:10:18 -0300 Subject: [PATCH 136/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 20a8258..8b2f749 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -17,14 +17,14 @@ steps: #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx #sonar.coverageReportPaths=$(Agent.TempDirectory)/reports/SonarQube.xml #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml - #sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml - #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx - #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx - #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx - #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml - #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\coverage.opencover.xml - sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\coverage.opencover.xml - #sonar.cs.opencover.reportsPaths=coverage.xml + sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml + sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx + sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx + sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx + sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml + sonar.cs.vscoveragexml.reportsPaths=coverage.xml + sonar.cs.opencover.reportsPaths=coverage.xml + sonar.verbose=true - task: CmdLine@2 inputs: From cca8559f605e4bac82747f35fd5c2de3a2b7a345 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 08:19:04 -0300 Subject: [PATCH 137/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 8b2f749..d83a83f 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -26,6 +26,12 @@ steps: sonar.cs.opencover.reportsPaths=coverage.xml sonar.verbose=true + +- task: CmdLine@2 + inputs: + script: dotnet restore + displayName: 'Rodando dotnet restore' + - task: CmdLine@2 inputs: script: dotnet build --no-incremental @@ -60,11 +66,11 @@ steps: # reporttypes: 'SonarQube' # assemblyfilters: '-xunit\*' -#- task: PublishCodeCoverageResults@1 -# displayName: 'Publish code coverage from $(Build.SourcesDirectory)/reports/coverage.cobertura.xml' -# inputs: -# codeCoverageTool: Cobertura -# summaryFileLocation: '$(Build.SourcesDirectory)/reports/Cobertura.xml' +- task: PublishCodeCoverageResults@1 + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverage.xml' + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(Build.SourcesDirectory)/coverage.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 79ce32a38dbcd16e60799eed7fff1be3c8afb845 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 08:19:12 -0300 Subject: [PATCH 138/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index e5f330c..d83a83f 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -13,22 +13,36 @@ steps: # Additional properties that will be passed to the scanner, # Put one key=value per line, example: # sonar.exclusions=**/*.bin - sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx + #sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx + #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx + #sonar.coverageReportPaths=$(Agent.TempDirectory)/reports/SonarQube.xml + #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml + sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml + sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx + sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx + sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx + sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml + sonar.cs.vscoveragexml.reportsPaths=coverage.xml sonar.cs.opencover.reportsPaths=coverage.xml + sonar.verbose=true + + +- task: CmdLine@2 + inputs: + script: dotnet restore + displayName: 'Rodando dotnet restore' - task: CmdLine@2 inputs: script: dotnet build --no-incremental displayName: 'Rodando dotnet build' -#- task: DotNetCoreCLI@2 -# displayName: 'Rodando dotnet test' -# inputs: -# command: test -# projects: '**/*[Tt]ests/*.csproj' -# arguments: '--configuration $(BuildConfiguration) --collect "Code Coverage"' -- script: 'dotnet test --collect:"XPlat Code Coverage"' - displayName: 'Rodando Testes' +- task: DotNetCoreCLI@2 + displayName: 'Rodando dotnet test' + inputs: + command: test + projects: '**/*[Tt]ests/*.csproj' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' - script: 'dotnet tool install --global coverlet.console' displayName: 'Install coverlet global tool' @@ -52,11 +66,11 @@ steps: # reporttypes: 'SonarQube' # assemblyfilters: '-xunit\*' -#- task: PublishCodeCoverageResults@1 -# displayName: 'Publish code coverage from $(Build.SourcesDirectory)/reports/coverage.cobertura.xml' -# inputs: -# codeCoverageTool: Cobertura -# summaryFileLocation: '$(Build.SourcesDirectory)/reports/Cobertura.xml' +- task: PublishCodeCoverageResults@1 + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverage.xml' + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(Build.SourcesDirectory)/coverage.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 5a569a5b5a8e95b07a5d73def3737c70c6fd5adc Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 08:34:29 -0300 Subject: [PATCH 139/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index d83a83f..b865281 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -17,12 +17,12 @@ steps: #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx #sonar.coverageReportPaths=$(Agent.TempDirectory)/reports/SonarQube.xml #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml - sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml - sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx - sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx - sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx - sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml - sonar.cs.vscoveragexml.reportsPaths=coverage.xml + #sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml + #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx + #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx + #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx + #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml + #sonar.cs.vscoveragexml.reportsPaths=coverage.xml sonar.cs.opencover.reportsPaths=coverage.xml sonar.verbose=true @@ -37,6 +37,9 @@ steps: script: dotnet build --no-incremental displayName: 'Rodando dotnet build' +- script: 'dotnet tool install --global coverlet.console' + displayName: 'Install coverlet global tool' + - task: DotNetCoreCLI@2 displayName: 'Rodando dotnet test' inputs: @@ -44,13 +47,10 @@ steps: projects: '**/*[Tt]ests/*.csproj' arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' -- script: 'dotnet tool install --global coverlet.console' - displayName: 'Install coverlet global tool' - #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' -- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.xml" +- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --build" -f=opencover -o="coverage.opencover.xml'" displayName: 'Run coverlet' - task: PublishTestResults@2 @@ -66,11 +66,11 @@ steps: # reporttypes: 'SonarQube' # assemblyfilters: '-xunit\*' -- task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverage.xml' - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: '$(Build.SourcesDirectory)/coverage.xml' +#- task: PublishCodeCoverageResults@1 +# displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverage.xml' +# inputs: +# codeCoverageTool: Cobertura +# summaryFileLocation: '$(Build.SourcesDirectory)/coverage.xml' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 43e7ee2cbe3903f09d08ab86719500ac285e8b84 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 08:37:41 -0300 Subject: [PATCH 140/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index b865281..f97caa3 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -50,7 +50,7 @@ steps: #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' -- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --build" -f=opencover -o="coverage.opencover.xml'" +- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --build" -f=opencover -o="coverage.opencover.xml" displayName: 'Run coverlet' - task: PublishTestResults@2 From ce78eae882cb2a5212e8d98c00a4881f3fa3f85f Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 08:43:24 -0300 Subject: [PATCH 141/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index f97caa3..af70a6a 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -22,7 +22,7 @@ steps: #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml - #sonar.cs.vscoveragexml.reportsPaths=coverage.xml + sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/tests/**/coverage.opencover.xml sonar.cs.opencover.reportsPaths=coverage.xml sonar.verbose=true @@ -50,7 +50,7 @@ steps: #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' -- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --build" -f=opencover -o="coverage.opencover.xml" +- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --build" -f=opencover -o="coverage.xml'" displayName: 'Run coverlet' - task: PublishTestResults@2 From c82f716b69e4cfc1b2c0dc080f6d4e934e4b6186 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 08:46:55 -0300 Subject: [PATCH 142/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index af70a6a..6f18e6e 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -50,7 +50,7 @@ steps: #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' -- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --build" -f=opencover -o="coverage.xml'" +- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --build" -f=opencover -o="coverage.xml" displayName: 'Run coverlet' - task: PublishTestResults@2 From ffc086296f52be74c5735df93e63df851128a0d6 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 08:51:07 -0300 Subject: [PATCH 143/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 6f18e6e..be522e0 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -50,8 +50,8 @@ steps: #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' -- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --build" -f=opencover -o="coverage.xml" - displayName: 'Run coverlet' +- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.opencover.xml" + displayName: 'Run coverlet' - task: PublishTestResults@2 inputs: From fa20e348bdeb41fa57e2797ff24147549de62183 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 08:57:06 -0300 Subject: [PATCH 144/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index be522e0..5986ccb 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -22,7 +22,7 @@ steps: #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml - sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/tests/**/coverage.opencover.xml + sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/tests/*/coverage.opencover.xml sonar.cs.opencover.reportsPaths=coverage.xml sonar.verbose=true From c63524895adc878b1105d73321437799cdb3f4a6 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 09:07:07 -0300 Subject: [PATCH 145/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 5986ccb..574e12e 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -23,8 +23,7 @@ steps: #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/tests/*/coverage.opencover.xml - sonar.cs.opencover.reportsPaths=coverage.xml - sonar.verbose=true + sonar.cs.opencover.reportsPaths=coverage.opencover.xml - task: CmdLine@2 From 709187be6feac9ac1a9d205eff8eb88df0656db2 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 09:11:46 -0300 Subject: [PATCH 146/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 574e12e..96d5799 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -22,7 +22,7 @@ steps: #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml - sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/tests/*/coverage.opencover.xml + sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/**/coverage.opencover.xml sonar.cs.opencover.reportsPaths=coverage.opencover.xml From 0b0792f3867f2dbd64817210eef08b99994c80f0 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 09:11:54 -0300 Subject: [PATCH 147/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 96d5799..6912691 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -22,7 +22,7 @@ steps: #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml - sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/**/coverage.opencover.xml + sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/tests/AzureDevopsTracker.Tests/coverage.opencover.xml sonar.cs.opencover.reportsPaths=coverage.opencover.xml From 84eab9aa7fb707bd506ae92f085dc224a4b20e86 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 09:15:41 -0300 Subject: [PATCH 148/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 6912691..153027e 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -22,7 +22,7 @@ steps: #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml - sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)/tests/AzureDevopsTracker.Tests/coverage.opencover.xml + sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/tests/AzureDevopsTracker.Tests/coverage.opencover.xml sonar.cs.opencover.reportsPaths=coverage.opencover.xml From 8b7869b434574fe86c01ef3cef3272fcca7f0808 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 09:22:39 -0300 Subject: [PATCH 149/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 153027e..0278296 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -23,6 +23,7 @@ steps: #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/tests/AzureDevopsTracker.Tests/coverage.opencover.xml + sonar.coverageReportPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml sonar.cs.opencover.reportsPaths=coverage.opencover.xml From bf475bdf28e2fb40d7ac96ccb635f94b627c2097 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 09:26:54 -0300 Subject: [PATCH 150/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 0278296..47d2fa5 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -23,7 +23,7 @@ steps: #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/tests/AzureDevopsTracker.Tests/coverage.opencover.xml - sonar.coverageReportPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml + sonar.coverageReportPaths=$(Build.SourcesDirectory)/tests/AzureDevopsTracker.Tests/coverage.opencover.xml sonar.cs.opencover.reportsPaths=coverage.opencover.xml From 65727dae559ad2c4e8b872922e751052804c3bb2 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:05:01 -0300 Subject: [PATCH 151/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 47d2fa5..4b58171 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -22,9 +22,9 @@ steps: #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml - sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/tests/AzureDevopsTracker.Tests/coverage.opencover.xml + #sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/tests/AzureDevopsTracker.Tests/coverage.opencover.xml sonar.coverageReportPaths=$(Build.SourcesDirectory)/tests/AzureDevopsTracker.Tests/coverage.opencover.xml - sonar.cs.opencover.reportsPaths=coverage.opencover.xml + #sonar.cs.opencover.reportsPaths=coverage.opencover.xml - task: CmdLine@2 @@ -37,26 +37,26 @@ steps: script: dotnet build --no-incremental displayName: 'Rodando dotnet build' -- script: 'dotnet tool install --global coverlet.console' - displayName: 'Install coverlet global tool' +#- script: 'dotnet tool install --global coverlet.console' +# displayName: 'Install coverlet global tool' - task: DotNetCoreCLI@2 displayName: 'Rodando dotnet test' inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:CoverletOutputFormat="opencover,cobertura" /p:Exclude=[xunit.*]*' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' -- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.opencover.xml" - displayName: 'Run coverlet' +#- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.opencover.xml" +# displayName: 'Run coverlet' -- task: PublishTestResults@2 - inputs: - testResultsFormat: 'VSTest' - testResultsFiles: '$(Agent.TempDirectory)/**.*trx' +#- task: PublishTestResults@2 +# inputs: +# testResultsFormat: 'VSTest' +# testResultsFiles: '$(Agent.TempDirectory)/**.*trx' #- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 # displayName: ReportGenerator From 6b021d20a2ebba88f4f14c31f4eb50e9fc498c57 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:07:12 -0300 Subject: [PATCH 152/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 4b58171..cc2218d 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -45,7 +45,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:CoverletOutputFormat="opencover,cobertura" /p:Exclude=[xunit.*]*' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat="opencover,cobertura" --collect "Code Coverage" /p:Exclude=[xunit.*]*' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' From f055828c81b17d692b225131141eab7ac6f1ab88 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:08:37 -0300 Subject: [PATCH 153/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index cc2218d..75e040b 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -45,7 +45,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat="opencover,cobertura" --collect "Code Coverage" /p:Exclude=[xunit.*]*' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=\"opencover,cobertura\" --collect "Code Coverage" /p:Exclude=[xunit.*]*' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' From 2c14e660b32fa93c3a7acb4ccad7739243ddd973 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:10:14 -0300 Subject: [PATCH 154/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 75e040b..06c0219 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -45,7 +45,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=\"opencover,cobertura\" --collect "Code Coverage" /p:Exclude=[xunit.*]*' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]*' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' From 660111ae233155e05e3f237f120518b583410406 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:18:06 -0300 Subject: [PATCH 155/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 06c0219..a2ebf0e 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -23,7 +23,10 @@ steps: #sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx #sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml #sonar.cs.vscoveragexml.reportsPaths=$(Build.SourcesDirectory)/tests/AzureDevopsTracker.Tests/coverage.opencover.xml - sonar.coverageReportPaths=$(Build.SourcesDirectory)/tests/AzureDevopsTracker.Tests/coverage.opencover.xml + #sonar.coverageReportPaths=$(Build.SourcesDirectory)/tests/AzureDevopsTracker.Tests/coverage.opencover.xml + sonar.exclusions=**/obj/**,**/*.dll + sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/coverage.opencover.xml + sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx #sonar.cs.opencover.reportsPaths=coverage.opencover.xml @@ -45,7 +48,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]*' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=\"cobertura,opencover\" --collect "Code Coverage" /p:Exclude=[xunit.*]*' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' @@ -66,11 +69,14 @@ steps: # reporttypes: 'SonarQube' # assemblyfilters: '-xunit\*' -#- task: PublishCodeCoverageResults@1 -# displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverage.xml' -# inputs: -# codeCoverageTool: Cobertura -# summaryFileLocation: '$(Build.SourcesDirectory)/coverage.xml' +- task: PublishCodeCoverageResults@1 + displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverage.xml' + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: $(Agent.TempDirectory)/**/coverage.cobertura.xml + pathToSources: $(BuildParameters.pathToSources) + reportDirectory: $(build.artifactstagingdirectory)/Coverage/ + failIfCoverageEmpty: true - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 42c568c9960077870b9e727ee1c2e338ca3fedf8 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:21:26 -0300 Subject: [PATCH 156/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index a2ebf0e..ea7ad91 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -48,7 +48,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=\"cobertura,opencover\" --collect "Code Coverage" /p:Exclude=[xunit.*]*' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]*' #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' From 79365477e60ebbfd5d279a37ca1ae513dab1f707 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:25:13 -0300 Subject: [PATCH 157/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index ea7ad91..0d9a2df 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -70,9 +70,9 @@ steps: # assemblyfilters: '-xunit\*' - task: PublishCodeCoverageResults@1 - displayName: 'Publish code coverage from $(Build.SourcesDirectory)/coverage.xml' + displayName: Publish code coverage inputs: - codeCoverageTool: Cobertura + codeCoverageTool: Opencover summaryFileLocation: $(Agent.TempDirectory)/**/coverage.cobertura.xml pathToSources: $(BuildParameters.pathToSources) reportDirectory: $(build.artifactstagingdirectory)/Coverage/ From bd648d3c255de2e245273f37bd53582faf4ba486 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:27:35 -0300 Subject: [PATCH 158/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 0d9a2df..f54afaf 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -73,7 +73,7 @@ steps: displayName: Publish code coverage inputs: codeCoverageTool: Opencover - summaryFileLocation: $(Agent.TempDirectory)/**/coverage.cobertura.xml + summaryFileLocation: $(Agent.TempDirectory)/**/coverage.opencover.xml pathToSources: $(BuildParameters.pathToSources) reportDirectory: $(build.artifactstagingdirectory)/Coverage/ failIfCoverageEmpty: true From 479252ab0902e8f7c3dd7ea8f0054d76ed2c27d7 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:30:45 -0300 Subject: [PATCH 159/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index f54afaf..010bf90 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -40,8 +40,8 @@ steps: script: dotnet build --no-incremental displayName: 'Rodando dotnet build' -#- script: 'dotnet tool install --global coverlet.console' -# displayName: 'Install coverlet global tool' +- script: 'dotnet tool install --global coverlet.console' + displayName: 'Install coverlet global tool' - task: DotNetCoreCLI@2 displayName: 'Rodando dotnet test' @@ -53,8 +53,8 @@ steps: #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' -#- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.opencover.xml" -# displayName: 'Run coverlet' +- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.opencover.xml" + displayName: 'Run coverlet' #- task: PublishTestResults@2 # inputs: From 15fcbf97af379a8305186c8996b50b5da3677b7b Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:35:31 -0300 Subject: [PATCH 160/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 010bf90..3744bcb 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -69,14 +69,14 @@ steps: # reporttypes: 'SonarQube' # assemblyfilters: '-xunit\*' -- task: PublishCodeCoverageResults@1 - displayName: Publish code coverage - inputs: - codeCoverageTool: Opencover - summaryFileLocation: $(Agent.TempDirectory)/**/coverage.opencover.xml - pathToSources: $(BuildParameters.pathToSources) - reportDirectory: $(build.artifactstagingdirectory)/Coverage/ - failIfCoverageEmpty: true +#- task: PublishCodeCoverageResults@1 +# displayName: Publish code coverage +# inputs: +# codeCoverageTool: Opencover +# summaryFileLocation: $(Agent.TempDirectory)/**/coverage.opencover.xml +# pathToSources: $(BuildParameters.pathToSources) +# reportDirectory: $(build.artifactstagingdirectory)/Coverage/ +# failIfCoverageEmpty: true - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From f3d20d5c0e228dbe607d384fde290846bcc4b2a2 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:35:43 -0300 Subject: [PATCH 161/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 3744bcb..1c4cde1 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -53,8 +53,8 @@ steps: #- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' # displayName: 'Create reports' -- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.opencover.xml" - displayName: 'Run coverlet' +#- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.opencover.xml" +# displayName: 'Run coverlet' #- task: PublishTestResults@2 # inputs: From e0acc97667b3b22ed2ef8341ee5c5d2fddca726d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:42:44 -0300 Subject: [PATCH 162/189] Updating --- adt_pull_request.yml | 53 ++++--------------- .../AzureDevopsTracker.Tests.csproj | 8 +-- 2 files changed, 13 insertions(+), 48 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 8b2f749..3767fc7 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -10,21 +10,14 @@ steps: organization: typinghard projectKey: 'typinghard_azure-devops-tracker' extraProperties: | - # Additional properties that will be passed to the scanner, - # Put one key=value per line, example: - # sonar.exclusions=**/*.bin - #sonar.coverageReportPaths=$(Agent.TempDirectory)/**/*.trx - #sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/*.trx - #sonar.coverageReportPaths=$(Agent.TempDirectory)/reports/SonarQube.xml - #sonar.cs.dotcover.reportsPaths=$(Agent.TempDirectory)/reports/DetailedXML.xml - sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml - sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/**/*.trx - sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)\**\*.trx - sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\**\*.trx - sonar.cs.vscoveragexml.reportsPaths=$(Agent.TempDirectory)\**\*.coveragexml - sonar.cs.vscoveragexml.reportsPaths=coverage.xml - sonar.cs.opencover.reportsPaths=coverage.xml - sonar.verbose=true + sonar.exclusions=**/obj/**,**/*.dll + sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/coverage.opencover.xml + sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx + +- task: CmdLine@2 + inputs: + script: dotnet restore + displayName: 'Rodando dotnet restore' - task: CmdLine@2 inputs: @@ -36,35 +29,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage"' - -- script: 'dotnet tool install --global coverlet.console' - displayName: 'Install coverlet global tool' - -#- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"' -# displayName: 'Create reports' - -- script: coverlet *.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.xml" - displayName: 'Run coverlet' - -- task: PublishTestResults@2 - inputs: - testResultsFormat: 'VSTest' - testResultsFiles: '$(Agent.TempDirectory)/**.*trx' - -#- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@5 -# displayName: ReportGenerator -# inputs: -# reports: '$(Agent.TempDirectory)/coverage.cobertura.xml' -# targetdir: '$(Build.SourcesDirectory)/reports' -# reporttypes: 'SonarQube' -# assemblyfilters: '-xunit\*' - -#- task: PublishCodeCoverageResults@1 -# displayName: 'Publish code coverage from $(Build.SourcesDirectory)/reports/coverage.cobertura.xml' -# inputs: -# codeCoverageTool: Cobertura -# summaryFileLocation: '$(Build.SourcesDirectory)/reports/Cobertura.xml' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]*' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' diff --git a/tests/AzureDevopsTracker.Tests/AzureDevopsTracker.Tests.csproj b/tests/AzureDevopsTracker.Tests/AzureDevopsTracker.Tests.csproj index 4167967..bb3bd0a 100644 --- a/tests/AzureDevopsTracker.Tests/AzureDevopsTracker.Tests.csproj +++ b/tests/AzureDevopsTracker.Tests/AzureDevopsTracker.Tests.csproj @@ -9,14 +9,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all From 26134a4ea9e481c4465d7c8899de0192217c7227 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:43:56 -0300 Subject: [PATCH 163/189] Updating --- adt_pull_request.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 3767fc7..21b2dcf 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -17,15 +17,15 @@ steps: - task: CmdLine@2 inputs: script: dotnet restore - displayName: 'Rodando dotnet restore' + displayName: 'Run dotnet restore' - task: CmdLine@2 inputs: script: dotnet build --no-incremental - displayName: 'Rodando dotnet build' + displayName: 'Run dotnet build' - task: DotNetCoreCLI@2 - displayName: 'Rodando dotnet test' + displayName: 'Run dotnet test' inputs: command: test projects: '**/*[Tt]ests/*.csproj' From e20e296bc0bdbc3325935b7454e430ed41bdb1b5 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:55:20 -0300 Subject: [PATCH 164/189] Updating --- adt_pull_request.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index 32668b7..fc2c94b 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -11,7 +11,8 @@ steps: projectKey: 'typinghard_azure-devops-tracker' extraProperties: | sonar.exclusions=**/obj/**,**/*.dll - sonar.cs.opencover.reportsPaths=$(Agent.TempDirectory)/**/coverage.opencover.xml + sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml + sonar.cs.vscoveragexml.reportsPaths=**/coverage.opencover.xml sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx - task: CmdLine@2 From 534d4f0a5e54f0cb19aea15fff2e62bbdb50a471 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 12:58:48 -0300 Subject: [PATCH 165/189] Updating --- adt_pull_request.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index fc2c94b..b8bbb60 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -25,9 +25,6 @@ steps: script: dotnet build --no-incremental displayName: 'Run dotnet build' -- script: 'dotnet tool install --global coverlet.console' - displayName: 'Install coverlet global tool' - - task: DotNetCoreCLI@2 displayName: 'Run dotnet test' inputs: From c22406720c8bce038f16b352fdb2947ea037f07d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 14:14:32 -0300 Subject: [PATCH 166/189] Renamed yml file --- adt_pull_request.yml => azure_pull_request.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) rename adt_pull_request.yml => azure_pull_request.yml (92%) diff --git a/adt_pull_request.yml b/azure_pull_request.yml similarity index 92% rename from adt_pull_request.yml rename to azure_pull_request.yml index b8bbb60..c607e23 100644 --- a/adt_pull_request.yml +++ b/azure_pull_request.yml @@ -2,6 +2,10 @@ pool: name: Azure Pipelines demands: java +variables: + buildConfiguration: 'Release' + prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] + steps: - task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 displayName: 'Prepare analysis on SonarCloud' @@ -15,11 +19,6 @@ steps: sonar.cs.vscoveragexml.reportsPaths=**/coverage.opencover.xml sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx -- task: CmdLine@2 - inputs: - script: dotnet restore - displayName: 'Run dotnet restore' - - task: CmdLine@2 inputs: script: dotnet build --no-incremental From 23d5280bb9b1b17d1f1623b3633458f2de83486b Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 2 Sep 2022 14:19:28 -0300 Subject: [PATCH 167/189] Update adt_pull_request.yml for Azure Pipelines --- adt_pull_request.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/adt_pull_request.yml b/adt_pull_request.yml index b8bbb60..fef1f10 100644 --- a/adt_pull_request.yml +++ b/adt_pull_request.yml @@ -2,6 +2,10 @@ pool: name: Azure Pipelines demands: java +variables: + buildConfiguration: 'Release' + prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] + steps: - task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 displayName: 'Prepare analysis on SonarCloud' From af88f32695351525ead7a972c794e8e0ed9fbfc0 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 13 Oct 2022 18:47:36 -0300 Subject: [PATCH 168/189] Update azure_pull_request.yml for Azure Pipelines --- azure_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index c607e23..8c59c81 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -29,7 +29,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]*' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* --no-build --no-restore' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 4af0968a2ad94599079f37465028f283e81907a7 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 13 Oct 2022 18:50:13 -0300 Subject: [PATCH 169/189] Update azure_pull_request.yml for Azure Pipelines --- azure_pull_request.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index 8c59c81..ca07893 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -22,14 +22,19 @@ steps: - task: CmdLine@2 inputs: script: dotnet build --no-incremental - displayName: 'Run dotnet build' + displayName: 'Run Build' -- task: DotNetCoreCLI@2 - displayName: 'Run dotnet test' +- task: CmdLine@2 inputs: - command: test - projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* --no-build --no-restore' + script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* --no-build --no-restore + displayName: 'Run Tests' + +# - task: DotNetCoreCLI@2 +# displayName: 'Run dotnet test' +# inputs: +# command: test +# projects: '**/*[Tt]ests/*.csproj' +# arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* --no-build --no-restore' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 1b61f2edac0f8590d33b621af9658b14b68d3f3b Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 13 Oct 2022 18:52:12 -0300 Subject: [PATCH 170/189] Update azure_pull_request.yml for Azure Pipelines --- azure_pull_request.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index ca07893..c284866 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -24,17 +24,12 @@ steps: script: dotnet build --no-incremental displayName: 'Run Build' -- task: CmdLine@2 +- task: DotNetCoreCLI@2 + displayName: 'Run dotnet test' inputs: - script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* --no-build --no-restore - displayName: 'Run Tests' - -# - task: DotNetCoreCLI@2 -# displayName: 'Run dotnet test' -# inputs: -# command: test -# projects: '**/*[Tt]ests/*.csproj' -# arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* --no-build --no-restore' + command: test + projects: '**/*[Tt]ests/*.csproj' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]*' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 1b6118c97c96cd0a95c37154b91649c4c5b252ec Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Wed, 26 Oct 2022 14:26:26 -0300 Subject: [PATCH 171/189] Update azure_pull_request.yml for Azure Pipelines --- azure_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index c284866..31471c6 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -29,7 +29,7 @@ steps: inputs: command: test projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]*' + arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]*' --no-restore --no-build - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 86b49756cf73d6b3082c33bf5bf7a27aeb1b580c Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Wed, 26 Oct 2022 14:30:30 -0300 Subject: [PATCH 172/189] Update azure_pull_request.yml for Azure Pipelines --- azure_pull_request.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index 31471c6..81d6ff8 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -24,12 +24,10 @@ steps: script: dotnet build --no-incremental displayName: 'Run Build' -- task: DotNetCoreCLI@2 - displayName: 'Run dotnet test' +- task: CmdLine@2 inputs: - command: test - projects: '**/*[Tt]ests/*.csproj' - arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]*' --no-restore --no-build + script: --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* --no-restore --no-build + displayName: 'Run Tests' - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 2576110a9f2e9611775bb7370734897b1fbcdb29 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Wed, 26 Oct 2022 14:33:47 -0300 Subject: [PATCH 173/189] Update azure_pull_request.yml for Azure Pipelines --- azure_pull_request.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index 81d6ff8..ad6bf53 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -1,4 +1,5 @@ pool: + vmImage: ubuntu-latest name: Azure Pipelines demands: java @@ -20,14 +21,14 @@ steps: sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx - task: CmdLine@2 + displayName: 'Run Build' inputs: script: dotnet build --no-incremental - displayName: 'Run Build' - task: CmdLine@2 - inputs: - script: --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* --no-restore --no-build displayName: 'Run Tests' + inputs: + script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* --no-restore --no-build - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 4256584857682f5974b08dec430fd6278f637fef Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Wed, 26 Oct 2022 14:35:41 -0300 Subject: [PATCH 174/189] Update azure_pull_request.yml for Azure Pipelines --- azure_pull_request.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index ad6bf53..03d63c7 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -21,14 +21,9 @@ steps: sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx - task: CmdLine@2 - displayName: 'Run Build' inputs: - script: dotnet build --no-incremental - -- task: CmdLine@2 + script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* displayName: 'Run Tests' - inputs: - script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* --no-restore --no-build - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 886eee8930a7a24247a1487d0333d222df59d73e Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Thu, 27 Oct 2022 17:35:02 -0300 Subject: [PATCH 175/189] Updating WorkItem.cs and HelperExtensions.cs --- src/Entities/WorkItem.cs | 2 +- src/Extensions/HelperExtenions.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Entities/WorkItem.cs b/src/Entities/WorkItem.cs index 03db258..7a705cc 100644 --- a/src/Entities/WorkItem.cs +++ b/src/Entities/WorkItem.cs @@ -95,7 +95,7 @@ public void AddTimeByState(TimeByState timeByState) public void AddTimesByState(IEnumerable timesByState) { - if (timesByState is not null && !timesByState.Any()) + if (timesByState is null || timesByState?.Any() == false) return; foreach (var timeByState in timesByState) diff --git a/src/Extensions/HelperExtenions.cs b/src/Extensions/HelperExtenions.cs index f4a5859..a233420 100644 --- a/src/Extensions/HelperExtenions.cs +++ b/src/Extensions/HelperExtenions.cs @@ -22,10 +22,10 @@ public static string ExtractEmail(this string user) if (user is null) return user; - if (!user.Contains(" <") && !user.TrimEnd().Contains(">")) + if (!user.Contains(" <") && !user.TrimEnd().Contains('>')) return user; - return user.Split("<").LastOrDefault().Split(">").FirstOrDefault(); + return user.Split('<').LastOrDefault()?.Split('>')?.FirstOrDefault(); } public static string ToTextTime(this TimeSpan timeSpan) From 09b386e68f491fd7431223c634900c362d71a28d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Wed, 23 Aug 2023 18:59:04 -0300 Subject: [PATCH 176/189] Update azure_pull_request.yml --- azure_pull_request.yml | 61 +++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index 03d63c7..d86fd15 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -3,30 +3,41 @@ pool: name: Azure Pipelines demands: java -variables: - buildConfiguration: 'Release' - prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] +trigger: + branches: + include: + - dev + - version-5 + - 6.0.0 + - 7.0.0 + exclude: + - '*' -steps: -- task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 - displayName: 'Prepare analysis on SonarCloud' - inputs: - SonarCloud: 'SonarCloud-ADT' - organization: typinghard - projectKey: 'typinghard_azure-devops-tracker' - extraProperties: | - sonar.exclusions=**/obj/**,**/*.dll - sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml - sonar.cs.vscoveragexml.reportsPaths=**/coverage.opencover.xml - sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx +pr: + variables: + buildConfiguration: 'Release' + prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] -- task: CmdLine@2 - inputs: - script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* - displayName: 'Run Tests' - -- task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 - displayName: 'Run Code Analysis' - -- task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1 - displayName: 'Publish Quality Gate Result' \ No newline at end of file + steps: + - task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 + displayName: 'Prepare analysis on SonarCloud' + inputs: + SonarCloud: 'SonarCloud-ADT' + organization: typinghard + projectKey: 'typinghard_azure-devops-tracker' + extraProperties: | + sonar.exclusions=**/obj/**,**/*.dll + sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml + sonar.cs.vscoveragexml.reportsPaths=**/coverage.opencover.xml + sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx + + - task: CmdLine@2 + inputs: + script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* + displayName: 'Run Tests' + + - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 + displayName: 'Run Code Analysis' + + - task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1 + displayName: 'Publish Quality Gate Result' From f93b0864d9ce4ad692746d15dab9399308345ac4 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 29 Mar 2024 17:07:42 -0300 Subject: [PATCH 177/189] Update (#20) * Update --- src/Adapters/WorkItemAdapter.cs | 8 ++-- src/AzureDevopsTracker.csproj | 20 ++++----- src/Configurations/Configuration.cs | 17 ++++++- src/Data/ChangeLogItemRepository.cs | 10 +++-- src/Data/ChangeLogRepository.cs | 7 +-- src/Data/Repository.cs | 1 + src/Entities/ChangeLogItem.cs | 2 +- src/Entities/WorkItem.cs | 4 +- src/Entities/WorkItemChange.cs | 2 +- src/Integrations/DiscordIntegration.cs | 7 +-- src/Integrations/FakeIntegration.cs | 3 +- src/Integrations/MessageFacade.cs | 5 ++- src/Integrations/MessageIntegration.cs | 23 +++++----- src/Integrations/MicrosoftTeamsIntegration.cs | 15 ++++--- src/Interfaces/IChangeLogService.cs | 7 +-- .../Internals/IChangeLogItemRepository.cs | 5 ++- .../Internals/IChangeLogRepository.cs | 3 +- src/Services/AzureDevopsTrackerService.cs | 44 +++++++++---------- src/Services/ChangeLogService.cs | 23 +++++----- tests/AzureDevopsTracker.Tests/Usings.cs | 4 +- 20 files changed, 119 insertions(+), 91 deletions(-) diff --git a/src/Adapters/WorkItemAdapter.cs b/src/Adapters/WorkItemAdapter.cs index a7598ac..b56aa17 100644 --- a/src/Adapters/WorkItemAdapter.cs +++ b/src/Adapters/WorkItemAdapter.cs @@ -51,7 +51,7 @@ public List ToWorkItemsDto(List workItems) .ToList(); } - public WorkItemChangeDto ToWorkItemChangeDto(WorkItemChange workIteChange) + public static WorkItemChangeDto ToWorkItemChangeDto(WorkItemChange workIteChange) { if (workIteChange is null) return null; @@ -65,7 +65,7 @@ public WorkItemChangeDto ToWorkItemChangeDto(WorkItemChange workIteChange) }; } - public List ToWorkItemsChangeDto(List workItemsChanges) + public static List ToWorkItemsChangeDto(List workItemsChanges) { var workItemsChangeDto = new List(); @@ -80,7 +80,7 @@ public List ToWorkItemsChangeDto(List workIte .ToList(); } - public TimeByStateDto ToTimeByStateDto(TimeByState workItemStatusTime) + public static TimeByStateDto ToTimeByStateDto(TimeByState workItemStatusTime) { if (workItemStatusTime is null) return null; @@ -93,7 +93,7 @@ public TimeByStateDto ToTimeByStateDto(TimeByState workItemStatusTime) }; } - public List ToTimeByStatesDto(List workItemStatusTimes) + public static List ToTimeByStatesDto(List workItemStatusTimes) { var workItemStatusTimeDto = new List(); diff --git a/src/AzureDevopsTracker.csproj b/src/AzureDevopsTracker.csproj index aa7c3b4..1e967cd 100644 --- a/src/AzureDevopsTracker.csproj +++ b/src/AzureDevopsTracker.csproj @@ -2,7 +2,7 @@ net5.0 - False + True AzureDevOpsTracker Elvis Souza | Diego Galante TypingHard @@ -18,11 +18,18 @@ LICENSE.md.txt A NuGet that allows you to use a Azure DevOps Service Hook to track workitems changes in a simply and detailed way. 5.0.0.0 - 5.0.5 - 5.0.5 + 5.0.6 + 5.0.6 Add ChangeLog Feature + + + True + + + + @@ -30,13 +37,6 @@ - - - True - - - - True diff --git a/src/Configurations/Configuration.cs b/src/Configurations/Configuration.cs index c9adcd0..cafa106 100644 --- a/src/Configurations/Configuration.cs +++ b/src/Configurations/Configuration.cs @@ -10,16 +10,31 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using System; +using System.Linq; namespace AzureDevopsTracker.Configurations { public static class Configuration { - public static IServiceCollection AddAzureDevopsTracker(this IServiceCollection services, DataBaseConfig configurations, MessageConfig messageConfig = null) + public static IServiceCollection AddAzureDevopsTracker(this IServiceCollection services, + DataBaseConfig configurations, + MessageConfig messageConfig = null) { services.AddDbContext(options => options.UseSqlServer(DataBaseConfig.ConnectionsString)); + try + { + using var serviceScope = services.BuildServiceProvider().CreateScope(); + var dbContext = serviceScope.ServiceProvider.GetRequiredService(); + + var pendingMigrations = dbContext.Database.GetPendingMigrations(); + if (pendingMigrations.Any()) + dbContext.Database.Migrate(); + } + catch + { } + services.AddMessageIntegrations(); services.AddSingleton(); diff --git a/src/Data/ChangeLogItemRepository.cs b/src/Data/ChangeLogItemRepository.cs index b4b0939..02d3746 100644 --- a/src/Data/ChangeLogItemRepository.cs +++ b/src/Data/ChangeLogItemRepository.cs @@ -1,8 +1,10 @@ using AzureDevopsTracker.Data.Context; using AzureDevopsTracker.Entities; using AzureDevopsTracker.Interfaces.Internals; +using Microsoft.EntityFrameworkCore; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; namespace AzureDevopsTracker.Data { @@ -10,14 +12,14 @@ internal class ChangeLogItemRepository : Repository, IChangeLogIt { public ChangeLogItemRepository(AzureDevopsTrackerContext context) : base(context) { } - public int CountItemsForRelease() + public async Task CountItemsForRelease() { - return DbSet.Count(x => string.IsNullOrEmpty(x.ChangeLogId)); + return await DbSet.CountAsync(x => string.IsNullOrEmpty(x.ChangeLogId)); } - public IEnumerable ListWaitingForRelease() + public async Task> ListWaitingForRelease() { - return DbSet.Where(x => string.IsNullOrEmpty(x.ChangeLogId)); + return await DbSet.Where(x => string.IsNullOrEmpty(x.ChangeLogId)).ToListAsync(); } } } \ No newline at end of file diff --git a/src/Data/ChangeLogRepository.cs b/src/Data/ChangeLogRepository.cs index 503cbff..c12243a 100644 --- a/src/Data/ChangeLogRepository.cs +++ b/src/Data/ChangeLogRepository.cs @@ -1,8 +1,9 @@ using AzureDevopsTracker.Data.Context; using AzureDevopsTracker.Entities; using AzureDevopsTracker.Interfaces.Internals; +using Microsoft.EntityFrameworkCore; using System; -using System.Linq; +using System.Threading.Tasks; namespace AzureDevopsTracker.Data { @@ -10,9 +11,9 @@ internal class ChangeLogRepository : Repository, IChangeLogRepository { public ChangeLogRepository(AzureDevopsTrackerContext context) : base(context) { } - public int CountChangeLogsCreatedToday() + public async Task CountChangeLogsCreatedToday() { - return DbSet.Count(x => x.CreatedAt.Date == DateTime.Now.Date); + return await DbSet.CountAsync(x => x.CreatedAt.Date == DateTime.Now.Date); } } } \ No newline at end of file diff --git a/src/Data/Repository.cs b/src/Data/Repository.cs index 3bf46b4..693cac2 100644 --- a/src/Data/Repository.cs +++ b/src/Data/Repository.cs @@ -4,6 +4,7 @@ using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; namespace AzureDevopsTracker.Data diff --git a/src/Entities/ChangeLogItem.cs b/src/Entities/ChangeLogItem.cs index b572ffd..29aca95 100644 --- a/src/Entities/ChangeLogItem.cs +++ b/src/Entities/ChangeLogItem.cs @@ -10,7 +10,7 @@ public class ChangeLogItem : Entity public string Description { get; private set; } public string WorkItemType { get; private set; } public string ChangeLogId { get; private set; } - public bool WasReleased => string.IsNullOrEmpty(ChangeLogId?.Trim()); + public bool WasReleased => string.IsNullOrWhiteSpace(ChangeLogId); public ChangeLog ChangeLog { get; private set; } private ChangeLogItem() { } diff --git a/src/Entities/WorkItem.cs b/src/Entities/WorkItem.cs index 7a705cc..d77090b 100644 --- a/src/Entities/WorkItem.cs +++ b/src/Entities/WorkItem.cs @@ -142,7 +142,9 @@ public IEnumerable CalculateTotalTimeByState() if (!_workItemsChanges.Any()) return timesByStateList; - foreach (var workItemChange in _workItemsChanges.OrderBy(x => x.CreatedAt).GroupBy(x => x.OldState).Where(x => x.Key is not null)) + foreach (var workItemChange in _workItemsChanges.OrderBy(x => x.CreatedAt) + .GroupBy(x => x.OldState) + .Where(x => x.Key is not null)) { var totalTime = TimeSpan.Zero; var totalWorkedTime = TimeSpan.Zero; diff --git a/src/Entities/WorkItemChange.cs b/src/Entities/WorkItemChange.cs index a1f39fa..5b601ac 100644 --- a/src/Entities/WorkItemChange.cs +++ b/src/Entities/WorkItemChange.cs @@ -139,7 +139,7 @@ public double CalculateTotalWorkedTime() } #region Private Methods - private TimeSpan SubtractDates(DateTime biger, DateTime minor) + private static TimeSpan SubtractDates(DateTime biger, DateTime minor) { if (biger.Hour == minor.Hour) { diff --git a/src/Integrations/DiscordIntegration.cs b/src/Integrations/DiscordIntegration.cs index 16fe655..f3868f2 100644 --- a/src/Integrations/DiscordIntegration.cs +++ b/src/Integrations/DiscordIntegration.cs @@ -5,12 +5,13 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; namespace AzureDevopsTracker.Integrations { internal class DiscordIntegration : MessageIntegration { - internal override void Send(ChangeLog changeLog) + internal override async Task Send(ChangeLog changeLog) { var embedsDTO = new EmbedsDTO { @@ -26,7 +27,7 @@ internal override void Send(ChangeLog changeLog) }, }; - Notify(embedsDTO); + await Notify(embedsDTO); } public class EmbedsDTO @@ -97,7 +98,7 @@ public class Field public bool IsInline { get; set; } } - private IEnumerable GetText(ChangeLog changeLog) + private static IEnumerable GetText(ChangeLog changeLog) { var changeLogItemsAgrupado = changeLog.ChangeLogItems.GroupBy(d => d.WorkItemType); diff --git a/src/Integrations/FakeIntegration.cs b/src/Integrations/FakeIntegration.cs index f32fc57..68d3cfc 100644 --- a/src/Integrations/FakeIntegration.cs +++ b/src/Integrations/FakeIntegration.cs @@ -1,9 +1,10 @@ using AzureDevopsTracker.Entities; +using System.Threading.Tasks; namespace AzureDevopsTracker.Integrations { internal class FakeIntegration : MessageIntegration { - internal override void Send(ChangeLog changeLog) { } + internal override async Task Send(ChangeLog changeLog) { } } } diff --git a/src/Integrations/MessageFacade.cs b/src/Integrations/MessageFacade.cs index b41e5b8..a25f511 100644 --- a/src/Integrations/MessageFacade.cs +++ b/src/Integrations/MessageFacade.cs @@ -1,6 +1,7 @@ using AzureDevopsTracker.Entities; using Microsoft.Extensions.DependencyInjection; using System; +using System.Threading.Tasks; namespace AzureDevopsTracker.Integrations { @@ -14,14 +15,14 @@ public MessageFacade( _serviceScopeFactory = serviceScopeFactory; } - public void Send(ChangeLog changeLog) + public async Task Send(ChangeLog changeLog) { using var scope = _serviceScopeFactory.CreateScope(); var messageIntegration = scope.ServiceProvider.GetService(); if (messageIntegration is null) throw new Exception("Configure the MessageConfig in Startup to send changelog messages"); - messageIntegration.Send(changeLog); + await messageIntegration.Send(changeLog); } } } diff --git a/src/Integrations/MessageIntegration.cs b/src/Integrations/MessageIntegration.cs index 9bb9fa0..781cd81 100644 --- a/src/Integrations/MessageIntegration.cs +++ b/src/Integrations/MessageIntegration.cs @@ -2,59 +2,58 @@ using System; using System.Net.Http; using System.Text; +using System.Threading.Tasks; namespace AzureDevopsTracker.Integrations { public abstract class MessageIntegration { - internal abstract void Send(ChangeLog changeLog); + internal abstract Task Send(ChangeLog changeLog); private static readonly string MIMETYPE = "application/json"; private static readonly string CDN_URL = "https://cdn.typinghard.tech/"; private static readonly string MEGAFONE_GIF = "megafone.gif"; private static readonly string LOGO_TYPINGHARD_16X16 = "logo-typinghard-16x16.png"; - protected internal string GetTitle() + protected internal static string GetTitle() { return $"Nova atualização da plataforma"; } - protected internal string GetVersion(ChangeLog changeLog) + protected internal static string GetVersion(ChangeLog changeLog) { return $"Versão: {changeLog.Number}"; } - protected internal string GetAnnouncementImageUrl() + protected internal static string GetAnnouncementImageUrl() { return $"{CDN_URL}{MEGAFONE_GIF}"; } - protected internal string GetLogoTypingHard16x16Url() + protected internal static string GetLogoTypingHard16x16Url() { return $"{CDN_URL}{LOGO_TYPINGHARD_16X16}"; } - protected internal string GetFileVersion() + protected internal static string GetFileVersion() { System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); System.Diagnostics.FileVersionInfo fileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location); return fileVersionInfo.FileVersion; } - protected internal string GetNugetVersion() + protected internal static string GetNugetVersion() { return $"Powered by **Typing Hard** • nuget version {GetFileVersion()}"; } - protected internal HttpResponseMessage Notify(object body) + protected internal static async Task Notify(object body) { var json = Newtonsoft.Json.JsonConvert.SerializeObject(body); var content = new StringContent(json, Encoding.UTF8, MIMETYPE); - HttpClient client = new HttpClient(); - return client.PostAsync(new Uri(MessageConfig.URL), - content).Result; - + using HttpClient client = new(); + return await client.PostAsync(new Uri(MessageConfig.URL), content); } } } diff --git a/src/Integrations/MicrosoftTeamsIntegration.cs b/src/Integrations/MicrosoftTeamsIntegration.cs index 1933002..57af2f9 100644 --- a/src/Integrations/MicrosoftTeamsIntegration.cs +++ b/src/Integrations/MicrosoftTeamsIntegration.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Threading.Tasks; namespace AzureDevopsTracker.Integrations { @@ -38,7 +39,7 @@ internal static class MicrosoftTeamsStatics internal static readonly int CLOSING_DIV_SIZE = 6; } - internal override void Send(ChangeLog changeLog) + internal override async Task Send(ChangeLog changeLog) { var values = new MicrosoftTeamsMessage() { @@ -59,10 +60,10 @@ internal override void Send(ChangeLog changeLog) } }; - Notify(values); + await Notify(values); } - private string GetText(ChangeLog changeLog) + private static string GetText(ChangeLog changeLog) { if (changeLog is null || !changeLog.ChangeLogItems.Any()) return string.Empty; @@ -74,7 +75,7 @@ private string GetText(ChangeLog changeLog) return text.ToString(); } - private string GetWorkItemsDescriptionSection(string sectionName, IEnumerable changeLogItems) + private static string GetWorkItemsDescriptionSection(string sectionName, IEnumerable changeLogItems) { StringBuilder text = new(); if (!changeLogItems.Any()) return string.Empty; @@ -87,18 +88,18 @@ private string GetWorkItemsDescriptionSection(string sectionName, IEnumerable**{workItem.WorkItemId}** - {description}
"; } - private string GetDescription(string description) + private static string GetDescription(string description) { return description.Replace("
", "").Replace("
", "").Replace("
", ""); } - private string GetFooter() + private static string GetFooter() { return $"
{GetNugetVersion()}"; } diff --git a/src/Interfaces/IChangeLogService.cs b/src/Interfaces/IChangeLogService.cs index 3c97c16..e303353 100644 --- a/src/Interfaces/IChangeLogService.cs +++ b/src/Interfaces/IChangeLogService.cs @@ -1,11 +1,12 @@ using AzureDevopsTracker.Entities; +using System.Threading.Tasks; namespace AzureDevopsTracker.Interfaces { public interface IChangeLogService { - int CountItemsForRelease(); - ChangeLog Release(); - string SendToMessengers(ChangeLog changeLog); + Task CountItemsForRelease(); + Task Release(); + Task SendToMessengers(ChangeLog changeLog); } } \ No newline at end of file diff --git a/src/Interfaces/Internals/IChangeLogItemRepository.cs b/src/Interfaces/Internals/IChangeLogItemRepository.cs index 0fe8145..eca1cec 100644 --- a/src/Interfaces/Internals/IChangeLogItemRepository.cs +++ b/src/Interfaces/Internals/IChangeLogItemRepository.cs @@ -1,11 +1,12 @@ using AzureDevopsTracker.Entities; using System.Collections.Generic; +using System.Threading.Tasks; namespace AzureDevopsTracker.Interfaces.Internals { public interface IChangeLogItemRepository : IRepository { - int CountItemsForRelease(); - IEnumerable ListWaitingForRelease(); + Task CountItemsForRelease(); + Task> ListWaitingForRelease(); } } \ No newline at end of file diff --git a/src/Interfaces/Internals/IChangeLogRepository.cs b/src/Interfaces/Internals/IChangeLogRepository.cs index 07a8e15..05b0dae 100644 --- a/src/Interfaces/Internals/IChangeLogRepository.cs +++ b/src/Interfaces/Internals/IChangeLogRepository.cs @@ -1,9 +1,10 @@ using AzureDevopsTracker.Entities; +using System.Threading.Tasks; namespace AzureDevopsTracker.Interfaces.Internals { public interface IChangeLogRepository : IRepository { - int CountChangeLogsCreatedToday(); + Task CountChangeLogsCreatedToday(); } } \ No newline at end of file diff --git a/src/Services/AzureDevopsTrackerService.cs b/src/Services/AzureDevopsTrackerService.cs index 06ccd9f..5f40371 100644 --- a/src/Services/AzureDevopsTrackerService.cs +++ b/src/Services/AzureDevopsTrackerService.cs @@ -57,9 +57,9 @@ public async Task Create(CreateWorkItemDto create, bool addWorkItemChange = true if (addWorkItemChange) AddWorkItemChange(workItem, create); - CheckWorkItemAvailableToChangeLog(workItem, create.Resource.Fields); + await CheckWorkItemAvailableToChangeLog(workItem, create.Resource.Fields); - AddCustomFields(workItem); + await AddCustomFields(workItem); await _workItemRepository.Add(workItem); await _workItemRepository.SaveChangesAsync(); @@ -81,7 +81,7 @@ public async Task Create(string workItemId, Fields fields) public async Task Update(UpdatedWorkItemDto update) { - if (!_workItemRepository.Exist(update.Resource.WorkItemId).Result) + if (!await _workItemRepository.Exist(update.Resource.WorkItemId)) await Create(update.Resource.WorkItemId, update.Resource.Revision.Fields); var workItem = await _workItemRepository.GetByWorkItemId(update.Resource.WorkItemId); @@ -104,9 +104,9 @@ public async Task Update(UpdatedWorkItemDto update) AddWorkItemChange(workItem, update); - CheckWorkItemAvailableToChangeLog(workItem, update.Resource.Revision.Fields); + await CheckWorkItemAvailableToChangeLog(workItem, update.Resource.Revision.Fields); - AddCustomFields(workItem); + await AddCustomFields(workItem); _workItemRepository.Update(workItem); await _workItemRepository.SaveChangesAsync(); @@ -114,7 +114,7 @@ public async Task Update(UpdatedWorkItemDto update) public async Task Delete(DeleteWorkItemDto delete) { - if (!_workItemRepository.Exist(delete.Resource.Id).Result) + if (!await _workItemRepository.Exist(delete.Resource.Id)) await Create(delete.Resource.Id, delete.Resource.Fields); var workItem = await _workItemRepository.GetByWorkItemId(delete.Resource.Id); @@ -137,7 +137,7 @@ public async Task Delete(DeleteWorkItemDto delete) delete.Resource.Fields.OriginalEstimate, delete.Resource.Fields.Activity); - AddCustomFields(workItem); + await AddCustomFields(workItem); _workItemRepository.Update(workItem); await _workItemRepository.SaveChangesAsync(); @@ -145,7 +145,7 @@ public async Task Delete(DeleteWorkItemDto delete) public async Task Restore(RestoreWorkItemDto restore) { - if (!_workItemRepository.Exist(restore.Resource.Id).Result) + if (!await _workItemRepository.Exist(restore.Resource.Id)) await Create(restore.Resource.Id, restore.Resource.Fields); var workItem = await _workItemRepository.GetByWorkItemId(restore.Resource.Id); @@ -168,7 +168,7 @@ public async Task Restore(RestoreWorkItemDto restore) restore.Resource.Fields.OriginalEstimate, restore.Resource.Fields.Activity); - AddCustomFields(workItem); + await AddCustomFields(workItem); _workItemRepository.Update(workItem); await _workItemRepository.SaveChangesAsync(); @@ -184,11 +184,11 @@ public async Task GetByWorkItemId(string workItemId) } #region Support Methods - public void AddCustomFields(WorkItem workItem) + public async Task AddCustomFields(WorkItem workItem) { try { - var jsonText = GetRequestBody(); + var jsonText = await GetRequestBody(); if (jsonText.IsNullOrEmpty()) return; @@ -202,7 +202,7 @@ public void AddCustomFields(WorkItem workItem) { } } - public string GetRequestBody() + public async Task GetRequestBody() { string corpo; var request = _httpContextAccessor?.HttpContext?.Request; @@ -212,13 +212,13 @@ public string GetRequestBody() leaveOpen: true)) { request.Body.Position = 0; - corpo = reader.ReadToEndAsync()?.Result; + corpo = await reader.ReadToEndAsync(); } return corpo; } - public WorkItemChange ToWorkItemChange( + public static WorkItemChange ToWorkItemChange( string workItemId, string changedBy, string iterationPath, DateTime newDate, string newState, string oldState = null, DateTime? oldDate = null) @@ -226,7 +226,7 @@ public WorkItemChange ToWorkItemChange( return new WorkItemChange(workItemId, changedBy.ExtractEmail(), iterationPath, newDate, newState, oldState, oldDate); } - public void AddWorkItemChange(WorkItem workItem, CreateWorkItemDto create) + public static void AddWorkItemChange(WorkItem workItem, CreateWorkItemDto create) { var workItemChange = ToWorkItemChange(workItem.Id, create.Resource.Fields.ChangedBy, @@ -275,13 +275,13 @@ public void RemoveTimeByStateFromDataBase(WorkItem workItem) _workItemRepository.RemoveAllTimeByState(workItem.TimeByStates.ToList()); } - public void CheckWorkItemAvailableToChangeLog(WorkItem workItem, Fields fields) + public async Task CheckWorkItemAvailableToChangeLog(WorkItem workItem, Fields fields) { if (workItem.CurrentStatus != "Closed" && workItem.LastStatus == "Closed" && workItem.ChangeLogItem is not null && !workItem.ChangeLogItem.WasReleased) - RemoveChangeLogItem(workItem); + await RemoveChangeLogItem(workItem); if (workItem.CurrentStatus != "Closed" || fields.ChangeLogDescription.IsNullOrEmpty()) @@ -293,7 +293,7 @@ workItem.ChangeLogItem is not null && workItem.ChangeLogItem.Update(workItem.Title, workItem.Type, fields.ChangeLogDescription); } - public bool CheckWorkItemChangeExists(WorkItem workItem, WorkItemChange newWorkItemChange) + public static bool CheckWorkItemChangeExists(WorkItem workItem, WorkItemChange newWorkItemChange) { return workItem.WorkItemsChanges.Any(x => x.NewDate == newWorkItemChange.NewDate && x.OldDate == newWorkItemChange.OldDate && @@ -304,18 +304,18 @@ public bool CheckWorkItemChangeExists(WorkItem workItem, WorkItemChange newWorkI x.TotalWorkedTime == newWorkItemChange.TotalWorkedTime); } - public ChangeLogItem ToChangeLogItem(WorkItem workItem, Fields fields) + public static ChangeLogItem ToChangeLogItem(WorkItem workItem, Fields fields) { return new ChangeLogItem(workItem.Id, workItem.Title, fields.ChangeLogDescription, workItem.Type); } - public void RemoveChangeLogItem(WorkItem workItem) + public async Task RemoveChangeLogItem(WorkItem workItem) { - var changeLogItem = _changeLogItemRepository.GetById(workItem.ChangeLogItem?.Id).Result; + var changeLogItem = await _changeLogItemRepository.GetById(workItem.ChangeLogItem?.Id); if (changeLogItem is not null) { _changeLogItemRepository.Delete(changeLogItem); - _changeLogItemRepository.SaveChangesAsync().Wait(); + await _changeLogItemRepository.SaveChangesAsync(); workItem.RemoveChangeLogItem(); } diff --git a/src/Services/ChangeLogService.cs b/src/Services/ChangeLogService.cs index baef4fa..7e097f5 100644 --- a/src/Services/ChangeLogService.cs +++ b/src/Services/ChangeLogService.cs @@ -5,6 +5,7 @@ using AzureDevopsTracker.Statics; using Microsoft.Extensions.Configuration; using System.Linq; +using System.Threading.Tasks; namespace AzureDevopsTracker.Services { @@ -27,37 +28,37 @@ public ChangeLogService( _messageIntegration = messageIntegration; } - public int CountItemsForRelease() + public async Task CountItemsForRelease() { - return _changeLogItemRepository.CountItemsForRelease(); + return await _changeLogItemRepository.CountItemsForRelease(); } - public ChangeLog Release() + public async Task Release() { - var changeLogItems = _changeLogItemRepository.ListWaitingForRelease(); + var changeLogItems = await _changeLogItemRepository.ListWaitingForRelease(); if (!changeLogItems.Any()) return null; - var changeLog = CreateChangeLog(); + var changeLog = await CreateChangeLog(); changeLog.AddChangeLogItems(changeLogItems); - _changeLogRepository.Add(changeLog).Wait(); - _changeLogRepository.SaveChangesAsync().Wait(); + await _changeLogRepository.Add(changeLog); + await _changeLogRepository.SaveChangesAsync(); return changeLog; } - public string SendToMessengers(ChangeLog changeLog) + public async Task SendToMessengers(ChangeLog changeLog) { - _messageIntegration.Send(changeLog); + await _messageIntegration.Send(changeLog); return $"The ChangeLog {changeLog.Number} was released."; } - private ChangeLog CreateChangeLog() + private async Task CreateChangeLog() { if (string.IsNullOrEmpty(_configuration[ConfigurationStatics.ADT_CHANGELOG_VERSION])) { - var changeLogsQuantity = _changeLogRepository.CountChangeLogsCreatedToday(); + var changeLogsQuantity = await _changeLogRepository.CountChangeLogsCreatedToday(); return new ChangeLog(changeLogsQuantity + 1); } return new ChangeLog(_configuration[ConfigurationStatics.ADT_CHANGELOG_VERSION]); diff --git a/tests/AzureDevopsTracker.Tests/Usings.cs b/tests/AzureDevopsTracker.Tests/Usings.cs index 209548e..9d6c592 100644 --- a/tests/AzureDevopsTracker.Tests/Usings.cs +++ b/tests/AzureDevopsTracker.Tests/Usings.cs @@ -1,3 +1,3 @@ -global using Xunit; global using AzureDevopsTracker.Entities; -global using FluentAssertions; \ No newline at end of file +global using FluentAssertions; +global using Xunit; From de285495e9e05d3f5a08b8953cb41a1114f88823 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 29 Mar 2024 17:19:37 -0300 Subject: [PATCH 178/189] Update azure_pull_request.yml --- azure_pull_request.yml | 61 +++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 36 deletions(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index d86fd15..a2d1813 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -3,41 +3,30 @@ pool: name: Azure Pipelines demands: java -trigger: - branches: - include: - - dev - - version-5 - - 6.0.0 - - 7.0.0 - exclude: - - '*' +variables: + buildConfiguration: 'Release' + prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] -pr: - variables: - buildConfiguration: 'Release' - prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] +steps: +- task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 + displayName: 'Prepare analysis on SonarCloud' + inputs: + SonarCloud: 'SonarCloud-ADT' + organization: typinghard + projectKey: 'typinghard_azure-devops-tracker' + extraProperties: | + sonar.exclusions=**/obj/**,**/*.dll + sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml + sonar.cs.vscoveragexml.reportsPaths=**/coverage.opencover.xml + sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx - steps: - - task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 - displayName: 'Prepare analysis on SonarCloud' - inputs: - SonarCloud: 'SonarCloud-ADT' - organization: typinghard - projectKey: 'typinghard_azure-devops-tracker' - extraProperties: | - sonar.exclusions=**/obj/**,**/*.dll - sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml - sonar.cs.vscoveragexml.reportsPaths=**/coverage.opencover.xml - sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx - - - task: CmdLine@2 - inputs: - script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* - displayName: 'Run Tests' - - - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 - displayName: 'Run Code Analysis' - - - task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1 - displayName: 'Publish Quality Gate Result' +- task: CmdLine@2 + inputs: + script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* + displayName: 'Run Tests' + +- task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 + displayName: 'Run Code Analysis' + +- task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1 + displayName: 'Publish Quality Gate Result' From 6035ccd280a25000bf4dff1fad3e8ebd011dde0e Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 29 Mar 2024 17:21:38 -0300 Subject: [PATCH 179/189] Update --- azure_pull_request.yml | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 azure_pull_request.yml diff --git a/azure_pull_request.yml b/azure_pull_request.yml deleted file mode 100644 index af0d682..0000000 --- a/azure_pull_request.yml +++ /dev/null @@ -1,35 +0,0 @@ -pool: - vmImage: ubuntu-latest - name: Azure Pipelines - demands: java - -variables: - buildConfiguration: 'Release' - prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] - -steps: -- task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 - displayName: 'Prepare analysis on SonarCloud' - inputs: - SonarCloud: 'SonarCloud-ADT' - organization: typinghard - projectKey: 'typinghard_azure-devops-tracker' - extraProperties: | - sonar.exclusions=**/obj/**,**/*.dll - sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml - sonar.cs.vscoveragexml.reportsPaths=**/coverage.opencover.xml - sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx - -- task: CmdLine@2 - inputs: - script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* - displayName: 'Run Tests' - -- task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 - displayName: 'Run Code Analysis' - -- task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1 - displayName: 'Publish Quality Gate Result' - -- script: 'dotnet publish --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory) --no-restore --no-build' - displayName: Publish \ No newline at end of file From 981d56ac8766d063056be77e527444cc7e3729d2 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 29 Mar 2024 17:30:05 -0300 Subject: [PATCH 180/189] Update azure_pull_request.yml for Azure Pipelines --- azure_pull_request.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index a2d1813..b8327af 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -8,6 +8,13 @@ variables: prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] steps: +- task: NuGetCommand@2 + displayName: 'NuGet restore' + inputs: + restoreSolution: AzureDevopsTracker.csproj + feedsToUse: config + nugetConfigPath: packages.config + - task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 displayName: 'Prepare analysis on SonarCloud' inputs: @@ -25,6 +32,11 @@ steps: script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* displayName: 'Run Tests' +- task: NuGetCommand@2 + displayName: 'NuGet pack' + inputs: + command: pack + - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From e15ecc28afd845ab110e1dc4a8aaeab9eb4f1386 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 29 Mar 2024 17:35:36 -0300 Subject: [PATCH 181/189] Update azure_pull_request.yml --- azure_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index b8327af..5f90b3d 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -11,7 +11,7 @@ steps: - task: NuGetCommand@2 displayName: 'NuGet restore' inputs: - restoreSolution: AzureDevopsTracker.csproj + restoreSolution: **/*.csproj feedsToUse: config nugetConfigPath: packages.config From b8b4e7f4c9056046036a8c9d2f5e66e72c68427f Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 29 Mar 2024 17:37:04 -0300 Subject: [PATCH 182/189] Update azure_pull_request.yml --- azure_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index 5f90b3d..6e68d34 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -11,7 +11,7 @@ steps: - task: NuGetCommand@2 displayName: 'NuGet restore' inputs: - restoreSolution: **/*.csproj + restoreSolution: **/AzureDevopsTracker.csproj feedsToUse: config nugetConfigPath: packages.config From f72c926ceca78b0b6b7a17632b120b9a52af11c8 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 29 Mar 2024 17:40:48 -0300 Subject: [PATCH 183/189] Update azure_pull_request.yml --- azure_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index 6e68d34..b7b6c76 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -11,7 +11,7 @@ steps: - task: NuGetCommand@2 displayName: 'NuGet restore' inputs: - restoreSolution: **/AzureDevopsTracker.csproj + restoreSolution: '**/*.csproj' feedsToUse: config nugetConfigPath: packages.config From e6d4aae6700374826b3c7f4f63ea4b4de8eec80d Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 29 Mar 2024 17:44:30 -0300 Subject: [PATCH 184/189] Update azure_pull_request.yml --- azure_pull_request.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index b7b6c76..046a46e 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -13,7 +13,6 @@ steps: inputs: restoreSolution: '**/*.csproj' feedsToUse: config - nugetConfigPath: packages.config - task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 displayName: 'Prepare analysis on SonarCloud' From b526c6bf25b5e309d28788cd31ff00863710ead0 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 29 Mar 2024 17:46:51 -0300 Subject: [PATCH 185/189] Update azure_pull_request.yml --- azure_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index 046a46e..f43040e 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -11,7 +11,7 @@ steps: - task: NuGetCommand@2 displayName: 'NuGet restore' inputs: - restoreSolution: '**/*.csproj' + restoreSolution: '**/AzureDevopsTracker.csproj' feedsToUse: config - task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 From 5a165d2d197cdf688152eb82d7586fc11d846101 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 29 Mar 2024 17:51:32 -0300 Subject: [PATCH 186/189] Update azure_pull_request.yml --- azure_pull_request.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index f43040e..9ed7712 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -8,12 +8,6 @@ variables: prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')] steps: -- task: NuGetCommand@2 - displayName: 'NuGet restore' - inputs: - restoreSolution: '**/AzureDevopsTracker.csproj' - feedsToUse: config - - task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1 displayName: 'Prepare analysis on SonarCloud' inputs: @@ -30,11 +24,6 @@ steps: inputs: script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* displayName: 'Run Tests' - -- task: NuGetCommand@2 - displayName: 'NuGet pack' - inputs: - command: pack - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From ba28cbee25fa8b68a4d65fbe6b24ac973a309210 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 29 Mar 2024 17:52:03 -0300 Subject: [PATCH 187/189] Update azure_pull_request.yml --- azure_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index 9ed7712..a2d1813 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -24,7 +24,7 @@ steps: inputs: script: dotnet test --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --collect "Code Coverage" /p:Exclude=[xunit.*]* displayName: 'Run Tests' - + - task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1 displayName: 'Run Code Analysis' From 753ef1438c4271b94b4379789c57a61c965d8780 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Fri, 29 Mar 2024 18:16:58 -0300 Subject: [PATCH 188/189] Update azure_pull_request.yml for Azure Pipelines --- azure_pull_request.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure_pull_request.yml b/azure_pull_request.yml index a2d1813..af0d682 100644 --- a/azure_pull_request.yml +++ b/azure_pull_request.yml @@ -30,3 +30,6 @@ steps: - task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1 displayName: 'Publish Quality Gate Result' + +- script: 'dotnet publish --configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory) --no-restore --no-build' + displayName: Publish \ No newline at end of file From 22019f0e559e176cb3623cee49ca850d1d49bfe5 Mon Sep 17 00:00:00 2001 From: Diego Galante Date: Sat, 30 Mar 2024 10:36:59 -0300 Subject: [PATCH 189/189] Update Usings.cs