From 085780f2811e063610352a804044362fdd21f9c5 Mon Sep 17 00:00:00 2001 From: FrostyApeOne <78855469+FrostyApeOne@users.noreply.github.com> Date: Wed, 14 Aug 2024 15:09:38 +0100 Subject: [PATCH] Feature/173197 persons api client nu get package (#575) * Added a new step to the build workfow to build and publish a nuget package * Changed the target condition so it wont run in CI * Added a change for testing the new workflow * Added environment varibale CI to the CI yaml file * Added build-args in the docker-build * Fixed the casing in teh target condition * Modified target condition * Modified target condition * Added CI argument to the docker file, passed in from the docker build * Passed in CI argument to the project build process * Added CI argument to the docker build * Added CI argument to the build-and-push-image.yml file * Added changes to test Client Nuget Package deployment * added CI argumetn tot he build command in continious integration file --------- Co-authored-by: Farshad DASHTI --- .github/workflows/continuous-integration-dotnet.yml | 2 +- Dfe.PersonsApi.Client/Generated/Client.g.cs | 2 +- Dfe.PersonsApi.Client/Generated/swagger.json | 2 +- PersonsApi/Controllers/ConstituenciesController.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continuous-integration-dotnet.yml b/.github/workflows/continuous-integration-dotnet.yml index 638bbb85..8014145e 100644 --- a/.github/workflows/continuous-integration-dotnet.yml +++ b/.github/workflows/continuous-integration-dotnet.yml @@ -93,7 +93,7 @@ jobs: CI: true run: | dotnet-sonarscanner begin /k:"DFE-Digital_academies-api" /o:"dfe-digital" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverageReportPaths=CoverageReport/SonarQube.xml - dotnet build --no-restore + dotnet build --no-restore -p:CI=${CI} dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:./CoverageReport -reporttypes:SonarQube dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" diff --git a/Dfe.PersonsApi.Client/Generated/Client.g.cs b/Dfe.PersonsApi.Client/Generated/Client.g.cs index ea4e49c0..cf06620d 100644 --- a/Dfe.PersonsApi.Client/Generated/Client.g.cs +++ b/Dfe.PersonsApi.Client/Generated/Client.g.cs @@ -139,7 +139,7 @@ public virtual async System.Threading.Tasks.Task GetMemberOf if (status_ == 404) { string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new PersonsApiException("Constituency not found ", status_, responseText_, headers_, null); + throw new PersonsApiException("Constituency not found", status_, responseText_, headers_, null); } else if (status_ == 400) diff --git a/Dfe.PersonsApi.Client/Generated/swagger.json b/Dfe.PersonsApi.Client/Generated/swagger.json index 42df4946..719514ce 100644 --- a/Dfe.PersonsApi.Client/Generated/swagger.json +++ b/Dfe.PersonsApi.Client/Generated/swagger.json @@ -35,7 +35,7 @@ } }, "404": { - "description": "Constituency not found " + "description": "Constituency not found" }, "400": { "description": "Constituency cannot be null or empty" diff --git a/PersonsApi/Controllers/ConstituenciesController.cs b/PersonsApi/Controllers/ConstituenciesController.cs index b25e0da4..999cfdf3 100644 --- a/PersonsApi/Controllers/ConstituenciesController.cs +++ b/PersonsApi/Controllers/ConstituenciesController.cs @@ -20,7 +20,7 @@ public ConstituenciesController(IPersonsQueries personQueries) [HttpGet("{constituencyName}/mp")] [SwaggerOperation(Summary = "Retrieve Member of Parliament by constituency name", Description = "Receives a constituency name and returns a Person object representing the Member of Parliament.")] [SwaggerResponse(200, "A Person object representing the Member of Parliament.", typeof(MemberOfParliament))] - [SwaggerResponse(404, "Constituency not found ")] + [SwaggerResponse(404, "Constituency not found")] [SwaggerResponse(400, "Constituency cannot be null or empty")] public async Task GetMemberOfParliamentByConstituencyAsync([FromRoute] string constituencyName, CancellationToken cancellationToken) {