Skip to content

Commit 61d9d6b

Browse files
committed
Merge branch 'develop' into AI-1042
Resolve apps/backend-services/package.json and package-lock.json: keep pdf-lib and sharp from this branch, add type-check script and @biomejs/biome 2.4.8 from develop, then regenerate the root lockfile with npm install. Made-with: Cursor
2 parents 0042ec0 + 037cc3e commit 61d9d6b

31 files changed

Lines changed: 30787 additions & 33764 deletions

.github/ACTIONS_README.md

Lines changed: 78 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -1,198 +1,113 @@
1-
# GitHub Actions for PSA Job Store
1+
# GitHub Actions
22

3-
This directory contains the CI/CD workflows and custom actions used for automating the build, test, deployment, and maintenance processes of the PSA Job Store application.
3+
This directory contains the repository workflows and custom actions used for quality checks, image builds, database operations, releases, and security scanning.
44

55
## Overview
66

7-
The PSA Job Store project uses GitHub Actions for continuous integration and continuous deployment (CI/CD). These workflows automate various aspects of the development lifecycle, including:
7+
The current workflow set covers:
88

9-
- Building Docker images
10-
- Running unit tests
11-
- Performing database migrations
12-
- Deploying to OpenShift environments
13-
- Running end-to-end tests
14-
- Managing database backups and restores
15-
- Security scanning with StackRox (Deprecated)
9+
- Application quality checks for backend, frontend, and temporal services
10+
- Docker image builds and Artifactory pushes
11+
- Database migration, backup, and restore tasks
12+
- Release automation
13+
- Pull request and branch security scanning
1614

17-
## Workflow Structure
15+
Workflow files live in `.github/workflows`, and reusable repository actions live in `.github/actions`.
1816

19-
The workflows are organized in the `.github/workflows` directory, while custom actions are in the `.github/actions` directory.
17+
## Core workflows
2018

21-
### Main Workflows
19+
### Quality assurance
2220

23-
#### 1. Build Docker Images (`build-apps.yml`)
21+
- `backend-qa.yml`
22+
- Pull request quality gate for `apps/backend-services`
23+
- Runs lint, type-check, and test coverage commands
24+
- `frontend-qa.yml`
25+
- Pull request quality gate for `apps/frontend`
26+
- Runs lint, type-check, and test commands
27+
- `temporal-qa.yml`
28+
- Pull request quality gate for `apps/temporal`
29+
- Runs lint, type-check, and test commands
2430

25-
Triggered on:
31+
These workflows intentionally avoid top-level `paths` filters so they always publish a check result for protected-branch pull requests.
2632

27-
- Push to main, stage, or develop branches
28-
- Manual trigger
33+
### Build and release workflows
2934

30-
Key features:
35+
- `build-apps.yml`
36+
- Runs on pushes to `main` and `develop`
37+
- Detects changed applications, including shared Prisma inputs for backend and temporal
38+
- Builds and pushes Docker images to Artifactory
39+
- Scans built image digests with Grype
40+
- `build-instance-images.yml`
41+
- Manual workflow for building per-branch images
42+
- Scans built image digests with Grype
43+
- `migrate-db.yml`
44+
- Applies database migrations and coordinates downstream deployment work
45+
- `release.yml`
46+
- Release automation workflow
3147

32-
- Detects which applications have changed (api, app)
33-
- Builds Docker images for changed applications
34-
- Pushes images to Artifactory
35-
- Triggers the database migration workflow
48+
### Database operations
3649

37-
#### 2. Database Migration (`migrate-db.yml`)
50+
- `db-backup-manual.yml`
51+
- Manual PostgreSQL backup workflow
52+
- `db-restore.yml`
53+
- Manual PostgreSQL restore workflow
3854

39-
Triggered on:
55+
## Security workflows
4056

41-
- Completion of the build workflow
42-
- Manual trigger
57+
The repository security baseline now includes:
4358

