Skip to content

Commit 2b36c86

Browse files
authored
Merge pull request #1377 from bcgov/dev
KC26, Cypress tests for email notifications
2 parents 9ec8b25 + 99904fc commit 2b36c86

File tree

101 files changed

+33017
-53911
lines changed

Some content is hidden

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

101 files changed

+33017
-53911
lines changed

.dockerignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
src/node_modules
21
src/.npm
32
src/_tmp
43
src/.cache
54
src/.config
65
src/.nyc_output
76
src/dist
87
**/.next
9-
_data
8+
_data
9+
**/node_modules
10+
__coverage__

.env.local

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,16 @@ GWA_RES_SVR_CLIENT_ID=gwa-api
2020
GWA_RES_SVR_CLIENT_SECRET=18900468-3db1-43f7-a8af-e75f079eb742
2121
KEYCLOAK_AUTH_URL=http://keycloak.localtest.me:9081/auth
2222
KEYCLOAK_REALM=master
23-
EMAIL_ENABLED=false
23+
EMAIL_ENABLED=true
24+
EMAIL_HOST=mailpit.localtest.me
25+
EMAIL_PORT=1025
26+
EMAIL_SECURE=false
27+
EMAIL_FROM=noreply@api.gov.bc.ca
28+
EMAIL_USER=
29+
EMAIL_PASS=
2430
EXTERNAL_URL=http://oauth2proxy.localtest.me:4180
2531
OIDC_ISSUER=http://keycloak.localtest.me:9081/auth/realms/master
32+
OIDC_CLIENT_ID=aps-portal
2633
LOCAL_ENV=true
2734
WORKING_PATH=/tmp
2835
DESTINATION_URL=

.github/workflows/aps-cypress-e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
- name: Build GWA API Image
2727
run: |
28-
git clone https://github.com/bcgov/gwa-api.git --branch v1.0.47
28+
git clone https://github.com/bcgov/gwa-api.git --branch dev
2929
cd gwa-api/microservices/gatewayApi
3030
docker build -t gwa-api:e2e .
3131

.github/workflows/ci-build-deploy.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
username: ${{ env.REGISTRY_USERNAME }}
5555
password: ${{ env.REGISTRY_PASSWORD }}
5656

57-
- uses: actions/cache@v3
57+
- uses: actions/cache@v4
5858
with:
5959
path: /tmp/.buildx-cache
6060
key: ${{ runner.os }}-buildx-${{ github.sha }}
@@ -318,6 +318,9 @@ jobs:
318318
- name: X-Forwarded-Access-Token
319319
values:
320320
- claim: access_token
321+
- name: X-Forwarded-Id-Token
322+
values:
323+
- claim: IDToken
321324
injectResponseHeaders: []
322325
metricsServer:
323326
BindAddress: ""
@@ -394,6 +397,8 @@ jobs:
394397
secure: true
395398
OIDC_ISSUER:
396399
value: '${{ secrets.OIDC_ISSUER }}'
400+
OIDC_CLIENT_ID:
401+
value: '${{ secrets.OIDC_CLIENT_ID }}'
397402
JWKS_URL:
398403
value: '${{ secrets.OIDC_ISSUER }}/protocol/openid-connect/certs'
399404
EXTERNAL_URL:

.github/workflows/ci-build-feeders.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
username: ${{ env.REGISTRY_USERNAME }}
3939
password: ${{ env.REGISTRY_PASSWORD }}
4040

41-
- uses: actions/cache@v3
41+
- uses: actions/cache@v4
4242
with:
4343
path: /tmp/.buildx-cache
4444
key: ${{ runner.os }}-buildx-${{ github.sha }}

.github/workflows/ci-build-only.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
username: ${{ env.REGISTRY_USERNAME }}
4747
password: ${{ env.REGISTRY_PASSWORD }}
4848

49-
- uses: actions/cache@v3
49+
- uses: actions/cache@v4
5050
with:
5151
path: /tmp/.buildx-cache
5252
key: ${{ runner.os }}-buildx-${{ github.sha }}

.github/workflows/ci-feat-sonar.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,14 @@ jobs:
4848
docker compose down
4949
5050
- name: SonarCloud Scan
51-
uses: sonarsource/sonarqube-scan-action@master
51+
uses: sonarsource/sonarqube-scan-action@v6
52+
with:
53+
args: >
54+
-Dsonar.organization=bcgov-sonarcloud
55+
-Dsonar.projectKey=bcgov_api-services-portal
56+
-Dsonar.sources=src/auth,src/authz,src/batch,src/services
57+
-Dsonar.javascript.lcov.reportPaths=./src/__coverage__/lcov.info
5258
env:
5359
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5460
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
61+
SONAR_HOST_URL: https://sonarcloud.io

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
echo "::set-output name=APP_REVISION::${GITHUB_SHA}"
4545
id: set-deploy-id
4646

