Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Pipeline Updates #502

Merged
merged 82 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
811d723
Setting version number
barrfalk Jul 4, 2024
5e38ef8
Updating pipeline
barrfalk Jul 8, 2024
52b1406
restructured migrations
barrfalk Jul 8, 2024
ff9712f
fixing variable secrets
barrfalk Jul 8, 2024
4d4bf48
Update secret.yaml
barrfalk Jul 8, 2024
78ea45f
Update values.yaml
barrfalk Jul 8, 2024
0a8255f
secret updates
barrfalk Jul 8, 2024
3f17000
Update secret.yaml
barrfalk Jul 8, 2024
df1c459
Update secret.yaml
barrfalk Jul 8, 2024
b2f2723
secrets
barrfalk Jul 8, 2024
4fd9ec1
Update scheduled.yml
barrfalk Jul 9, 2024
cd6a800
Update Dockerfile
barrfalk Jul 9, 2024
7e46454
Update deployment.yaml
barrfalk Jul 11, 2024
d5c89b7
Conflicts
barrfalk Jul 11, 2024
3d2c06b
Merge branch 'main' into feat/CE-843---Pipeline-Updates
barrfalk Jul 11, 2024
8543e98
Update deployment.yaml
barrfalk Jul 11, 2024
d5677b8
Update secret.yaml
barrfalk Jul 11, 2024
60380ac
Update Caddyfile
barrfalk Jul 11, 2024
f61fe16
Updates to secret structure
barrfalk Jul 11, 2024
cc43e7c
Update secret.yaml
barrfalk Jul 11, 2024
4990988
Update secret.yaml
barrfalk Jul 11, 2024
f8fa788
Update secret.yaml
barrfalk Jul 12, 2024
15666c1
Update .tests.yml
barrfalk Jul 12, 2024
9b57883
Update Caddyfile
barrfalk Jul 12, 2024
fcee31e
Update openshift.deploy.yml
barrfalk Jul 12, 2024
432036d
Update deployment.yaml
barrfalk Jul 12, 2024
ffbfaf4
Cleaned up secrests
barrfalk Jul 12, 2024
bfeb392
Update values.yaml
barrfalk Jul 12, 2024
97e0570
NODE_TLS Updates
barrfalk Jul 12, 2024
1cfce54
Update secret.yaml
barrfalk Jul 12, 2024
2d79778
case management api url
barrfalk Jul 12, 2024
b0f7a6b
Update secret.yaml
barrfalk Jul 12, 2024
34eba70
Update values.yaml
barrfalk Jul 12, 2024
e786503
Update secret.yaml
barrfalk Jul 12, 2024
494dcaa
Update secret.yaml
barrfalk Jul 12, 2024
7b14538
Fixing case management and logging variables
barrfalk Jul 12, 2024
9115aa7
Update values.yaml
barrfalk Jul 12, 2024
f013526
Reverting case management changes
barrfalk Jul 12, 2024
b72d682
Fixing case management variables
barrfalk Jul 12, 2024
ada0d6f
jwks and case management Urls are now populated via secrets
barrfalk Jul 12, 2024
3872b57
Update knp.yaml
barrfalk Jul 12, 2024
7725839
Update knp.yaml
barrfalk Jul 12, 2024
123dda2
Delete knp.yaml
barrfalk Jul 12, 2024
213e1c5
debugging auth error
barrfalk Jul 12, 2024
322e397
Missing test flyway migrations
barrfalk Jul 12, 2024
f2ee64a
Update Dockerfile
barrfalk Jul 12, 2024
1c8181d
Flyway fixes
barrfalk Jul 12, 2024
8792cec
Moving cypress test location to match Ministry template
barrfalk Jul 13, 2024
cf7ae8b
Revert "Moving cypress test location to match Ministry template"
barrfalk Jul 13, 2024
fb51a91
Restructuring cypress tests
barrfalk Jul 13, 2024
95efc57
Update .tests.yml
barrfalk Jul 13, 2024
bd7d1d6
Update .tests.yml
barrfalk Jul 13, 2024
90762db
Update .tests.yml
barrfalk Jul 13, 2024
e1b7bf8
Update .tests.yml
barrfalk Jul 13, 2024
533e3e6
Update .tests.yml
barrfalk Jul 13, 2024
c4a23a0
Update .tests.yml
barrfalk Jul 13, 2024
c9482ec
Update pr-open.yml
barrfalk Jul 13, 2024
0bf6467
Added webeoc
barrfalk Jul 13, 2024
dee11ad
Update values.yaml
barrfalk Jul 13, 2024
ff8b2e1
Update webeoc-complaints-scheduler.service.ts
barrfalk Jul 13, 2024
16dc773
Update webeoc-complaints-scheduler.service.ts
barrfalk Jul 13, 2024
4eea66d
Fixing natsHost
barrfalk Jul 13, 2024
0d9d45b
deployments order
barrfalk Jul 13, 2024
e6514f9
Update deployment.yaml
barrfalk Jul 13, 2024
d07f706
Update deployment.yaml
barrfalk Jul 13, 2024
a8ec306
Update secret.yaml
barrfalk Jul 13, 2024
746eb4f
Cleanup
barrfalk Jul 15, 2024
215ee14
Update deployment.yaml
barrfalk Jul 15, 2024
3a111e3
Update deployment.yaml
barrfalk Jul 15, 2024
afbc49b
Update deployment.yaml
barrfalk Jul 15, 2024
0ec9cb4
Update deployment.yaml
barrfalk Jul 15, 2024
f424d81
Update deployment.yaml
barrfalk Jul 15, 2024
1467ba1
flyway locations
barrfalk Jul 15, 2024
412041f
Update values.yaml
barrfalk Jul 15, 2024
7cbbd3d
Update deployment.yaml
barrfalk Jul 15, 2024
872d8a5
Update values.yaml
barrfalk Jul 15, 2024
7041270
Update values.yaml
barrfalk Jul 15, 2024
a2d35c1
Removed duplicated migrations folder
barrfalk Jul 15, 2024
009940e
Cleaned up migrations folders and docker-compose
barrfalk Jul 15, 2024
9ef7128
Added automountServiceAccountToken: false
barrfalk Jul 15, 2024
c4e73fe
Removed useless directory
barrfalk Jul 15, 2024
0eef03f
AutomountToken: false - Round 2
barrfalk Jul 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/graphics/analysis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/graphics/branch-protection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/graphics/merge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/graphics/packages.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added .github/graphics/pr-close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/graphics/pr-open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/graphics/pr-validate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/graphics/scheduled.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/graphics/schemaspy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/graphics/template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions .github/workflows/.tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: .Tests