44-
Key features:
59+
- `codeql.yml`
60+
- CodeQL analysis for TypeScript, Python, and GitHub Actions content
61+
- `dependency-review.yml`
62+
- Pull request dependency review for supported dependency changes
63+
- `python-dependency-audit.yml`
64+
- `uv` plus `pip-audit` coverage for `apps/image-service`
65+
- `hadolint.yml`
66+
- Dockerfile lint and security checks
67+
- `checkov.yml`
68+
- Blocking Dockerfile checks and advisory deployment/workflow scans
4569

46-
- Detects if there are new database migrations
47-
- Applies Prisma migrations to the database
48-
- Updates version information
49-
- Triggers deployments for changed applications
50-
#### 3. Unit Tests (`unit-tests.yml`)
70+
See `docs-md/security-scanning.md` for the operating model, blocking rules, and GitHub settings that must be enabled outside the repository.
5171

52-
Triggered on:
72+
## Custom actions
5373

54-
- Push to stage branch
55-
- Manual trigger
74+
### `get-environment`
5675

57-
Key features:
76+
Determines the deployment environment name from the branch context.
5877

59-
- Builds common-kit library
60-
- Runs Jest tests for React (app), NestJS (api), and common-kit
78+
### `migrate-db`
6179

62-
#### 5. Database Backup (`db-backup-manual.yml`)
80+
Runs the repository database migration logic.
6381

64-
Triggered on:
82+
### `trigger-deploy`
6583

66-
- Manual trigger
84+
Triggers deployment work in the target OpenShift environment.
6785

68-
Key features:
86+
## Environment configuration
6987

70-
- Creates a backup of the PostgreSQL database
71-
- Allows specifying the cluster name, environment, and backup annotation
88+
The repository currently uses environment-specific secrets and deployment configuration. The reusable `get-environment` action maps:
7289

73-
#### 6. Database Restore (`db-restore.yml`)
90+
- `main` -> `prod`
91+
- `stage` -> `test`
92+
- other branches -> `dev`
7493

75-
Triggered on:
94+
Even though `build-apps.yml` now targets `main` and `develop`, the environment mapping still exists for workflows that may resolve other refs.
7695

77-
- Manual trigger
96+
## Required secrets
7897

79-
Key features:
98+
Common workflow secrets include:
8099

81-
- Restores a PostgreSQL database from a backup
82-
- Allows specifying the cluster name, environment, and either a restore timestamp or backup ID
100+
- `OPENSHIFT_SERVER`
101+
- `OPENSHIFT_API_TOKEN`
102+
- `ARTIFACTORY_URL`
103+
- `ARTIFACTORY_SA_USERNAME`
104+
- `ARTIFACTORY_SA_PASSWORD`
105+
- Application-specific configuration values such as `VITE_*`, `REACT_APP_URL`, `DATABASE_URL`, and similar runtime/build inputs
83106

84-
#### 7. Security Scanning (`run-acs.yml`) (DEPRECATED)
107+
## Pipeline relationship
85108

86-
Triggered on:
109+
At a high level:
87110

