Skip to content

Commit

Permalink
Merge branch 'develop' into documentation/update-hpdidlookup-api-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bergomi02 authored Jul 11, 2024
2 parents dad17fe + dc620c8 commit 702cf91
Show file tree
Hide file tree
Showing 72 changed files with 63,497 additions and 2,715 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,4 @@ jobs:
-p WEB_PORT=8080 \
-p HPR_URL=healthpractitionerregistration.apps.silver.devops.gov.bc.ca \
-p MAUTH_URL=prod-mauth-${{secrets.OPENSHIFT_LICENSE_PLATE}}-prod.apps.silver.devops.gov.bc.ca \
-p DOCMAN_VOLUME_CAPACITY=7Gi \
-n ${{secrets.OPENSHIFT_LICENSE_PLATE}}-${{secrets.OPENSHIFT_ENVIRONMENT}} | oc apply -n ${{secrets.OPENSHIFT_LICENSE_PLATE}}-${{secrets.OPENSHIFT_ENVIRONMENT}} -f -
8 changes: 4 additions & 4 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,19 @@ jobs:

strategy:
matrix:
dotnet-version: ['5.0']
dotnet-version: ['8.0']

steps:
- uses: actions/checkout@v2

- name: set-date
run: |
echo "GIT_COMMITTED_AT=$(date +%s)" >> ${GITHUB_ENV}
- name: Setup .NET Core 5.0
- name: Setup .NET Core 8.0
uses: actions/setup-dotnet@v1
with:
# Semantic version range syntax or exact version of a dotnet version
dotnet-version: '5.0'
dotnet-version: '8.0'

- name: Install dependencies
run: |
Expand All @@ -100,7 +100,7 @@ jobs:
- name: Install ReportGenerator
run: |
cd ../
dotnet tool install -g dotnet-reportgenerator-globaltool --version 5.1.26
dotnet tool install -g dotnet-reportgenerator-globaltool --version 5.3.6
- uses: amancevice/setup-code-climate@v0
with:
Expand Down
14 changes: 14 additions & 0 deletions documentation/compositions/yaml/document-manager-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Document Manager (backend) Persistent Volume Claim
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ${SVC_NAME}-document-manager-pvc
namespace: ${OC_LICENSE_PLATE}-${OC_ENV}
labels:
app.kubernetes.io/part-of: ${SVC_NAME}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
82 changes: 82 additions & 0 deletions infrastructure/cron-jobs/refresh-materialized-view.cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
annotations:
description: Template for job to refresh materialized view
tags: cronjob
name: refresh-materialized-view-template
objects:
- apiVersion: batch/v1
kind: CronJob
metadata:
name: '${CRON_NAME}'
spec:
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- command:
- bash
- '-c'
- >-
#!/usr/bin/env bash
function refreshMaterializedView() {
echo -e "Refresh siteLastLog materialized view"
psql -h ${PGHOST} -d ${PGDATABASE} -U ${PGUSER} -c 'REFRESH MATERIALIZED VIEW siteLastLog;'
}
function main() {
echo -e "-------- STARTING CRON at $(date +"%B %d, %Y %T") UTC --------\n"
echo -e "Connecting to database host: _${PGHOST}_"
echo
refreshMaterializedView
}
main
env:
- name: PGHOST
value: ${SVC_NAME}-patroni
- name: PGDATABASE
valueFrom:
secretKeyRef:
name: ${SVC_NAME}-patroni-secret
key: app-db-name
# If working with model changes during PR, specify PR database, but don't merge hard-coding into `develop`
# - name: PGDATABASE
# value: prime-pr-1912
- name: PGUSER
valueFrom:
secretKeyRef:
name: ${SVC_NAME}-patroni-secret
key: app-db-username
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: ${SVC_NAME}-patroni-secret
key: app-db-password
image: >-
image-registry.apps.silver.devops.gov.bc.ca/9c33a9-tools/python-curl-psql:latest
limits:
cpu: 500m
memory: 2Gi
name: '${CRON_NAME}'
requests:
cpu: 100m
memory: 512Mi
resources: null
restartPolicy: Never
schedule: '${CRON_SCHEDULE}'
parameters:
- description: 'Cron-like schedule expression'
name: CRON_SCHEDULE
value: '0 11 * * *'
- name: CRON_NAME
value: refresh-materialized-view-cronjob
- description: 'Environment name'
name: SVC_NAME
value: dev
2 changes: 1 addition & 1 deletion infrastructure/fluentbit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Fluent-bit has its own configuration file that we can create using an OpenShift

### Fluent-bit for backend/webapi app

