Skip to content

Commit ef18e47

Browse files
authored
Merge pull request #3954 from devinleighsmith/master
Release 5.1
2 parents 9d8b06c + ccfe27e commit ef18e47

File tree

1,865 files changed

+187046
-53256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,865 files changed

+187046
-53256
lines changed

.github/workflows/api-dotnetcore.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
# Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)
119119
env_vars: C#
120120
# Specify whether or not CI build should fail if Codecov runs into an error during upload
121-
fail_ci_if_error: true
121+
fail_ci_if_error: false
122122

123123
- name: SonarScanner for .NET 8 with pull request decoration support
124124
id: scan

.github/workflows/app-react.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Use Node.js
4343
uses: actions/setup-node@v3
4444
with:
45-
node-version: "16.15.0"
45+
node-version: "20.11.1"
4646
- run: npm ci
4747
working-directory: ${{env.working-directory}}
4848

@@ -71,12 +71,12 @@ jobs:
7171
# Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)
7272
env_vars: javascript
7373
# Specify whether or not CI build should fail if Codecov runs into an error during upload
74-
fail_ci_if_error: true
74+
fail_ci_if_error: false
7575

7676
- name: SonarQube Scan
7777
id: scan
7878
uses: sonarsource/sonarqube-scan-action@master
79-
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'bcgov/PSP' }}
79+
if: false
8080
env:
8181
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
8282
SONAR_HOST_URL: ${{ secrets.SONAR_URL }}

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- uses: actions/setup-node@v3
2020
with:
21-
node-version: "16"
21+
node-version: "20"
2222

2323
- name: Setup git
2424
run: |

.github/workflows/tag.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- uses: actions/setup-node@v3
2020
with:
21-
node-version: "16"
21+
node-version: "20"
2222

2323
- name: Setup git
2424
run: |

.github/workflows/uat_pre_release_hotfix.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
notification-summary: PIMS UAT Pre-Release Hotfix started.
4949
notification-color: 17a2b8
5050
timezone: America/Los_Angeles
51-
51+
5252
create-builds:
5353
name: create builds
5454
needs: ci-cd-start-notification
@@ -124,8 +124,8 @@ jobs:
124124
namespace: ${{ env.OPENSHIFT_TOOLS_NAMESPACE }}
125125
- name: call scripts to deploy api and frontend
126126
run: |
127-
OC_JOB_NAME=${{github.event.inputs.HOTFIX_BRANCH}} &&./openshift/4.0/player.sh deploy api $DESTINATION -apply
128-
OC_JOB_NAME=${{github.event.inputs.HOTFIX_BRANCH}} &&./openshift/4.0/player.sh deploy app $DESTINATION -apply
127+
RELEASE_TAG=latest-${{github.event.inputs.HOTFIX_BRANCH}} && ./openshift/4.0/player.sh deploy api $DESTINATION -apply
128+
RELEASE_TAG=latest-${{github.event.inputs.HOTFIX_BRANCH}} && ./openshift/4.0/player.sh deploy app $DESTINATION -apply
129129
130130
# the command:
131131
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
@@ -150,8 +150,8 @@ jobs:
150150
run: |
151151
oc process -f ./openshift/4.0/templates/jobs/db-deploy.yaml -p DB_SECRET_NAME=pims-database-uat -p GIT_BRANCH=${{github.event.inputs.HOTFIX_BRANCH}} -p SERVER_NAME=sqlprd.th.gov.bc.ca -p DB_NAME=PIMS_UAT -p NAMESPACE=3cd915-test | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*" | (read JOB_NAME; oc wait --for=condition=complete job/$JOB_NAME --timeout=120s)
152152
153-
## Call the mayan sync task three times, once for each mayan sync endpoint. The task will wait for the job to complete before exiting.
154-
## Note: this depends on the mayan-sync configmap for the target namespace being up to date.
153+
## Call the mayan sync task three times, once for each mayan sync endpoint. The task will wait for the job to complete before exiting.
154+
## Note: this depends on the mayan-sync configmap for the target namespace being up to date.
155155
mayan-sync:
156156
name: sync mayan
157157
needs: database-upgrade
@@ -215,7 +215,7 @@ jobs:
215215
notification-summary: PIMS UAT Pre-Release Hotfix complete with status ${{ steps.check.outputs.status }}
216216
notification-color: 17a2b8
217217
timezone: America/Los_Angeles
218-
218+
219219
cleanup-builds:
220220
if: always()
221221
name: cleanup builds

