Skip to content

Commit 77509d0

Browse files
authored
Merge pull request #1356 from bcgov/dev
Pre-defined patterns, remove services from directory response
2 parents 2f3e61c + 652193b commit 77509d0

File tree

60 files changed

+909
-383
lines changed

Some content is hidden

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

60 files changed

+909
-383
lines changed

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

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

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121

22+
- name: Install deps
23+
run: |
24+
sudo apt update
25+
2226
- uses: actions/setup-node@v2
2327
with:
24-
node-version: '14'
28+
node-version: '22'
2529

2630
- name: Run Tests
2731
run: |
@@ -36,7 +40,7 @@ jobs:
3640
3741
cd src
3842
39-
npm i
43+
npm i --legacy-peer-deps
4044
npm run intg-build
4145
npm test
4246
@@ -45,13 +49,6 @@ jobs:
4549
4650
- name: SonarCloud Scan
4751
uses: sonarsource/sonarqube-scan-action@master
48-
with:
49-
args: >
50-
-Dsonar.organization=bcgov-oss
51-
-Dsonar.projectKey=aps-portal
52-
-Dsonar.host.url=https://sonarcloud.io
53-
-Dsonar.sources=src/auth,src/authz,src/batch,src/services
54-
-Dsonar.javascript.lcov.reportPaths=./src/__coverage__/lcov.info
5552
env:
5653
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5754
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,12 @@ Use the following configuration to run the Portal locally (outside of Docker) ag
7272
1. Start the OAuth2 Proxy locally:
7373