Our webapi app outputs logs to a directory (`/opt/app-root/app/logs/`) and the Fluent-bit container will mount this directory to a log-storage path. A [Fluent-bit configmap](./fluentbit-configmap.yaml) with the same configuration is used to read the log files `*.log` from mounted path, filter the log streams based on keyword `ERR` and output the logs to the PRIME Team's Slack channel.
Our webapi app outputs logs to a directory (`/opt/app-root/app/logs/`) and the Fluent-bit container will mount this directory to a log-storage path. A [Fluent-bit configmap](./fluentbit-configmap.yaml) with the same configuration is used to read the log files `*.log` from mounted path, filter the log streams based on keyword `ERR` and `FTL` and output the logs to the PRIME Team's Slack channel.

### create the configmaps for nginx and webapi apps using the [fluentbit-configmap template](./fluentbit-configmap.yaml)

Expand Down
24 changes: 19 additions & 5 deletions infrastructure/fluentbit/fluentbit-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,20 @@ objects:
# filter logs based on certain keyword(s)
name grep
match app
Logical_Op or
regex log error
regex log crit
regex log alert
regex log emerg
# In case fatal message happens
regex log fatal
[FILTER]
# Ignore "No such file or directory" error, exclude from fluentbit output
name grep
match app
Exclude log No\ssuch\sfile\sor\sdirectory
Exclude worker\sprocess\s\d+\sexited\son\ssignal\s9
[FILTER]
name parser
Expand All @@ -52,7 +65,7 @@ objects:
# add namespace
Record namespace ${NAMESPACE}
# add container name
Record product ${OC_ENV}-frontend
Record container ${OC_ENV}-frontend
[FILTER]
Name rewrite_tag
Expand Down Expand Up @@ -109,7 +122,9 @@ objects:
# filter logs based on certain keyword(s)
name grep
match app
regex log ERR
Logical_Op or
regex log \bERR\b
regex log FTL
[FILTER]
name parser
Expand All @@ -125,7 +140,7 @@ objects:
# add namespace
Record namespace ${NAMESPACE}
# add container name
Record product ${OC_ENV}-webapi
Record container ${OC_ENV}-webapi
[FILTER]
Name rewrite_tag
Expand All @@ -148,9 +163,8 @@ objects:
[PARSER]
Name parser
Format regex
Regex \[(?<timestamp>\d{2}:\d{2}:\d{2})(?<level>.*)]\ (?<message>.*)
Regex \[(?<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})(?<level>.*)]\ (?<message>.*)
Time_Key time
Time_Format %H:%M:%S
parameters:
- name: APP_NAME
Expand Down
19 changes: 0 additions & 19 deletions infrastructure/prime-app-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ parameters:
description: Development or Production
required: true
value: Development
- name: DOCMAN_VOLUME_CAPACITY
displayName: Document Manager Persistent Volume Capacity
description: Volume space available for Document Manager Backend data e.g. 512Mi, 2Gi.
required: true
value: 5Gi
- name: WEB_PORT
displayName: Web Port for NGINX
description: Termination port on NGINX (8080 or 8443)
Expand Down Expand Up @@ -1037,20 +1032,6 @@ objects:
targetPort: 6001
selector:
name: ${SVC_NAME}-document-manager
# Document Manager (backend) Persistent Volume Claim
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ${SVC_NAME}-document-manager-pvc
namespace: ${OC_LICENSE_PLATE}-${OC_ENV}
labels:
app.kubernetes.io/part-of: ${SVC_NAME}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: ${DOCMAN_VOLUME_CAPACITY}

###########################################
### Redis ###
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
</mat-chip-list>
</th>
<td class="d-flex justify-content-between">
<div>{{ item.content }}</div>
<div>
<pre>{{ item.content }}</pre>
</div>
<div class="margin-right">{{ item?.marginRight | capitalize: true }}</div>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ div.margin-right {
font-size: smaller;
color: theme-palette(grey, light);
}