on:
workflow_call:
inputs:
### Required
target:
description: PR number, test or prod
required: true
type: string

### Typical / recommended
triggers:
description: Bash array to diff for build triggering; omit to always fire
required: false
type: string

env:
DOMAIN: apps.silver.devops.gov.bc.ca
PREFIX: ${{ github.event.repository.name }}-${{ inputs.target }}

jobs:
integration-tests:
name: Integration
runs-on: ubuntu-22.04
timeout-minutes: 1
steps:
- uses: actions/checkout@v4
- id: cache-npm
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-build-cache-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-cache-node-modules-
${{ runner.os }}-build-
${{ runner.os }}-

- env:
API_NAME: nest
BASE_URL: https://${{ github.event.repository.name }}-${{ inputs.target }}-frontend.${{ env.DOMAIN }}
run: |
cd tests/integration
npm ci
node src/main.js

e2e-tests:
name: E2E
defaults:
run:
working-directory: frontend
runs-on: ubuntu-22.04
timeout-minutes: 5
strategy:
matrix:
project: [Microsoft Edge]
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: actions/setup-node@v4
name: Setup Node
with:
node-version: 20
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: |
npm ci
npx playwright install --with-deps

- name: Run Tests
env:
E2E_BASE_URL: https://${{ github.event.repository.name }}-${{ inputs.target }}-frontend.${{ env.DOMAIN }}/
CI: "true"
run: |
npx playwright test --project="${{ matrix.project }}" --reporter=html

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
name: upload results
with:
name: playwright-report-${{ matrix.project }}
path: "./frontend/playwright-report" # path from current folder
retention-days: 7

load-tests:
name: Load
runs-on: ubuntu-22.04
strategy:
matrix:
name: [backend, frontend]
steps:
- uses: actions/checkout@v4
- uses: grafana/[email protected]
env:
BACKEND_URL: https://${{ env.PREFIX }}-frontend.${{ env.DOMAIN }}/api
FRONTEND_URL: https://${{ env.PREFIX }}-frontend.${{ env.DOMAIN }}
with:
filename: ./tests/load/${{ matrix.name }}-test.js
flags: --vus 10 --duration 30s
89 changes: 89 additions & 0 deletions .github/workflows/analysis.yml
afwilcox marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Analysis

on:
push:
branches: [main]
pull_request:
types: [opened, reopened, synchronize, ready_for_review, converted_to_draft]
schedule:
- cron: "0 11 * * 0" # 3 AM PST = 12 PM UDT, runs sundays
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: Tests
if: ${{ ! github.event.pull_request.draft }}
runs-on: ubuntu-22.04
timeout-minutes: 5
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
strategy:
matrix:
dir: [backend, frontend]
include:
- dir: backend
token: SONAR_TOKEN_BACKEND
- dir: frontend
token: SONAR_TOKEN_FRONTEND
steps:
- uses: bcgov-nr/[email protected]
with:
commands: |
npm ci
npm run test:cov
dir: ${{ matrix.dir }}
node_version: "22"
sonar_args: >
-Dsonar.exclusions=**/coverage/**,**/node_modules/**,**/*spec.ts
-Dsonar.organization=bcgov-sonarcloud
-Dsonar.projectKey=quickstart-openshift_${{ matrix.dir }}
-Dsonar.sources=src
-Dsonar.tests.inclusions=**/*spec.ts
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
sonar_token: ${{ secrets[matrix.token] }}
triggers: ('${{ matrix.dir }}/')

# https://github.com/marketplace/actions/aqua-security-trivy
trivy:
name: Trivy Security Scan
if: ${{ ! github.event.pull_request.draft }}
runs-on: ubuntu-22.04
timeout-minutes: 1
steps:
- uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/[email protected]
with:
format: "sarif"
output: "trivy-results.sarif"
ignore-unfixed: true
scan-type: "fs"
scanners: "vuln,secret,config"
severity: "CRITICAL,HIGH"

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"

results:
name: Analysis Results
needs: [tests, trivy]
runs-on: ubuntu-22.04
steps:
- run: echo "Success!"

6 changes: 6 additions & 0 deletions .github/workflows/deploy-nats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ jobs:
run: |
RELEASE_NAME=${{ github.event.repository.name }}-${{ github.event.number }}-nats
oc label statefulset $RELEASE_NAME app=${{ github.event.repository.name }}-${{ github.event.number }}
- name: Label NATS PVCs
run: |
RELEASE_NAME=${{ github.event.repository.name }}-${{ github.event.number }}-nats
for pvc in $(oc get pvc -l release=$RELEASE_NAME -o name); do
oc label $pvc app=${{ github.event.repository.name }}-${{ github.event.number }}
done
Loading
Loading