47-
- uses: actions/cache@v3
47+
- uses: actions/cache@v4
4848
with:
4949
path: /tmp/.buildx-cache
5050
key: ${{ runner.os }}-buildx-${{ github.sha }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v16.15.1
1+
v22.21.1

docker-compose.yml

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,52 @@ secrets:
1111

1212
services:
1313
keycloak:
14-
image: quay.io/keycloak/keycloak:15.1.1
14+
image: keycloak-quarkus:e2e
1515
container_name: keycloak
16-
hostname: keycloak
16+
build:
17+
context: local/keycloak
18+
dockerfile: Dockerfile
19+
args:
20+
- KC_VERSION=${KC_VERSION:-26.5.3}
1721
depends_on:
1822
kong-db:
1923
condition: service_healthy
24+
environment:
25+
KC_BOOTSTRAP_ADMIN_USERNAME: admin
26+
KC_BOOTSTRAP_ADMIN_PASSWORD: local
27+
# Keycloak 26 Hostname v2: --hostname accepts full URL (host + port + path).
2028
command:
2129
[
22-
'-b',
23-
'0.0.0.0',
24-
'-Djboss.socket.binding.port-offset=1001',
25-
'-Dkeycloak.migration.action=import',
26-
'-Dkeycloak.migration.provider=singleFile',
27-
'-Dkeycloak.migration.file=/tmp/realm-config/master-realm.json',
28-
'-Dkeycloak.migration.strategy=OVERWRITE_EXISTING',
29-
'-Dkeycloak.profile.feature.upload_scripts=enabled',
30+
"start",
31+
"--optimized",
32+
"--hostname",
33+
"http://keycloak.localtest.me:9081/auth",
34+
"--db-url",
35+
"jdbc:postgresql://kong-db/${KEYCLOAK_DB_NAME:-keycloak}",
36+
"--db-username",
37+
"keycloakuser",
38+
"--db-password",
39+
"keycloakuser",
40+
"--http-enabled",
41+
"true",
42+
"--http-port",
43+
"9081",
44+
"--import-realm",
3045
]
31-
ports:
32-
- 9081:9081/tcp
33-
environment:
34-
#KEYCLOAK_USER: local
35-
#KEYCLOAK_PASSWORD: local
36-
DB_VENDOR: POSTGRES
37-
DB_SCHEMA: public
38-
DB_ADDR: kong-db:5432
39-
DB_USER: keycloakuser
40-
DB_PASSWORD: keycloakuser
4146
volumes:
42-
- ./local/keycloak/master-realm.json:/tmp/realm-config/master-realm.json
47+
- ./local/keycloak/master-realm.json:/opt/keycloak/data/import/master-realm.json
48+
ports:
49+
- 9081:9081
50+
- 9000:9000
4351
networks:
4452
aps-net:
4553
aliases:
4654
- keycloak.localtest.me
55+
healthcheck:
56+
test: timeout 10s bash -c ':> /dev/tcp/localhost/9081'
57+
interval: 5s
58+
timeout: 5s
59+
retries: 5
4760
oauth2-proxy:
4861
image: quay.io/oauth2-proxy/oauth2-proxy:v7.8.1
4962
container_name: oauth2-proxy
@@ -62,7 +75,7 @@ services:
6275
- oauth2proxy.localtest.me
6376
apsportal:
6477
container_name: apsportal
65-
image: apsportal:latest
78+
image: apsportal:${APSPORTAL_TAG:-latest}
6679
depends_on:
6780
- keycloak
6881
build:
@@ -198,7 +211,7 @@ services:
198211
aliases:
199212
- redis-master
200213
gwa-api:
201-
image: gwa-api:e2e
214+
image: gwa-api:${GWA_API_TAG:-e2e}
202215
container_name: gwa-api
203216
entrypoint: sh -c "chmod +x /tmp/gwa/entrypoint.sh && sh /tmp/gwa/entrypoint.sh"
204217
ports:
@@ -289,5 +302,17 @@ services:
289302
profiles:
290303
- testsuite
291304

305+
mailpit:
306+
image: axllent/mailpit:latest
307+
container_name: mailpit
308+
restart: unless-stopped
309+
ports:
310+
- '1025:1025' # SMTP port for receiving emails
311+
- '8025:8025' # Web UI for viewing emails
312+
networks:
313+
aps-net:
314+
aliases:
315+
- mailpit.localtest.me
316+
292317
networks:
293318
aps-net: {}

0 commit comments

Comments
 (0)