Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/actions/fetch-frontend-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:

- name: Download dist from this run's artifacts
if: startsWith(inputs.release_tag, 'sha-')
uses: actions/download-artifact@v4
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: ${{ steps.artifact.outputs.name }}
path: ${{ inputs.output_dir }}
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: ${{ inputs.node-version }}

- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4

- name: Get pnpm store directory
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_ENV"

- name: Setup pnpm store cache
uses: actions/cache@v4
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
Expand Down
10 changes: 10 additions & 0 deletions .github/audit-allowlist.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"advisories": [
{
"id": "GHSA-ggr8-5vv4-36mx",
"package": "deepmerge-ts@7.1.5",
"reason": "Only reachable through the Prisma CLI (@prisma/config) merging its own config at generate/migrate time; no untrusted input. Fix needs deepmerge-ts 8.x, which @prisma/config 6.x does not support.",
"expires": "2027-01-31"
}
]
}
4 changes: 2 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ if (!userId) throw new Error('Authentication required');
### Admin App

- Cookie-based auth (NOT bearer). Apollo uses `credentials: 'include'`.
- Default admin: `admin@dculus.com` / `admin123!@#` (role: `superAdmin`).
- No default admin account: create one with `pnpm admin:setup` using `ADMIN_EMAIL` / a strong, unique `ADMIN_PASSWORD` (role: `superAdmin`).

---

Expand Down Expand Up @@ -378,7 +378,7 @@ pnpm lint # ESLint

# Testing
pnpm test:integration # API integration tests
pnpm test:integration:production # Against production
pnpm test:integration:health:production # Read-only /health smoke check against production
pnpm test:integration:by-tags # Filter by Cucumber tag (e.g., @forms)
pnpm test:e2e # Playwright + Cucumber E2E
pnpm test:unit # Backend unit tests
Expand Down
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ updates:
update-types:
- "minor"
- "patch"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
open-pull-requests-limit: 5
groups:
github-actions:
patterns:
- "*"
9 changes: 8 additions & 1 deletion .github/instructions/testing.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ applyTo: "test/**"

```bash
pnpm test:integration # All tests (local)
pnpm test:integration:production # Against production
pnpm test:integration:health:production # Read-only /health smoke check against production
pnpm test:integration:auth # Auth tests only
pnpm test:integration:by-tags # Filter by Cucumber tags
pnpm test:integration:coverage # With code coverage
Expand Down Expand Up @@ -42,6 +42,13 @@ pnpm test:unit:coverage # With coverage

## Test Credentials

> **Local only.** These are public, disposable accounts on public (mailinator) inboxes whose
> passwords are published here. Use them only against `localhost`. The E2E helper
> (`getCredentials`) refuses the default E2E account when `E2E_FORM_APP_URL`,
> `E2E_FORM_VIEWER_URL` or `E2E_BACKEND_URL` point at a hosted environment; hosted runs must set
> `E2E_EMAIL` / `E2E_PASSWORD` to a dedicated account (CI uses secrets). Never create these users
> on dev, staging or production.

```
# E2E Tests
Email: cloude2etest@mailinator.com
Expand Down
60 changes: 60 additions & 0 deletions .github/scripts/audit-prod.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Blocking dependency audit for runtime dependencies.
//
// Runs `pnpm audit --prod` and fails on any advisory at or above the threshold that is not
// listed (and unexpired) in .github/audit-allowlist.json. Each allow-list entry needs a
// reason and an expiry date, so accepted risk is reviewed instead of silently permanent.
import { execSync } from 'node:child_process';
import { readFileSync } from 'node:fs';

const THRESHOLD = (process.env.AUDIT_LEVEL ?? 'high').toLowerCase();
const RANK = { info: 0, low: 1, moderate: 2, high: 3, critical: 4 };
if (!(THRESHOLD in RANK)) {
console.error(`::error::Unknown AUDIT_LEVEL "${THRESHOLD}".`);
process.exit(1);
}

const allowlist = JSON.parse(readFileSync(new URL('../audit-allowlist.json', import.meta.url), 'utf8'));
const today = new Date().toISOString().slice(0, 10);
const allowed = new Map();
const errors = [];
for (const entry of allowlist.advisories ?? []) {
if (!entry.id || !entry.reason || !/^\d{4}-\d{2}-\d{2}$/.test(entry.expires ?? '')) {
errors.push(`Allow-list entry needs "id", "reason" and an "expires" date (YYYY-MM-DD): ${JSON.stringify(entry)}`);
} else if (entry.expires < today) {
errors.push(`Allow-list entry ${entry.id} expired on ${entry.expires}; fix the dependency or renew it with a new review.`);
} else {
allowed.set(entry.id, entry);
}
}

let raw;
try {
raw = execSync('pnpm audit --prod --json', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'], maxBuffer: 64 * 1024 * 1024 });
} catch (err) {
// pnpm exits non-zero when it finds vulnerabilities but still prints the JSON report.
raw = err.stdout ?? '';
}

let report;
try {
report = JSON.parse(raw.slice(raw.indexOf('{')));
} catch {
console.error('::error::Could not parse `pnpm audit --prod --json` output (registry unreachable?).');
process.exit(1);
}

const failing = [];
for (const advisory of Object.values(report.advisories ?? {})) {
if (RANK[advisory.severity] < RANK[THRESHOLD]) continue;
const id = advisory.github_advisory_id;
if (allowed.has(id)) continue;
const versions = [...new Set((advisory.findings ?? []).map((f) => f.version))].join(', ');
failing.push(`${advisory.severity.toUpperCase()} ${id} ${advisory.module_name}@${versions}: ${advisory.title}`);
}

errors.push(...failing.map((f) => `Unaccepted runtime advisory: ${f}`));
if (errors.length > 0) {
console.error(errors.map((e) => `::error::${e}`).join('\n'));
process.exit(1);
}
console.log(`Runtime dependency audit passed (threshold: ${THRESHOLD}, ${allowed.size} allow-listed advisories).`);
2 changes: 1 addition & 1 deletion .github/workflows/ai-evals.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
fi

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
persist-credentials: false

Expand Down
Loading
Loading