Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2.1

orbs:
aws-ecr: circleci/aws-ecr@3.0.0
aws-cli: circleci/aws-cli@5.1.0
aws_assume_role: lbh-hackit/aws_assume_role@0.1.0
node: circleci/node@6.3.0

executors:
docker-python:
Expand All @@ -14,7 +14,7 @@ executors:
- image: hashicorp/terraform:latest
docker-dotnet:
docker:
- image: mcr.microsoft.com/dotnet/sdk:6.0
- image: mcr.microsoft.com/dotnet/sdk:8.0

references:
workspace_root: &workspace_root "~"
Expand Down Expand Up @@ -83,17 +83,9 @@ commands:
- *attach_workspace
- checkout
- setup_remote_docker
- run:
name: Install Node.js
command: |
curl -sL https://deb.nodesource.com/setup_20.x | bash -
apt-get update && apt-get install -y nodejs
- run:
name: Install serverless CLI
command: npm i -g serverless@^3
- run:
name: Install aws alerts CLI
command: npm i -g serverless-plugin-aws-alerts
- node/install
- node/install-packages:
app-dir: SingleViewApi
- run:
name: Build lambda
command: |
Expand All @@ -104,7 +96,7 @@ commands:
name: Deploy lambda
command: |
cd ./SingleViewApi/
sls deploy --stage <<parameters.stage>> --conceal
npx --yes serverless@4 deploy --stage <<parameters.stage>> --conceal

migrate-database:
description: "Migrate database"
Expand Down Expand Up @@ -366,7 +358,9 @@ workflows:
branches:
only: development
- deploy-to-development:
context: api-nuget-token-context
context:
- api-nuget-token-context
- "Serverless Framework"
requires:
- terraform-init-and-apply-to-development
filters:
Expand Down Expand Up @@ -414,7 +408,9 @@ workflows:
branches:
only: master
- deploy-to-staging:
context: api-nuget-token-context
context:
- api-nuget-token-context
- "Serverless Framework"
requires:
- terraform-init-and-apply-to-staging
filters:
Expand Down Expand Up @@ -469,7 +465,9 @@ workflows:
branches:
only: master
- deploy-to-production:
context: api-nuget-token-context
context:
- api-nuget-token-context
- "Serverless Framework"
requires:
- permit-production-api-release
- terraform-init-and-apply-to-production
Expand Down
10 changes: 3 additions & 7 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# doc for this file https://help.github.com/articles/about-code-owners/
# This file specifies owners for pull request approval
# See https://help.github.com/articles/about-code-owners/

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.

* @elena-vi @adamhack3 @charlie-wild
* @LBHackney-IT/targeted-services
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
.PHONY: setup
setup:
docker-compose build
docker compose build

.PHONY: build
build:
docker-compose build SingleViewApi
docker compose build SingleViewApi

.PHONY: serve
serve:
docker-compose build SingleViewApi && docker-compose up SingleViewApi
docker compose build SingleViewApi && docker compose up SingleViewApi

.PHONY: shell
shell:
docker-compose run SingleViewApi bash
docker compose run SingleViewApi bash

.PHONY: test
test:
docker-compose up test-database & docker-compose build SingleViewApi-test && docker-compose up SingleViewApi-test
docker compose up test-database & docker compose build SingleViewApi-test && docker compose up SingleViewApi-test

.PHONY: test-db
test-db:
docker-compose up test-database
docker compose up test-database

.PHONY: lint
lint:
Expand All @@ -33,4 +33,4 @@ restart-db:
docker stop $$(docker ps -q --filter ancestor=test-database -a)
-docker rm $$(docker ps -q --filter ancestor=test-database -a)
docker rmi test-database
docker-compose up -d test-database
docker compose up -d test-database
2 changes: 1 addition & 1 deletion SingleViewApi.Tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0
FROM mcr.microsoft.com/dotnet/sdk:8.0

