Skip to content

Commit

Permalink
Merge pull request #3954 from devinleighsmith/master
Browse files Browse the repository at this point in the history
Release 5.1
  • Loading branch information
JamesPayer committed Apr 16, 2024
2 parents 9d8b06c + ccfe27e commit ef18e47
Show file tree
Hide file tree
Showing 1,865 changed files with 187,046 additions and 53,256 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/api-dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
# Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)
env_vars: C#
# Specify whether or not CI build should fail if Codecov runs into an error during upload
fail_ci_if_error: true
fail_ci_if_error: false

- name: SonarScanner for .NET 8 with pull request decoration support
id: scan
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/app-react.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16.15.0"
node-version: "20.11.1"
- run: npm ci
working-directory: ${{env.working-directory}}

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

- name: SonarQube Scan
id: scan
uses: sonarsource/sonarqube-scan-action@master
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'bcgov/PSP' }}
if: false
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_URL }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "20"

- name: Setup git
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "20"

- name: Setup git
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/uat_pre_release_hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
notification-summary: PIMS UAT Pre-Release Hotfix started.
notification-color: 17a2b8
timezone: America/Los_Angeles

create-builds:
name: create builds
needs: ci-cd-start-notification
Expand Down Expand Up @@ -124,8 +124,8 @@ jobs:
namespace: ${{ env.OPENSHIFT_TOOLS_NAMESPACE }}
- name: call scripts to deploy api and frontend
run: |
OC_JOB_NAME=${{github.event.inputs.HOTFIX_BRANCH}} &&./openshift/4.0/player.sh deploy api $DESTINATION -apply
OC_JOB_NAME=${{github.event.inputs.HOTFIX_BRANCH}} &&./openshift/4.0/player.sh deploy app $DESTINATION -apply
RELEASE_TAG=latest-${{github.event.inputs.HOTFIX_BRANCH}} && ./openshift/4.0/player.sh deploy api $DESTINATION -apply
RELEASE_TAG=latest-${{github.event.inputs.HOTFIX_BRANCH}} && ./openshift/4.0/player.sh deploy app $DESTINATION -apply
# the command:
# 1) creates an openshift job with generated name to avoid name conflict, substituting the variables in the template.
Expand All @@ -150,8 +150,8 @@ jobs:
run: |
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)
## Call the mayan sync task three times, once for each mayan sync endpoint. The task will wait for the job to complete before exiting.
## Note: this depends on the mayan-sync configmap for the target namespace being up to date.
## Call the mayan sync task three times, once for each mayan sync endpoint. The task will wait for the job to complete before exiting.
## Note: this depends on the mayan-sync configmap for the target namespace being up to date.
mayan-sync:
name: sync mayan
needs: database-upgrade
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
notification-summary: PIMS UAT Pre-Release Hotfix complete with status ${{ steps.check.outputs.status }}
notification-color: 17a2b8
timezone: America/Los_Angeles

cleanup-builds:
if: always()
name: cleanup builds
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: "16"
node-version: "20"

