Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitallowed
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ uec-core-dos-live-db-12-replica-sf.crvqtzolulpo.eu-west-2.rds.amazonaws.com
eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJpZCIsImlhdCI6MTYzMjMyMjg1NCwic3ViIjoiYWRtaW5AbmhzLm5ldCIsImlzcyI6Imlzc3VlciIsImV4cCI6MTYzMjMyNjQ1NCwiY29nbml0bzpncm91cHMiOlsiRlVaWllfQVBJX0FDQ0VTUyIsIkFQSV9VU0VSIiwiUE9TVENPREVfQVBJX0FDQ0VTUyJdfQ.AiD4_0DgTq9Osv8Vh7z5SYXayVkQfBTyM_p6_sMQvp9zVy-aOMBhDuL4cZAz44YRYYeF1XP2hVtVAP8joIKis-_hgoMpFk2eDV9k1vCoM_ORsmO5bvtMwhgJr_feJ5El3sn8rj1Op4L-vBityjog_M8GTdX74CB2mk5N8vZMcsURnGFyHRe7Hak-68sWBFKUO9phy61BY2r-4N-tvdX6rEqUXnEWlGLUH0YtHdwdhy_gFP9Dd1ml9XxHauQI_Ycr7-LuYKNQ2P1BpT7SNc80h4mds5epI20nhu8mdJikO7iyfFdIxbQ-i3ZNNgAiVyOmy-hYeXPC-UszUFhu3NVv6g

macos.mk

.*psycopg2/errorcodes\.py:.*INVALID_PASSWORD = '28P01'
.*psycopg2/errorcodes\.py:.*INVALID_FOREIGN_KEY = '42830'
2 changes: 2 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
jobs:
check-code-quality:
runs-on: ubuntu-latest
env:
TERM: xterm
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/code-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on: push
jobs:
check-code-security:
runs-on: ubuntu-latest
env:
TERM: xterm
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
jobs:
check-pull-request:
runs-on: ubuntu-latest
env:
TERM: xterm
steps:
- uses: actions/checkout@v4
with:
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ prepare: ## Prepare environment
pipeline-prepare:
sh $(PROJECT_DIR)scripts/assume_role.sh $(JENKINS_ENV) $(JENKINS_SERVICE_TEAM)

pipeline-slave-prepare:
# the jenkins-slave build agents don't have the docker daemon immediately available, let us wait for it
jenkins-agent-local-prepare:
# the jenkins-agent-local build agents don't have the docker daemon immediately available, let us wait for it
timeout 60 bash -c 'while ! docker info &>/dev/null; do sleep 1; done' || exit 1

compile:
Expand All @@ -43,10 +43,10 @@ build: project-config
CMD="clean verify install \
-Dsonar.verbose=true \
-Dsonar.host.url='https://sonarcloud.io' \
-Dsonar.organization='nhsd-exeter' \
-Dsonar.projectKey='uec-dos-api-pca' \
-Dsonar.organization='nhsdigital' \
-Dsonar.projectKey='uec-dos-sf-api-pca' \
-Dsonar.projectName='DoS Postcode API' \
-Dsonar.login='$$(make secret-fetch NAME=service-finder-sonar-pass | jq .SONAR_HOST_TOKEN | tr -d '"' || exit 1)' \
-Dsonar.token='$$(make secret-fetch NAME=service-finder-sonar-pass | jq .SONAR_HOST_TOKEN | tr -d '"' || exit 1)' \
-Dsonar.sourceEncoding='UTF-8' \
-Dsonar.coverage.jacoco.xmlReportPaths=target/site/jacoco \
-Dsonar.exclusions='src/main/java/**/config/*.*,src/main/java/**/model/*.*,src/main/java/**/exception/*.*,src/main/java/**/constants/*.*,src/main/java/**/interceptor/*.*,src/test/**/*.*,src/main/java/**/filter/*.*,src/main/java/**/PostcodeMappingApplication.*' \
Expand Down
30 changes: 14 additions & 16 deletions application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@
<mockito-junit-jupiter.version>2.28.2</mockito-junit-jupiter.version>
<commons-lang3.version>3.14.0</commons-lang3.version>
<commons-collections4.version>4.4</commons-collections4.version>
<springdoc-openapi-ui.version>1.5.2</springdoc-openapi-ui.version>
<springdoc-openapi-ui.version>1.8.0</springdoc-openapi-ui.version>
<webjars-swagger-ui.version>5.18.2</webjars-swagger-ui.version>
<log4j2.version>2.16.0</log4j2.version> <!-- Springboot does not use Log4J, this is here to force
other
dependencies to use the latest version -->
<spring-security-oauth2-autoconfigure.version>2.6.8</spring-security-oauth2-autoconfigure.version>
<java-jwt.version>3.19.4</java-jwt.version>
<commons-io.version>2.15.1</commons-io.version>
<springfox-boot-starter.version>3.0.0</springfox-boot-starter.version>
<springfox-swagger2.version>3.0.0</springfox-swagger2.version>
<springfox-swagger-ui.version>3.0.0</springfox-swagger-ui.version>
<jacoco-maven-plugin.version>0.8.11</jacoco-maven-plugin.version>
<opencsv.version>4.6</opencsv.version>
</properties>
Expand Down Expand Up @@ -215,21 +213,21 @@
</dependency>

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>${springfox-boot-starter.version}</version>
</dependency>

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${springfox-swagger2.version}</version>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>${springdoc-openapi-ui.version}</version>
<exclusions>
<exclusion>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${springfox-swagger-ui.version}</version>
<groupId>org.webjars</groupId>
<artifactId>swagger-ui</artifactId>
<version>${webjars-swagger-ui.version}</version>
</dependency>


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package uk.nhs.digital.uec.api.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.servers.Server;