# disable microsoft telematry
ENV DOTNET_CLI_TELEMETRY_OPTOUT='true'
Expand Down
6 changes: 3 additions & 3 deletions SingleViewApi.Tests/SingleViewApi.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
Expand All @@ -19,14 +19,14 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.2-beta1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NUnit3TestAdapter" Version="3.12.0" />
<PackageReference Include="Bogus" Version="25.0.4" />
<PackageReference Include="Moq" Version="4.16.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void GetCorrelationShouldThrowExceptionIfCorrelationHeaderUnavailable()
public void GetCorrelationShouldReturnCorrelationIdWhenExists()
{
// Arrange
_stubHttpContext.Request.Headers.Add(HeaderConstants.CorrelationId, "123");
_stubHttpContext.Request.Headers.Append(HeaderConstants.CorrelationId, "123");

// Act
var result = _sut.GetCorrelationId();
Expand Down
2 changes: 1 addition & 1 deletion SingleViewApi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0
FROM mcr.microsoft.com/dotnet/sdk:8.0

ARG LBHPACKAGESTOKEN
ENV LBHPACKAGESTOKEN=$LBHPACKAGESTOKEN
Expand Down
16 changes: 8 additions & 8 deletions SingleViewApi/SingleViewApi.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -12,8 +12,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Amazon.Lambda.AspNetCoreServer" Version="5.1.1" />
<PackageReference Include="Amazon.Lambda.AspNetCoreServer" Version="8.1.1" />
<PackageReference Include="AngleSharp" Version="1.0.0-alpha-844" />
<PackageReference Include="Asp.Versioning.Mvc" Version="8.1.0" />
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageReference Include="AspectInjector" Version="2.5.0" />
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.7.0.21" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.0.1" />
Expand All @@ -30,10 +32,8 @@
<PackageReference Include="Hackney.Shared.ContactDetail" Version="0.5.0" />
<PackageReference Include="Hackney.Shared.Person" Version="0.12.0" />
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="4.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="4.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0-preview1.22310.1">
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.11" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -42,13 +42,13 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.2-beta1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.0.4" />
<PackageReference Include="ServiceStack.Redis" Version="6.0.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.4.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="5.4.1" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="5.4.1" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="5.4.1" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="7.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions SingleViewApi/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
using SingleViewApi.Versioning;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Versioning;
using Asp.Versioning;
using Asp.Versioning.ApiExplorer;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand Down
1 change: 1 addition & 0 deletions SingleViewApi/V1/Controllers/AcademyController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Asp.Versioning;

namespace SingleViewApi.V1.Controllers
{
Expand Down
1 change: 1 addition & 0 deletions SingleViewApi/V1/Controllers/CombinedSearchController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.AspNetCore.Mvc;
using SingleViewApi.V1.Boundary.Response;
using SingleViewApi.V1.UseCase.Interfaces;
using Asp.Versioning;

namespace SingleViewApi.V1.Controllers
{
Expand Down
1 change: 1 addition & 0 deletions SingleViewApi/V1/Controllers/CustomerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.Extensions.Logging;
using SingleViewApi.V1.Boundary.Request;
using SingleViewApi.V1.Gateways.Interfaces;
using Asp.Versioning;

namespace SingleViewApi.V1.Controllers
{
Expand Down
1 change: 1 addition & 0 deletions SingleViewApi/V1/Controllers/JigsawCasesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.AspNetCore.Mvc;
using SingleViewApi.V1.Boundary;
using SingleViewApi.V1.UseCase.Interfaces;
using Asp.Versioning;

namespace SingleViewApi.V1.Controllers
{
Expand Down
1 change: 1 addition & 0 deletions SingleViewApi/V1/Controllers/JigsawController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.Extensions.Logging;
using SingleViewApi.V1.Boundary.Response;
using SingleViewApi.V1.UseCase.Interfaces;
using Asp.Versioning;

namespace SingleViewApi.V1.Controllers
{
Expand Down
1 change: 1 addition & 0 deletions SingleViewApi/V1/Controllers/NotesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using SingleViewApi.V1.Boundary;
using SingleViewApi.V1.Boundary.Request;
using SingleViewApi.V1.Boundary.Response;
using Asp.Versioning;

namespace SingleViewApi.V1.Controllers
{
Expand Down
1 change: 1 addition & 0 deletions SingleViewApi/V1/Controllers/PersonApiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Asp.Versioning;

namespace SingleViewApi.V1.Controllers
{
Expand Down
1 change: 1 addition & 0 deletions SingleViewApi/V1/Controllers/PostgresController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using SingleViewApi.V1.Boundary.Response;
using SingleViewApi.V1.Gateways;
using SingleViewApi.V1.Gateways.Interfaces;
using Asp.Versioning;

namespace SingleViewApi.V1.Controllers
{
Expand Down
1 change: 1 addition & 0 deletions SingleViewApi/V1/Controllers/SharedPlanController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using SingleViewApi.V1.Boundary.Request;
using SingleViewApi.V1.Boundary.Response;
using SingleViewApi.V1.UseCase.Interfaces;
using Asp.Versioning;

namespace SingleViewApi.V1.Controllers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using SingleViewApi.V1.Boundary.Response;
using SingleViewApi.V1.UseCase;
using SingleViewApi.V1.UseCase.Interfaces;
using Asp.Versioning;

namespace SingleViewApi.V1.Controllers
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Asp.Versioning.ApiExplorer;

namespace SingleViewApi.Versioning
{
Expand Down
2 changes: 1 addition & 1 deletion SingleViewApi/Versioning/ApiVersionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using Asp.Versioning;

namespace SingleViewApi.Versioning
{
Expand Down
2 changes: 1 addition & 1 deletion SingleViewApi/build.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dotnet restore
dotnet lambda package --configuration release --framework netcoreapp3.1 --output-package bin/release/netcoreapp3.1/SingleViewApi.zip
dotnet lambda package --configuration release --framework net8.0 --output-package bin/release/SingleViewApi.zip
2 changes: 1 addition & 1 deletion SingleViewApi/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ then
fi

dotnet restore
dotnet lambda package --configuration release --framework net6.0 --output-package ./bin/release/net6.0/SingleViewApi.zip
dotnet lambda package --configuration release --framework net8.0 --output-package ./bin/release/SingleViewApi.zip
Loading
Loading