- name: Setup git
run: |
Expand Down
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
"request": "launch",
"console": "internalConsole",
"preLaunchTask": "build",
"program": "${workspaceRoot}/tools/keycloak/sync/bin/Debug/net6.0/Pims.Tools.Keycloak.Sync.dll",
"program": "${workspaceRoot}/tools/keycloak/sync/bin/Debug/net8.0/Pims.Tools.Keycloak.Sync.dll",
"cwd": "${workspaceRoot}/tools/keycloak/sync",
"stopAtEntry": false
},
{
"name": ".NET 6 Launch (api)",
"name": ".NET 8 Launch (api)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/source/backend/api/bin/Debug/net6.0/Pims.Api.dll",
"program": "${workspaceRoot}/source/backend/api/bin/Debug/net8.0/Pims.Api.dll",
"args": [],
"cwd": "${workspaceRoot}/source/backend/api",
"stopAtEntry": false,
Expand All @@ -32,7 +32,7 @@
}
},
{
"name": ".NET 6 Attach",
"name": ".NET 8 Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ refresh: | down build up ## Recreates local docker environment
.PHONY: infra
infra: ## Starts infrastructure containers (e.g. database, geoserver). Useful for local debugging
@echo "$(P) Starting up infrastructure containers..."
@"$(MAKE)" start n="database geoserver"
@"$(MAKE)" start n="database geoserver grafana prometheus"

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


frontend-lint:
@echo "$(P) Running lint:fix..."
Expand Down
26 changes: 24 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: "3.5"

services:

####################### Database #######################
database:
environment:
Expand Down Expand Up @@ -87,13 +86,36 @@ services:
restart: on-failure
container_name: psp-clamav
healthcheck:
test: [ "CMD", "./check.sh" ]
test: ["CMD", "./check.sh"]
interval: 60s
retries: 3
start_period: 120s
networks:
- psp

prometheus:
image: ubuntu/prometheus
container_name: psp-prometheus
ports:
- 9000:9090
environment:
- TZ=UTC
volumes:
- ./tools/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./tools/prometheus/alert-rules.yml:/etc/prometheus/alert-rules.yml
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- "--web.enable-lifecycle"

grafana:
image: grafana/grafana-oss
container_name: psp-grafana
restart: on-failure
ports:
- 4000:3000
depends_on:
- prometheus

####################### Networks Definition #######################
networks:
psp:
Expand Down
4 changes: 2 additions & 2 deletions openshift/4.0/templates/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Update the configuration file and set the appropriate parameters.
**Example**

```conf
BUILDIMAGE_NAME=nodejs-16
BUILDIMAGE_TAG=1-1
BUILDIMAGE_NAME=nodejs-20
BUILDIMAGE_TAG=1-34
RUNTIMEIMAGE_NAME=nginx-runtime
RUNTIMEIMAGE_TAG=dev
GIT_URL=https://github.com/bcgov/PSP.git
Expand Down
4 changes: 2 additions & 2 deletions openshift/4.0/templates/app/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ parameters:
- name: BUILDIMAGE_NAME
displayName: "Source Image Name"
description: "The image to use as the Builder Image."
value: "nodejs-16"
value: "nodejs-20"
- name: BUILDIMAGE_TAG
displayName: "Source Image Tag"
description: "The s2i image tag which is used to build the code."
value: "1-5"
value: "1-34"

- name: RUNTIMEIMAGE_NAME
displayName: "Source Image Name"
Expand Down
22 changes: 22 additions & 0 deletions openshift/4.0/templates/base-images/nodejs-20-ubi9.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
kind: ImageStream
apiVersion: image.openshift.io/v1
metadata:
name: nodejs-20
namespace: 3cd915-tools
annotations:
openshift.io/image.dockerRepositoryCheck: '2024-03-06T01:22:09Z'
description: ImageStream definitions for NodeJS 20
spec:
lookupPolicy:
local: false
tags:
- name: 1-34
annotations: null
from:
kind: DockerImage
name: 'registry.access.redhat.com/ubi9/nodejs-20:1-34'
generation: 1
importPolicy:
importMode: Legacy
referencePolicy:
type: Source
17 changes: 17 additions & 0 deletions openshift/4.0/templates/monitoring/sysdig-team.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: ops.gov.bc.ca/v1alpha1
kind: SysdigTeam
metadata:
name: 3cd915-sysdigteam
namespace: 3cd915-tools
spec:
team:
description: The Sysdig Team for the OpenShift Project Set PSP
users:
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
- name: [email protected]
role: ROLE_TEAM_EDIT
5 changes: 3 additions & 2 deletions source/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
ARG BUILD_CONFIGURATION=Release
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 443 8080

# Copy csproj and restore as distinct layers
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY *.sln .
COPY Directory.Build.props .
COPY api/*.csproj api/
COPY entities/*.csproj entities/
COPY apimodels/*.csproj apimodels/
COPY tests/core/*.csproj tests/core/
COPY tests/unit/api/*.csproj tests/unit/api/
COPY tests/unit/dal/*.csproj tests/unit/dal/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public AcquisitionFileController(IAcquisitionFileService acquisitionService, ICo
[Produces("application/json")]
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAcquisitionFile(long id)
{
// RECOMMENDED - Add valuable metadata to logs
Expand Down Expand Up @@ -109,6 +110,7 @@ public IActionResult GetLastUpdatedBy(long id)
[Produces("application/json")]
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult AddAcquisitionFile([FromBody] AcquisitionFileModel model, [FromQuery] string[] userOverrideCodes)
{
_logger.LogInformation(
Expand Down Expand Up @@ -136,6 +138,7 @@ public IActionResult AddAcquisitionFile([FromBody] AcquisitionFileModel model, [
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
[ProducesResponseType(typeof(ErrorResponseModel), 409)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult UpdateAcquisitionFile(long id, [FromBody] AcquisitionFileModel model, [FromQuery] string[] userOverrideCodes)
{
_logger.LogInformation(
Expand All @@ -161,6 +164,7 @@ public IActionResult UpdateAcquisitionFile(long id, [FromBody] AcquisitionFileMo
[Produces("application/json")]
[ProducesResponseType(typeof(AcquisitionFileModel), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult UpdateAcquisitionFileProperties([FromBody] AcquisitionFileModel acquisitionFileModel, [FromQuery] string[] userOverrideCodes)
{
var acquisitionFileEntity = _mapper.Map<Dal.Entities.PimsAcquisitionFile>(acquisitionFileModel);
Expand All @@ -177,6 +181,7 @@ public IActionResult UpdateAcquisitionFileProperties([FromBody] AcquisitionFileM
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<AcquisitionFilePropertyModel>), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAcquisitionFileProperties(long id)
{
var acquisitionFileProperties = _acquisitionService.GetProperties(id);
Expand All @@ -193,6 +198,7 @@ public IActionResult GetAcquisitionFileProperties(long id)
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<AcquisitionFileOwnerModel>), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAcquisitionFileOwners([FromRoute] long id)
{
var owners = _acquisitionService.GetOwners(id);
Expand All @@ -210,6 +216,7 @@ public IActionResult GetAcquisitionFileOwners([FromRoute] long id)
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<AcquisitionFileTeamModel>), 200)]
[SwaggerOperation(Tags = new[] { "acquisitionfile" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetAcquisitionTeamMembers()
{
var team = _acquisitionService.GetTeamMembers();
Expand Down Expand Up @@ -243,6 +250,7 @@ public IActionResult GetFileCompensations(long id)
[Produces("application/json")]
[ProducesResponseType(typeof(IEnumerable<CompensationFinancialModel>), 200)]
[SwaggerOperation(Tags = new[] { "comp-req-h120s" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult GetFileCompReqH120(long id, bool? finalOnly)
{
_logger.LogInformation(
Expand All @@ -269,6 +277,7 @@ public IActionResult GetFileCompReqH120(long id, bool? finalOnly)
[Produces("application/json")]
[ProducesResponseType(typeof(CompensationRequisitionModel), 201)]
[SwaggerOperation(Tags = new[] { "compensation-requisition" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult AddCompensationRequisition([FromRoute] long id, [FromBody] CompensationRequisitionModel compensationRequisition)
{
_logger.LogInformation(
Expand Down Expand Up @@ -323,6 +332,7 @@ public IActionResult GetAcquisitionFileExpropriationPayments([FromRoute] long id
[Produces("application/json")]
[ProducesResponseType(typeof(ExpropriationPaymentModel), 201)]
[SwaggerOperation(Tags = new[] { "expropriation-payments" })]
[TypeFilter(typeof(NullJsonResultFilter))]
public IActionResult AddExpropriationPayment([FromRoute] long id, [FromBody] ExpropriationPaymentModel expropriationPayment)
{
_logger.LogInformation(
Expand Down
Loading

0 comments on commit ef18e47

Please sign in to comment.