pre {
font-family: Roboto, Helvetica Neue, sans-serif;
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ <h6 class="mb-0">
<ng-container #alertContent
class="alert-content">
Your enrolment contains an error that will need to be updated before submission.
<ul class="mt-3 mb-1"
*ngIf="requireLicenceUpdate()">
<li>
College licence information requires update
</li>
</ul>
</ng-container>
</app-alert>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ export class OverviewComponent extends BaseEnrolmentPage implements OnInit {
return (this.enrolmentErrors) ? Object.values(this.enrolmentErrors).some(value => value) : false;
}

public requireLicenceUpdate(): boolean {
return (this.enrolmentErrors) ? this.enrolmentErrors.requiresLicenceUpdate : false;
}

public ngOnInit(): void {
this.isMatchingPaperEnrollee = this.enrolmentService.isMatchingPaperEnrollee;
this.authService.getUser$()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
rows="10"
formControlName="note"></textarea>
<mat-hint [ngClass]="{ 'text-green': !!note.value }">
{{ (note.value) ? 'Your note will be saved upon submission.' : 'A note is required when assigning.' }}
{{ (note.value) ? 'Your note will be saved upon submission.' : '' }}
</mat-hint>
</mat-form-field>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class ClaimNoteComponent implements OnInit {
value: '',
disabled: false,
},
[Validators.required]
[]
]
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,9 @@
</app-enrollee-property>

<app-enrollee-property [hasError]="enrolmentErrors?.requiresLicenceUpdate"
errorMessage="Licence class requires update."
errorMessage="College licence information requires update."
title="Licence Class">
{{ getLicenceClassCategory(certification) }}
{{ certification.licenseCode | configCode: 'licenses' | default }}
</app-enrollee-property>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { RemoteAccessLocation } from '@enrolment/shared/models/remote-access-loc
import { EnrolmentService } from '@enrolment/shared/services/enrolment.service';
import { UnlistedCertification } from '@paper-enrolment/shared/models/unlisted-certification.model';
import { EnrolleeDeviceProvider } from '@shared/models/enrollee-device-provider.model';
import { ConfigService } from '@config/config.service';

@Component({
selector: 'app-enrollee-review',
Expand All @@ -38,7 +39,8 @@ export class EnrolleeReviewComponent {

constructor(
private authService: AuthService,
private enrolmentService: EnrolmentService
private enrolmentService: EnrolmentService,
private configService: ConfigService,
) {
this.showEditRedirect = false;
this.admin = false;
Expand Down Expand Up @@ -118,6 +120,16 @@ export class EnrolleeReviewComponent {
return (healthAuthorities?.length) ? healthAuthorities : [];
}

public getLicenceClassCategory(certification: CollegeCertification): string {
let grouping = this.configService.licenses.find(l => l.code === certification.licenseCode).collegeLicenses.map(cl => cl.collegeLicenseGroupingCode);

if (grouping && grouping.length > 0 && grouping[0]) {
return `${this.configService.collegeLicenseGroupings.find(g => g.code === grouping[0]).name} - `;
} else {
return '';
}
}

public get isRequestingRemoteAccess(): boolean {
return (this.enrolment && !!this.enrolment.enrolleeRemoteUsers?.length);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { CollegeLicenceClassEnum } from '@shared/enums/college-licence-class.enu
import { PrescriberIdTypeEnum } from '@shared/enums/prescriber-id-type.enum';
import { CollegeCertification } from '@enrolment/shared/models/college-certification.model';
import { EnrolmentService } from '@enrolment/shared/services/enrolment.service';
import { NurseGrouping } from '@shared/enums/college-licence-grouping.enum';

@Component({
selector: 'app-college-certification-form',
Expand Down Expand Up @@ -60,6 +61,8 @@ export class CollegeCertificationFormComponent implements OnInit {
public CollegeLicenceClassEnum = CollegeLicenceClassEnum;
public PrescriberIdTypeEnum = PrescriberIdTypeEnum;

public nurseGrouping = NurseGrouping;

constructor(
private configService: ConfigService,
private viewportService: ViewportService,
Expand Down Expand Up @@ -172,7 +175,7 @@ export class CollegeCertificationFormComponent implements OnInit {
}

public showLicenceClass(): boolean {
return this.filteredLicenses.some(l => l.name !== 'Not Displayed');
return this.filteredLicenses && this.filteredLicenses.some(l => l.name !== 'Not Displayed');
}

/**
Expand Down Expand Up @@ -232,7 +235,9 @@ export class CollegeCertificationFormComponent implements OnInit {
)
)
.subscribe((collegeLicenseGroupingCode: number) => {
this.setNursingCategoryValidators();
if (this.nurseGrouping.some(g => g === collegeLicenseGroupingCode)) {
this.setNursingCategoryValidators();
}
this.loadLicensesByCategory(collegeLicenseGroupingCode);
});
} else {
Expand All @@ -253,6 +258,7 @@ export class CollegeCertificationFormComponent implements OnInit {
}
}


private setCollegeCertification(collegeCode: number): void {
if (!collegeCode) {
this.removeValidations();
Expand Down
Loading

0 comments on commit 702cf91

Please sign in to comment.