7474
```sh
75+
# mac
7576
hostip=$(ifconfig en0 | awk '$1 == "inet" {print $2}')
7677

78+
# WSL
79+
hostip=$(hostname -I | awk '{print $1}')
80+
7781
docker run -ti --rm --name proxy --net=host \
7882
--add-host portal.localtest.me:$hostip \
7983
-v `pwd`/local/oauth2-proxy/oauth2-proxy-dev.yaml:/oauth2.yaml \

docker-compose.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.8'
2-
31
x-common-variables: &common-variables
42
KONG_DATABASE: postgres
53
KONG_PG_DATABASE: kong
@@ -13,7 +11,8 @@ services:
1311
container_name: keycloak
1412
hostname: keycloak
1513
depends_on:
16-
- kong-db
14+
kong-db:
15+
condition: service_healthy
1716
command:
1817
[
1918
'-b',
@@ -103,7 +102,7 @@ services:
103102
networks:
104103
- aps-net
105104
kong-db:
106-
image: postgres:12.8
105+
image: postgres:14
107106
container_name: kong-db
108107
environment:
109108
POSTGRES_USER: postgres
@@ -115,13 +114,19 @@ services:
115114
volumes:
116115
- ./local/db/database-init.sql:/docker-entrypoint-initdb.d/1-init.sql
117116
- ./local/db/keystone-init.sql:/docker-entrypoint-initdb.d/2-init.sql
117+
healthcheck:
118+
test: ["CMD-SHELL", "pg_isready -U postgres"]
119+
interval: 5s
120+
timeout: 5s
121+
retries: 10
118122
networks:
119123
- aps-net
120124
kong-migrations:
121125
image: kong:kong-local
122126
command: kong migrations bootstrap
123127
depends_on:
124-
- kong-db
128+
kong-db:
129+
condition: service_healthy
125130
environment:
126131
<<: *common-variables
127132
KONG_DNS_ORDER: 'LAST,A'
@@ -135,8 +140,10 @@ services:
135140
image: kong:kong-local
136141
command: kong migrations up && kong migrations finish
137142
depends_on:
138-
- kong-db
139-
- kong-migrations
143+
kong-db:
144+
condition: service_healthy
145+
kong-migrations:
146+
condition: service_completed_successfully
140147
environment:
141148
<<: *common-variables
142149
KONG_DNS_ORDER: 'LAST,A'
@@ -216,15 +223,15 @@ services:
216223
entrypoint: sh -c "chmod +x /tmp/entrypoint.sh && /tmp/entrypoint.sh"
217224
environment:
218225
- BROWSER=edge
219-
- CYPRESS_RECORD_KEY=${CY_RECORD_KEY}
220-
- CYPRESS_PROJECT_ID=${CY_PROJECT_ID}
221-
- RUN_ENV=${CY_EXECUTION_ENV}
222-
- COMMIT_INFO_BRANCH=${CY_COMMIT_BRANCH}
223-
- COMMIT_INFO_SHA=${CY_COMMIT_SHA}
224-
- COMMIT_INFO_AUTHOR=${CY_COMMIT_AUTHOR}
225-
- COMMIT_INFO_MESSAGE=${CY_COMMIT_MESSAGE}
226-
- COMMIT_INFO_REMOTE=${CY_REPO_URL}
227-
- COMMIT_INFO_EMAIL=${CY_COMMIT_AUTHOR_EMAIL}
226+
- CYPRESS_RECORD_KEY=${CY_RECORD_KEY:-}
227+
- CYPRESS_PROJECT_ID=${CY_PROJECT_ID:-}
228+
- RUN_ENV=${CY_EXECUTION_ENV:-}
229+
- COMMIT_INFO_BRANCH=${CY_COMMIT_BRANCH:-}
230+
- COMMIT_INFO_SHA=${CY_COMMIT_SHA:-}
231+
- COMMIT_INFO_AUTHOR=${CY_COMMIT_AUTHOR:-}
232+
- COMMIT_INFO_MESSAGE=${CY_COMMIT_MESSAGE:-}
233+
- COMMIT_INFO_REMOTE=${CY_REPO_URL:-}
234+
- COMMIT_INFO_EMAIL=${CY_COMMIT_AUTHOR_EMAIL:-}
228235
depends_on:
229236
- feeder-seeding
230237
build:

e2e/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM cypress/included:12.17.4
1+
FROM cypress/included:13.17.0
22

33
# Copy of the source for code coverage analysis
44
WORKDIR /app
@@ -22,7 +22,7 @@ COPY e2e/*.yml /e2e
2222
COPY e2e/entrypoint.sh /tmp
2323
ADD e2e/cypress /e2e/cypress
2424

25-
RUN curl -v -L -O https://github.com/bcgov/gwa-cli/releases/download/v3.0.5/gwa_Linux_x86_64.tgz \
25+
RUN curl -v -L -O https://github.com/bcgov/gwa-cli/releases/download/v3.0.6/gwa_Linux_x86_64.tgz \
2626
&& tar -xzf gwa_Linux_x86_64.tgz \
2727
&& mv gwa /usr/local/bin/.
2828

e2e/cypress.config.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export default defineConfig({
1515
// You may want to clean this up later by importing these.
1616
setupNodeEvents(on, config) {
1717
require('dotenv').config()
18-
require('@cypress/code-coverage/task')(on, config)
18+
// Only enable code coverage in CI or when explicitly enabled
19+
if (process.env.CI || process.env.ENABLE_COVERAGE === 'true') {
20+
require('@cypress/code-coverage/task')(on, config)
21+
}
1922

2023
// // It's IMPORTANT to return the config object
2124
// // with any changed environment variables
@@ -26,7 +29,7 @@ export default defineConfig({
2629
'./cypress/tests/07-*/*.ts',
2730
'./cypress/tests/03-*/*.ts',
2831
'./cypress/tests/04-*/*.ts',
29-
// './cypress/tests/05-*/*.ts',
32+
'./cypress/tests/05-*/*.ts',
3033
'./cypress/tests/08-*/*.ts',
3134
'./cypress/tests/09-*/*.ts',
3235
'./cypress/tests/10-*/*.ts',
@@ -74,6 +77,10 @@ export default defineConfig({
7477
WEBAPP_URL: 'http://html-sample-app.localtest.me:4242',
7578
DEV_USERNAME: 'janis@idir',
7679
DEV_PASSWORD: 'awsummer',
80+
HAS_KUBE_API: false,
81+
// Pass CI flag to browser context for code coverage
82+
CI: process.env.CI || false,
83+
ENABLE_COVERAGE: process.env.ENABLE_COVERAGE || false,
7784
},
7885
retries: {
7986
runMode: 2,

e2e/cypress/fixtures/cc-service-gwa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
- name: cc-service-for-platform
3-
host: httpbin.org
3+
host: httpbun.com
44
tags: [ns.ccplatform]
55
port: 443
66
protocol: https

e2e/cypress/fixtures/cc-service.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
- name: cc-service-for-platform
3-
host: httpbin.org
3+
host: httpbun.com
44
tags: [ns.ccplatform]
55
port: 443
66
protocol: https

e2e/cypress/fixtures/org-service.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
- name: a-service-for-orgassignment
3-
host: httpbin.org
3+
host: httpbun.com
44
tags: [ns.orgassignment]
55
port: 443
66
protocol: https

e2e/cypress/fixtures/service-api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
- name: service-for-apiplatform
3-
host: httpbin.org
3+
host: httpbun.com
44
tags: [ns.apiplatform]
55
port: 443
66
protocol: https

0 commit comments

Comments
 (0)