@Configuration
public class OpenApiConfig {

@Value("${api.version}")
private String apiVersion;

@Value("${api.title}")
private String title;

@Value("${api.description}")
private String description;

@Bean
public OpenAPI customOpenAPI() {
return new OpenAPI()
.info(new Info()
.title(title)
.version(apiVersion)
.description(description))
.addServersItem(new Server().url("/"));
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import static uk.nhs.digital.uec.api.constants.SwaggerConstants.POSTCODES_DESC;
import static uk.nhs.digital.uec.api.exception.ErrorMessageEnum.NO_PARAMS_PROVIDED;

import io.swagger.annotations.ApiParam;
import java.util.List;

import io.swagger.v3.oas.annotations.Parameter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -38,9 +38,9 @@ public class PostcodeMappingController {

@GetMapping()
public ResponseEntity<List<PostcodeMapping>> getPostcodeMapping(
@ApiParam(POSTCODES_DESC) @RequestParam(name = "postcodes", required = false)
@Parameter(description = POSTCODES_DESC) @RequestParam(name = "postcodes", required = false)
List<String> postCodes,
@ApiParam(NAME_DESC) @RequestParam(name = "name", required = false) String name)
@Parameter(description =NAME_DESC) @RequestParam(name = "name", required = false) String name)
throws InvalidPostcodeException, InvalidParameterException, NotFoundException {
long start = System.currentTimeMillis();
List<PostcodeMapping> postcodeMapping = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import static uk.nhs.digital.uec.api.constants.SwaggerConstants.POSTCODES_DESC;
import static uk.nhs.digital.uec.api.constants.SwaggerConstants.POSTCODE_DESC;

import io.swagger.annotations.ApiParam;
import java.util.List;
import java.util.Map;

import io.swagger.v3.oas.annotations.Parameter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -42,7 +43,7 @@ public ResponseEntity getAllRegions() {
@GetMapping(params = {"postcodes"})
@PreAuthorize("hasAnyRole('POSTCODE_API_ACCESS')")
public ResponseEntity getRegionDetailsByPostCodes(
@ApiParam(POSTCODES_DESC) @RequestParam(name = "postcodes", required = false)
@Parameter(description = POSTCODES_DESC) @RequestParam(name = "postcodes", required = false)
List<String> postcodes) {
try {
long start = System.currentTimeMillis();
Expand Down Expand Up @@ -75,7 +76,7 @@ public ResponseEntity getRegionDetailsByPostCodes(
@GetMapping(params = {"postcode"})
@PreAuthorize("hasAnyRole('POSTCODE_API_ACCESS')")
public ResponseEntity getRegionDetailsByPostCode(
@ApiParam(POSTCODE_DESC) @RequestParam(name = "postcode", required = false) String postcode) {
@Parameter(description = POSTCODE_DESC) @RequestParam(name = "postcode", required = false) String postcode) {
PostcodeMapping postcodeMapping = new PostcodeMapping();
postcodeMapping.setPostcode(postcode);
try {
Expand Down
8 changes: 4 additions & 4 deletions build/automation/init.mk
Original file line number Diff line number Diff line change
Expand Up @@ -792,10 +792,10 @@ endif
ifneq (0, $(shell which docker > /dev/null 2>&1; echo $$?))
$(error $(shell tput setaf 202; echo "WARNING: Please, before proceeding install Docker"; tput sgr0))
endif
# *NIX: Docker Compose
ifneq (0, $(shell which docker-compose > /dev/null 2>&1; echo $$?))
$(error $(shell tput setaf 202; echo "WARNING: Please, before proceeding install Docker Compose"; tput sgr0))
endif
## *NIX: Docker Compose
#ifneq (0, $(shell which docker-compose > /dev/null 2>&1; echo $$?))
#$(error $(shell tput setaf 202; echo "WARNING: Please, before proceeding install Docker Compose"; tput sgr0))
#endif
endif
endif

Expand Down
4 changes: 2 additions & 2 deletions build/automation/lib/docker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,9 @@ docker-run-composer: ### Run composer container - mandatory: CMD; optional: DIR,

docker-run-editorconfig: ### Run editorconfig container - optional: DIR=[working directory],EXCLUDE=[file pattern e.g. '\.txt$$'],ARGS=[Docker args],VARS_FILE=[Makefile vars file],IMAGE=[image name],CONTAINER=[container name]
if [ $(PROJECT_NAME) = $(DEVOPS_PROJECT_NAME) ]; then
exclude='$(shell [ -n "$(EXCLUDE)" ] && echo '$(EXCLUDE)|')markdown|linux-amd64$$|\.drawio|\.p12|\.jks|\.so$$'
exclude='$(shell [ -n "$(EXCLUDE)" ] && echo '$(EXCLUDE)|')markdown|linux-amd64$$|\.drawio|\.p12|\.jks|\.so$$|infrastructure/stacks/.*/.*/.*/psycopg2.*'
else
exclude='$(shell [ -n "$(EXCLUDE)" ] && echo '$(EXCLUDE)|')build/automation|markdown|linux-amd64$$|\.drawio|\.p12|\.jks|\.so$$'
exclude='$(shell [ -n "$(EXCLUDE)" ] && echo '$(EXCLUDE)|')build/automation|markdown|linux-amd64$$|\.drawio|\.p12|\.jks|\.so$$|infrastructure/stacks/.*/.*/.*/psycopg2.*'
fi
make docker-config > /dev/null 2>&1
image=$$([ -n "$(IMAGE)" ] && echo $(IMAGE) || echo mstruebing/editorconfig-checker:$(DOCKER_EDITORCONFIG_CHECKER_VERSION))
Expand Down
6 changes: 3 additions & 3 deletions build/jenkins/Jenkinsfile.tag
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pipeline {
Tags the release image
*/

agent { label "jenkins-slave" }
agent { label "jenkins-agent-local" }

parameters {
string(
Expand All @@ -24,10 +24,10 @@ pipeline {
}

stages {
stage('Prepare for jenkins-slave run') {
stage('Prepare for jenkins-agent-local run') {
steps {
script {
sh "make pipeline-slave-prepare"
sh "make jenkins-agent-local-prepare"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions build/jenkins/build/build.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pipeline {
Description: Development pipeline to build test push and deploy to nonprod
*/
agent {
label 'jenkins-slave'
label 'jenkins-agent-local'
}

environment {
Expand All @@ -20,10 +20,10 @@ pipeline {
triggers { pollSCM('* * * * *') }

stages {
stage('Prepare for jenkins-slave run') {
stage('Prepare for jenkins-agent-local run') {
steps {
script {
sh "make pipeline-slave-prepare"
sh "make jenkins-agent-local-prepare"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions build/jenkins/demo/demo-deployment.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pipeline {
*/

agent {
label 'jenkins-slave'
label 'jenkins-agent-local'
}

options {
Expand Down Expand Up @@ -37,10 +37,10 @@ pipeline {
}
}
}
stage('Prepare for jenkins-slave run') {
stage('Prepare for jenkins-agent-local run') {
steps {
script {
sh "make pipeline-slave-prepare"
sh "make jenkins-agent-local-prepare"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions build/jenkins/deployments.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ pipeline {
}
}
}
stage('Prepare for jenkins-slave run') {
stage('Prepare for jenkins-agent-local run') {
steps {
script {
sh 'make pipeline-slave-prepare'
sh 'make jenkins-agent-local-prepare'
}
}
}
Expand Down
Loading