From 80508f3baeb111727ae841e13e3d6f9e48b91ce6 Mon Sep 17 00:00:00 2001 From: Nathan Bowes Date: Wed, 6 May 2020 08:41:28 +0100 Subject: [PATCH 1/2] Setup Sonarcloud --- README.md | 4 ++++ azure-pipelines.yml | 28 ++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 70806726..9b6501a2 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,10 @@ ![Build Status](https://sfa-gov-uk.visualstudio.com/Digital%20Apprenticeship%20Service/_apis/build/status/Manage%20Funding/das-reservations-api?branchName=master) +## Sonar Cloud Status + +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=SkillsFundingAgency_das-reservations-api&metric=alert_status)](https://sonarcloud.io/dashboard?id=SkillsFundingAgency_das-reservations-api) + ## Requirements DotNet Core 2.2 and any supported IDE for DEV running. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3c624333..d44d3db4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,11 +4,14 @@ trigger: include: - "*" -pr: none - variables: - buildConfiguration: 'release' - buildPlatform: 'anycpu' + - group: "ESFA - SonarCloud" + - name: sonarCloudProjectKey + value: "SkillsFundingAgency_das-reservations-api" + - name: buildConfiguration + value: 'release' + - name: buildPlatform + value: 'anycpu' resources: repositories: @@ -29,6 +32,15 @@ jobs: displayName: GitVersion inputs: updateAssemblyInfo: true + + - task: SonarCloudPrepare@1 + displayName: 'Prepare Sonarcloud analysis configuration' + inputs: + SonarCloud: "$(SonarCloudConnectionId)" + organization: "$(SonarCloudOrganisationKey)" + scannerMode: 'MSBuild' + projectName: "$(Build.DefinitionName)" + projectKey: "$(sonarCloudProjectKey)" - task: DotNetCoreCLI@2 displayName: Restore @@ -49,6 +61,14 @@ jobs: projects: '**/*.UnitTests.csproj' arguments: '--configuration $(buildConfiguration) --no-build' + - task: SonarCloudAnalyze@1 + displayName: 'Run SonarCloud analysis' + + - task: SonarCloudPublish@1 + displayName: 'Publish results on build summary' + inputs: + pollingTimeoutSec: '300' + - template: azure-pipelines-templates/dependency-check.yml@das-platform-building-blocks - task: DotNetCoreCLI@2 From 1dc61323f88d24002ec4df49a13c66089b1d3c34 Mon Sep 17 00:00:00 2001 From: Nathan Bowes Date: Wed, 6 May 2020 09:03:40 +0100 Subject: [PATCH 2/2] Add ProjectGuids --- .../SFA.DAS.Reservations.Api.AcceptanceTests.csproj | 2 +- .../SFA.DAS.Reservations.Api.UnitTests.csproj | 1 + src/SFA.DAS.Reservations.Api/SFA.DAS.Reservations.Api.csproj | 1 + .../SFA.DAS.Reservations.Application.UnitTests.csproj | 1 + .../SFA.DAS.Reservations.Application.csproj | 1 + .../SFA.DAS.Reservations.Data.UnitTests.csproj | 2 +- src/SFA.DAS.Reservations.Data/SFA.DAS.Reservations.Data.csproj | 1 + .../SFA.DAS.Reservations.Domain.UnitTests.csproj | 2 +- .../SFA.DAS.Reservations.Domain.csproj | 1 + .../SFA.DAS.Reservations.Infrastructure.UnitTests.csproj | 2 +- .../SFA.DAS.Reservations.Infrastructure.csproj | 1 + .../SFA.DAS.Reservations.Messages.csproj | 1 + .../SFA.DAS.Reservations.NServiceBusListener.csproj | 1 + 13 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/SFA.DAS.Reservations.Api.AcceptanceTests/SFA.DAS.Reservations.Api.AcceptanceTests.csproj b/src/SFA.DAS.Reservations.Api.AcceptanceTests/SFA.DAS.Reservations.Api.AcceptanceTests.csproj index d4154b38..bb244250 100644 --- a/src/SFA.DAS.Reservations.Api.AcceptanceTests/SFA.DAS.Reservations.Api.AcceptanceTests.csproj +++ b/src/SFA.DAS.Reservations.Api.AcceptanceTests/SFA.DAS.Reservations.Api.AcceptanceTests.csproj @@ -2,7 +2,7 @@ netcoreapp2.2 - + 2A4F0E8E-E58F-4608-BF0A-D80A598FB258 false diff --git a/src/SFA.DAS.Reservations.Api.UnitTests/SFA.DAS.Reservations.Api.UnitTests.csproj b/src/SFA.DAS.Reservations.Api.UnitTests/SFA.DAS.Reservations.Api.UnitTests.csproj index b160b2f0..d85efcb9 100644 --- a/src/SFA.DAS.Reservations.Api.UnitTests/SFA.DAS.Reservations.Api.UnitTests.csproj +++ b/src/SFA.DAS.Reservations.Api.UnitTests/SFA.DAS.Reservations.Api.UnitTests.csproj @@ -2,6 +2,7 @@ netcoreapp2.2 + 4E1E6AD4-D804-4B53-B89B-15D8B0A9B30C diff --git a/src/SFA.DAS.Reservations.Api/SFA.DAS.Reservations.Api.csproj b/src/SFA.DAS.Reservations.Api/SFA.DAS.Reservations.Api.csproj index 442db928..0906fa64 100644 --- a/src/SFA.DAS.Reservations.Api/SFA.DAS.Reservations.Api.csproj +++ b/src/SFA.DAS.Reservations.Api/SFA.DAS.Reservations.Api.csproj @@ -2,6 +2,7 @@ netcoreapp2.2 + E3FAC36B-A6D6-422A-821D-B35348794C24 diff --git a/src/SFA.DAS.Reservations.Application.UnitTests/SFA.DAS.Reservations.Application.UnitTests.csproj b/src/SFA.DAS.Reservations.Application.UnitTests/SFA.DAS.Reservations.Application.UnitTests.csproj index 5b41f12e..76c16f9c 100644 --- a/src/SFA.DAS.Reservations.Application.UnitTests/SFA.DAS.Reservations.Application.UnitTests.csproj +++ b/src/SFA.DAS.Reservations.Application.UnitTests/SFA.DAS.Reservations.Application.UnitTests.csproj @@ -2,6 +2,7 @@ netcoreapp2.2 + 34115D06-C59B-42FE-B4CB-D346AEE7F4BF false diff --git a/src/SFA.DAS.Reservations.Application/SFA.DAS.Reservations.Application.csproj b/src/SFA.DAS.Reservations.Application/SFA.DAS.Reservations.Application.csproj index a7ae73dc..3d444ba5 100644 --- a/src/SFA.DAS.Reservations.Application/SFA.DAS.Reservations.Application.csproj +++ b/src/SFA.DAS.Reservations.Application/SFA.DAS.Reservations.Application.csproj @@ -2,6 +2,7 @@ netcoreapp2.2 + AC93FA2B-054E-4A29-954D-D76C09732F3E diff --git a/src/SFA.DAS.Reservations.Data.UnitTests/SFA.DAS.Reservations.Data.UnitTests.csproj b/src/SFA.DAS.Reservations.Data.UnitTests/SFA.DAS.Reservations.Data.UnitTests.csproj index 70849638..5dbc5e20 100644 --- a/src/SFA.DAS.Reservations.Data.UnitTests/SFA.DAS.Reservations.Data.UnitTests.csproj +++ b/src/SFA.DAS.Reservations.Data.UnitTests/SFA.DAS.Reservations.Data.UnitTests.csproj @@ -2,7 +2,7 @@ netcoreapp2.2 - + 2DF501DC-30FA-40BB-B43D-F68ECACEB2DD false diff --git a/src/SFA.DAS.Reservations.Data/SFA.DAS.Reservations.Data.csproj b/src/SFA.DAS.Reservations.Data/SFA.DAS.Reservations.Data.csproj index 010b3ee7..46231965 100644 --- a/src/SFA.DAS.Reservations.Data/SFA.DAS.Reservations.Data.csproj +++ b/src/SFA.DAS.Reservations.Data/SFA.DAS.Reservations.Data.csproj @@ -2,6 +2,7 @@ netcoreapp2.2 + 4467636E-77B3-4125-9641-F20BDDA957E8 diff --git a/src/SFA.DAS.Reservations.Domain.UnitTests/SFA.DAS.Reservations.Domain.UnitTests.csproj b/src/SFA.DAS.Reservations.Domain.UnitTests/SFA.DAS.Reservations.Domain.UnitTests.csproj index 8b4e73b1..4f01780d 100644 --- a/src/SFA.DAS.Reservations.Domain.UnitTests/SFA.DAS.Reservations.Domain.UnitTests.csproj +++ b/src/SFA.DAS.Reservations.Domain.UnitTests/SFA.DAS.Reservations.Domain.UnitTests.csproj @@ -2,7 +2,7 @@ netcoreapp2.2 - + A06307CF-2382-4ECF-9C4D-A44534FF9B56 false diff --git a/src/SFA.DAS.Reservations.Domain/SFA.DAS.Reservations.Domain.csproj b/src/SFA.DAS.Reservations.Domain/SFA.DAS.Reservations.Domain.csproj index 25f6e2ee..81d2954f 100644 --- a/src/SFA.DAS.Reservations.Domain/SFA.DAS.Reservations.Domain.csproj +++ b/src/SFA.DAS.Reservations.Domain/SFA.DAS.Reservations.Domain.csproj @@ -2,6 +2,7 @@ netcoreapp2.2 + B48062FE-FFD8-4BFD-8D6D-65E747573BB9 diff --git a/src/SFA.DAS.Reservations.Infrastructure.UnitTests/SFA.DAS.Reservations.Infrastructure.UnitTests.csproj b/src/SFA.DAS.Reservations.Infrastructure.UnitTests/SFA.DAS.Reservations.Infrastructure.UnitTests.csproj index c4ce5bdf..057a26ff 100644 --- a/src/SFA.DAS.Reservations.Infrastructure.UnitTests/SFA.DAS.Reservations.Infrastructure.UnitTests.csproj +++ b/src/SFA.DAS.Reservations.Infrastructure.UnitTests/SFA.DAS.Reservations.Infrastructure.UnitTests.csproj @@ -2,7 +2,7 @@ netcoreapp2.2 - + B0DCD2CB-B12B-469E-A4E1-31F685BF4AC5 false diff --git a/src/SFA.DAS.Reservations.Infrastructure/SFA.DAS.Reservations.Infrastructure.csproj b/src/SFA.DAS.Reservations.Infrastructure/SFA.DAS.Reservations.Infrastructure.csproj index 1fc7c062..fd09d306 100644 --- a/src/SFA.DAS.Reservations.Infrastructure/SFA.DAS.Reservations.Infrastructure.csproj +++ b/src/SFA.DAS.Reservations.Infrastructure/SFA.DAS.Reservations.Infrastructure.csproj @@ -2,6 +2,7 @@ netcoreapp2.2 + ED3C5682-11FC-4213-89F1-3AEBC06EC9A4 diff --git a/src/SFA.DAS.Reservations.Messages/SFA.DAS.Reservations.Messages.csproj b/src/SFA.DAS.Reservations.Messages/SFA.DAS.Reservations.Messages.csproj index 9887f081..170f2e63 100644 --- a/src/SFA.DAS.Reservations.Messages/SFA.DAS.Reservations.Messages.csproj +++ b/src/SFA.DAS.Reservations.Messages/SFA.DAS.Reservations.Messages.csproj @@ -1,6 +1,7 @@  netcoreapp2.2;netstandard2.0 + D70EFF41-3F49-4767-9819-A785ACAE3134 true diff --git a/src/SFA.DAS.Reservations.NServiceBusListener/SFA.DAS.Reservations.NServiceBusListener.csproj b/src/SFA.DAS.Reservations.NServiceBusListener/SFA.DAS.Reservations.NServiceBusListener.csproj index 7f75665b..03c83f53 100644 --- a/src/SFA.DAS.Reservations.NServiceBusListener/SFA.DAS.Reservations.NServiceBusListener.csproj +++ b/src/SFA.DAS.Reservations.NServiceBusListener/SFA.DAS.Reservations.NServiceBusListener.csproj @@ -3,6 +3,7 @@ Exe netcoreapp2.2 + 48DF1D58-4784-4973-B0B3-40C3CEC00387