.github/workflows/version.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- uses: actions/setup-node@v3
1919
with:
20-
node-version: "16"
20+
node-version: "20"
2121

2222
- name: Setup git
2323
run: |

.vscode/launch.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
"request": "launch",
1111
"console": "internalConsole",
1212
"preLaunchTask": "build",
13-
"program": "${workspaceRoot}/tools/keycloak/sync/bin/Debug/net6.0/Pims.Tools.Keycloak.Sync.dll",
13+
"program": "${workspaceRoot}/tools/keycloak/sync/bin/Debug/net8.0/Pims.Tools.Keycloak.Sync.dll",
1414
"cwd": "${workspaceRoot}/tools/keycloak/sync",
1515
"stopAtEntry": false
1616
},
1717
{
18-
"name": ".NET 6 Launch (api)",
18+
"name": ".NET 8 Launch (api)",
1919
"type": "coreclr",
2020
"request": "launch",
2121
"preLaunchTask": "build",
22-
"program": "${workspaceRoot}/source/backend/api/bin/Debug/net6.0/Pims.Api.dll",
22+
"program": "${workspaceRoot}/source/backend/api/bin/Debug/net8.0/Pims.Api.dll",
2323
"args": [],
2424
"cwd": "${workspaceRoot}/source/backend/api",
2525
"stopAtEntry": false,
@@ -32,7 +32,7 @@
3232
}
3333
},
3434
{
35-
"name": ".NET 6 Attach",
35+
"name": ".NET 8 Attach",
3636
"type": "coreclr",
3737
"request": "attach",
3838
"processId": "${command:pickProcess}"

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ refresh: | down build up ## Recreates local docker environment
180180
.PHONY: infra
181181
infra: ## Starts infrastructure containers (e.g. database, geoserver). Useful for local debugging
182182
@echo "$(P) Starting up infrastructure containers..."
183-
@"$(MAKE)" start n="database geoserver"
183+
@"$(MAKE)" start n="database geoserver grafana prometheus"
184184

185185
start: ## Starts the local containers (n=service name)
186186
@echo "$(P) Starting client and server containers..."
@@ -316,7 +316,7 @@ generate-tsapi: ## Generates the pims API typescript files
316316
@echo "$(P) Generating pims api Ts files..."
317317
@cd tools/TsModelGenerator; dotnet build; dotnet run;
318318
@make frontend-lint
319-
319+
320320

321321
frontend-lint:
322322
@echo "$(P) Running lint:fix..."

docker-compose.yml

+24-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
version: "3.5"
22

33
services:
4-
54
####################### Database #######################
65
database:
76
environment:
@@ -87,13 +86,36 @@ services:
8786
restart: on-failure
8887
container_name: psp-clamav
8988
healthcheck:
90-
test: [ "CMD", "./check.sh" ]
89+
test: ["CMD", "./check.sh"]
9190
interval: 60s
9291
retries: 3
9392
start_period: 120s
9493
networks:
9594
- psp
9695

96+
prometheus:
97+
image: ubuntu/prometheus
98+
container_name: psp-prometheus
99+
ports:
100+
- 9000:9090
101+
environment:
102+
- TZ=UTC
103+
volumes:
104+
- ./tools/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
105+
- ./tools/prometheus/alert-rules.yml:/etc/prometheus/alert-rules.yml
106+
command:
107+
- "--config.file=/etc/prometheus/prometheus.yml"
108+
- "--web.enable-lifecycle"
109+
110+
grafana:
111+
image: grafana/grafana-oss
112+
container_name: psp-grafana
113+
restart: on-failure
114+
ports:
115+
- 4000:3000
116+
depends_on:
117+
- prometheus
118+
97119
####################### Networks Definition #######################
98120
networks:
99121
psp:

openshift/4.0/templates/app/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Update the configuration file and set the appropriate parameters.
1010
**Example**
1111

1212
```conf
13-
BUILDIMAGE_NAME=nodejs-16
14-
BUILDIMAGE_TAG=1-1
13+
BUILDIMAGE_NAME=nodejs-20
14+
BUILDIMAGE_TAG=1-34
1515
RUNTIMEIMAGE_NAME=nginx-runtime
1616
RUNTIMEIMAGE_TAG=dev
1717
GIT_URL=https://github.com/bcgov/PSP.git

openshift/4.0/templates/app/build.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ parameters:
3131
- name: BUILDIMAGE_NAME
3232
displayName: "Source Image Name"
3333
description: "The image to use as the Builder Image."
34-
value: "nodejs-16"
34+
value: "nodejs-20"
3535
- name: BUILDIMAGE_TAG
3636
displayName: "Source Image Tag"
3737
description: "The s2i image tag which is used to build the code."
38-
value: "1-5"
38+
value: "1-34"
3939

4040
- name: RUNTIMEIMAGE_NAME
4141
displayName: "Source Image Name"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
kind: ImageStream
2+
apiVersion: image.openshift.io/v1
3+
metadata:
4+
name: nodejs-20
5+
namespace: 3cd915-tools
6+
annotations:
7+
openshift.io/image.dockerRepositoryCheck: '2024-03-06T01:22:09Z'
8+
description: ImageStream definitions for NodeJS 20
9+
spec:
10+
lookupPolicy:
11+
local: false
12+
tags:
13+
- name: 1-34
14+
annotations: null
15+
from:
16+
kind: DockerImage
17+
name: 'registry.access.redhat.com/ubi9/nodejs-20:1-34'
18+
generation: 1
19+
importPolicy:
20+
importMode: Legacy
21+
referencePolicy:
22+
type: Source
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: ops.gov.bc.ca/v1alpha1
2+
kind: SysdigTeam
3+
metadata:
4+
name: 3cd915-sysdigteam
5+
namespace: 3cd915-tools
6+
spec:
7+
team:
8+
description: The Sysdig Team for the OpenShift Project Set PSP
9+
users:
10+
11+
role: ROLE_TEAM_EDIT
12+
13+
role: ROLE_TEAM_EDIT
14+
15+
role: ROLE_TEAM_EDIT
16+
17+
role: ROLE_TEAM_EDIT

source/backend/Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
ARG BUILD_CONFIGURATION=Release
2-
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
2+
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
33
WORKDIR /app
44
EXPOSE 443 8080
55

66
# Copy csproj and restore as distinct layers
7-
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
7+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
88
WORKDIR /src
99
COPY *.sln .
1010
COPY Directory.Build.props .
1111
COPY api/*.csproj api/
1212
COPY entities/*.csproj entities/
13+
COPY apimodels/*.csproj apimodels/
1314
COPY tests/core/*.csproj tests/core/
1415
COPY tests/unit/api/*.csproj tests/unit/api/
1516
COPY tests/unit/dal/*.csproj tests/unit/dal/

source/backend/api/Areas/Acquisition/Controllers/AcquisitionFileController.cs

+10
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public AcquisitionFileController(IAcquisitionFileService acquisitionService, ICo
6868
[Produces("application/json")]
6969
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
7070
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
71+
[TypeFilter(typeof(NullJsonResultFilter))]
7172
public IActionResult GetAcquisitionFile(long id)
7273
{
7374
// RECOMMENDED - Add valuable metadata to logs
@@ -109,6 +110,7 @@ public IActionResult GetLastUpdatedBy(long id)
109110
[Produces("application/json")]
110111
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
111112
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
113+
[TypeFilter(typeof(NullJsonResultFilter))]
112114
public IActionResult AddAcquisitionFile([FromBody] AcquisitionFileModel model, [FromQuery] string[] userOverrideCodes)
113115
{
114116
_logger.LogInformation(
@@ -136,6 +138,7 @@ public IActionResult AddAcquisitionFile([FromBody] AcquisitionFileModel model, [
136138
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
137139
[ProducesResponseType(typeof(ErrorResponseModel), 409)]
138140
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
141+
[TypeFilter(typeof(NullJsonResultFilter))]
139142
public IActionResult UpdateAcquisitionFile(long id, [FromBody] AcquisitionFileModel model, [FromQuery] string[] userOverrideCodes)
140143
{
141144
_logger.LogInformation(
@@ -161,6 +164,7 @@ public IActionResult UpdateAcquisitionFile(long id, [FromBody] AcquisitionFileMo
161164
[Produces("application/json")]
162165
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
163166
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
167+
[TypeFilter(typeof(NullJsonResultFilter))]
164168
public IActionResult UpdateAcquisitionFileProperties([FromBody] AcquisitionFileModel acquisitionFileModel, [FromQuery] string[] userOverrideCodes)
165169
{
166170
var acquisitionFileEntity = _mapper.Map<Dal.Entities.PimsAcquisitionFile>(acquisitionFileModel);
@@ -177,6 +181,7 @@ public IActionResult UpdateAcquisitionFileProperties([FromBody] AcquisitionFileM
177181
[Produces("application/json")]
178182
[ProducesResponseType(typeof(IEnumerable<AcquisitionFilePropertyModel>), 200)]
179183
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
184+
[TypeFilter(typeof(NullJsonResultFilter))]
180185
public IActionResult GetAcquisitionFileProperties(long id)
181186
{
182187
var acquisitionFileProperties = _acquisitionService.GetProperties(id);
@@ -193,6 +198,7 @@ public IActionResult GetAcquisitionFileProperties(long id)
193198
[Produces("application/json")]
194199
[ProducesResponseType(typeof(IEnumerable<AcquisitionFileOwnerModel>), 200)]
195200
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
201+
[TypeFilter(typeof(NullJsonResultFilter))]
196202
public IActionResult GetAcquisitionFileOwners([FromRoute] long id)
197203
{
198204
var owners = _acquisitionService.GetOwners(id);
@@ -210,6 +216,7 @@ public IActionResult GetAcquisitionFileOwners([FromRoute] long id)
210216
[Produces("application/json")]
211217
[ProducesResponseType(typeof(IEnumerable<AcquisitionFileTeamModel>), 200)]
212218
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
219+
[TypeFilter(typeof(NullJsonResultFilter))]
213220
public IActionResult GetAcquisitionTeamMembers()
214221
{
215222
var team = _acquisitionService.GetTeamMembers();
@@ -243,6 +250,7 @@ public IActionResult GetFileCompensations(long id)
243250
[Produces("application/json")]
244251
[ProducesResponseType(typeof(IEnumerable<CompensationFinancialModel>), 200)]
245252
[SwaggerOperation(Tags = new[] { "comp-req-h120s" })]
253+
[TypeFilter(typeof(NullJsonResultFilter))]
246254
public IActionResult GetFileCompReqH120(long id, bool? finalOnly)
247255
{
248256
_logger.LogInformation(
@@ -269,6 +277,7 @@ public IActionResult GetFileCompReqH120(long id, bool? finalOnly)
269277
[Produces("application/json")]
270278
[ProducesResponseType(typeof(CompensationRequisitionModel), 201)]
271279
[SwaggerOperation(Tags = new[] { "compensation-requisition" })]
280+
[TypeFilter(typeof(NullJsonResultFilter))]
272281
public IActionResult AddCompensationRequisition([FromRoute] long id, [FromBody] CompensationRequisitionModel compensationRequisition)
273282
{
274283
_logger.LogInformation(
@@ -323,6 +332,7 @@ public IActionResult GetAcquisitionFileExpropriationPayments([FromRoute] long id
323332
[Produces("application/json")]
324333
[ProducesResponseType(typeof(ExpropriationPaymentModel), 201)]
325334
[SwaggerOperation(Tags = new[] { "expropriation-payments" })]
335+
[TypeFilter(typeof(NullJsonResultFilter))]
326336
public IActionResult AddExpropriationPayment([FromRoute] long id, [FromBody] ExpropriationPaymentModel expropriationPayment)
327337
{
328338
_logger.LogInformation(

0 commit comments

Comments
 (0)