88-
- Manual trigger
89-
90-
Key features:
91-
92-
- Runs StackRox security checks on Docker images
93-
- Scans deployment configurations for security issues
94-
95-
#### 8. Release Management (`release.yml`) (DEPRECATED)
96-
97-
Triggered on:
98-
99-
- Manual trigger
100-
101-
Key features:
102-
103-
- Creates a release pull request using Changesets
104-
105-
## Custom Actions
106-
107-
### 1. Trigger Deploy (`.github/actions/trigger-deploy`)
108-
109-
Purpose: Triggers a deployment in OpenShift.
110-
111-
Inputs:
112-
113-
- OpenShift server
114-
- API token
115-
- Project to redeploy
116-
- Deployment environment
117-
118-
### 2. Migrate DB (`.github/actions/migrate-db`)
119-
120-
Purpose: Executes database migrations.
121-
122-
Inputs:
123-
124-
- Deployment environment
125-
- OpenShift server
126-
- API token
127-
- Database URL
128-
129-
### 3. StackRox Scan (`.github/actions/stackrox-scan`) (DEPRECATED)
130-
131-
Purpose: Scans Docker images for security vulnerabilities.
132-
133-
Inputs:
134-
135-
- Central endpoint
136-
- API token
137-
- Image to scan
138-
- Output format
139-
140-
### 4. StackRox Check (`.github/actions/stackrox-check`) (DEPRECATED)
141-
142-
Purpose: Checks Docker images against security policies.
143-
144-
Inputs:
145-
146-
- Central endpoint
147-
- API token
148-
- Image to check
149-
150-
### 5. StackRox DC Check (`.github/actions/stackrox-dc-check`) (DEPRECATED)
151-
152-
Purpose: Checks deployment configurations against security policies.
153-
154-
Inputs:
155-
156-
- Path to deployment configuration
157-
- Central endpoint
158-
- API token
159-
160-
## Environment Configuration
161-
162-
The workflows use environment-specific configurations:
163-
164-
- `dev` for the develop branch
165-
- `test` for the stage branch
166-
- `prod` for the main branch
167-
168-
Each environment has its own set of secrets configured in GitHub.
169-
170-
## Required Secrets
171-
172-
The following secrets are required for the workflows to function properly:
173-
174-
- `OPENSHIFT_SERVER`: The OpenShift server URL
175-
- `OPENSHIFT_API_TOKEN`: API token for OpenShift authentication
176-
- `ARTIFACTORY_URL`: URL of the Artifactory repository
177-
- `ARTIFACTORY_SA_USERNAME`: Artifactory service account username
178-
- `ARTIFACTORY_SA_PASSWORD`: Artifactory service account password
179-
- `ROX_CENTRAL_ENDPOINT`: StackRox Central endpoint (DEPRECATED)
180-
- `ROX_API_TOKEN`: StackRox API token (DEPRECATED)
181-
- Various application-specific environment variables (VITE\_\*, SESSION_SECRET, etc.)
182-
183-
## Workflow Dependencies
184-
185-
The workflows are designed to work together in a pipeline:
186-
187-
1. Code changes are pushed to a branch
188-
2. `build-apps.yml` builds Docker images for changed applications
189-
3. `migrate-db.yml` applies database migrations and triggers deployments
190-
191-
## Manual Workflows
192-
193-
Some workflows are designed to be triggered manually:
194-
195-
- `db-backup-manual.yml` for creating database backups
196-
- `db-restore.yml` for restoring from backups
197-
- `run-acs.yml` for security scanning (DEPRECATED)
198-
- `release.yml` for creating release pull requests (DEPRECATED)
111+
1. Pull requests run QA and security workflows.
112+
2. Protected-branch pushes build and scan images.
113+
3. Database and deployment workflows consume those build outputs as needed.

.github/workflows/backend-qa.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
11
name: Backend Quality Assurance
22
permissions:
3-
contents: read
3+
contents: read
44
on:
55
pull_request:
6-
types: [opened, synchronize]
6+
types: [opened, synchronize, reopened]
77
branches: [main, develop]
8-
paths:
9-
- '.github/workflows/backend-qa.yml'
10-
- 'apps/backend-services/src/**'
118
workflow_dispatch:
129

1310
jobs:
1411
test-and-lint:
15-
name: Test and Lint
12+
name: Backend Quality Assurance
1613
runs-on: ubuntu-latest
1714
outputs:
1815
environment: ${{ steps.env.outputs.environment }}
1916
steps:
2017
- name: Checkout
21-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
2219
- name: Get Environment
2320
id: env
2421
uses: ./.github/actions/get-environment
2522
- name: Setup Node
26-
uses: actions/setup-node@v4
23+
uses: actions/setup-node@v6
2724
with:
2825
node-version: '24'
2926
- name: Install dependencies
@@ -35,9 +32,12 @@ jobs:
3532
run: npm run db:generate
3633
env:
3734
DATABASE_URL: "file:dev.db"
38-
- name: Run tests
39-
working-directory: apps/backend-services
40-
run: npm run test:cov
41-
- name: Run Linter
35+
- name: Lint
4236
working-directory: apps/backend-services
4337
run: npm run lint
38+
- name: Type Check
39+
working-directory: apps/backend-services
40+
run: npm run type-check
41+
- name: Test
42+
working-directory: apps/backend-services
43+
run: npm run test:cov

0 commit comments

Comments
 (0)