Skip to content

Commit 73d7ca9

Browse files
author
Codex
committed
Merge pull request #787
# Conflicts: # .github/workflows/migration-drift-check.yml # CONTRIBUTING.md # backend/migrations/_archived/add_pause_columns.sql # backend/migrations/_archived/create_audit_logs.sql # backend/migrations/_archived/create_renewal_tables.sql # backend/migrations/_archived/create_team_invitations.sql
2 parents 542894f + ba03210 commit 73d7ca9

11 files changed

Lines changed: 80 additions & 53 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ jobs:
268268
- name: Set up Node.js
269269
uses: actions/setup-node@v6
270270
with:
271-
node-version: '20'
272-
cache: 'npm'
271+
node-version: "20"
272+
cache: "npm"
273273
cache-dependency-path: client/package-lock.json
274274

275275
- name: Audit client dependencies
@@ -420,7 +420,7 @@ jobs:
420420

421421
- name: Install backend dependencies
422422
working-directory: backend
423-
run: npm ci
423+
run: npm install
424424

425425
- name: Run backend tests
426426
working-directory: backend

.github/workflows/database.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on:
44
push:
55
branches: [main, develop]
66
paths:
7-
- 'supabase/migrations/**'
8-
- 'supabase/config.toml'
7+
- "supabase/migrations/**"
8+
- "supabase/config.toml"
99
pull_request:
1010
branches: [main, develop]
1111
paths:
12-
- 'supabase/migrations/**'
13-
- 'supabase/config.toml'
12+
- "supabase/migrations/**"
13+
- "supabase/config.toml"
1414

1515
jobs:
1616
validate-migrations:
@@ -38,13 +38,13 @@ jobs:
3838
- name: Setup Node.js for RLS audit
3939
uses: actions/setup-node@v6
4040
with:
41-
node-version: '20'
42-
cache: 'npm'
41+
node-version: "20"
42+
cache: "npm"
4343
cache-dependency-path: backend/package-lock.json
4444

4545
- name: Install dependencies for RLS audit
4646
working-directory: backend
47-
run: npm ci
47+
run: npm install
4848

4949
- name: Run migration drift check against local database
5050
id: local-drift-check
@@ -77,4 +77,4 @@ jobs:
7777
7878
- name: Stop Supabase local stack
7979
if: always()
80-
run: supabase stop
80+
run: if command -v supabase &> /dev/null; then supabase stop; fi

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
cache-dependency-path: backend/package-lock.json
7070

7171
- name: Install dependencies
72-
run: npm ci
72+
run: npm install
7373

7474
- name: Run ESLint
7575
run: npx eslint src --ext .ts --max-warnings 0

.github/workflows/rls-audit.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,37 @@ on:
44
push:
55
branches: [main, develop]
66
paths:
7-
- 'supabase/migrations/**'
8-
- 'backend/migrations/**'
9-
- 'scripts/check-rls-compliance.js'
10-
- '.github/workflows/rls-audit.yml'
7+
- "supabase/migrations/**"
8+
- "backend/migrations/**"
9+
- "scripts/check-rls-compliance.js"
10+
- ".github/workflows/rls-audit.yml"
1111
pull_request:
1212
branches: [main, develop]
1313
paths:
14-
- 'supabase/migrations/**'
15-
- 'backend/migrations/**'
16-
- 'scripts/check-rls-compliance.js'
17-
- '.github/workflows/rls-audit.yml'
14+
- "supabase/migrations/**"
15+
- "backend/migrations/**"
16+
- "scripts/check-rls-compliance.js"
17+
- ".github/workflows/rls-audit.yml"
1818

1919
jobs:
2020
audit-rls-policies:
2121
name: Audit RLS Policies
2222
runs-on: ubuntu-latest
23-
23+
2424
steps:
2525
- name: Checkout repository
2626
uses: actions/checkout@v6
2727

2828
- name: Setup Node.js
2929
uses: actions/setup-node@v6
3030
with:
31-
node-version: '20'
32-
cache: 'npm'
31+
node-version: "20"
32+
cache: "npm"
3333
cache-dependency-path: backend/package-lock.json
3434

3535
- name: Install dependencies
3636
working-directory: backend
37-
run: npm ci
37+
run: npm install
3838

3939
- name: Setup Supabase CLI
4040
uses: supabase/setup-cli@v2
@@ -61,29 +61,29 @@ jobs:
6161
6262
- name: Stop Supabase local stack
6363
if: always()
64-
run: supabase stop
64+
run: if command -v supabase &> /dev/null; then supabase stop; fi
6565

6666
# Integration with main CI pipeline
6767
validate-rls-on-production:
6868
name: Validate RLS on Production Schema
6969
runs-on: ubuntu-latest
7070
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
7171
needs: audit-rls-policies
72-
72+
7373
steps:
7474
- name: Checkout repository
7575
uses: actions/checkout@v6
7676

7777
- name: Setup Node.js
7878
uses: actions/setup-node@v6
7979
with:
80-
node-version: '20'
81-
cache: 'npm'
80+
node-version: "20"
81+
cache: "npm"
8282
cache-dependency-path: backend/package-lock.json
8383

8484
- name: Install dependencies
8585
working-directory: backend
86-
run: npm ci
86+
run: npm install
8787

8888
- name: Validate RLS on Production Database
8989
env:
@@ -100,7 +100,7 @@ jobs:
100100
runs-on: ubuntu-latest
101101
if: github.event_name == 'pull_request'
102102
needs: audit-rls-policies
103-
103+
104104
steps:
105105
- name: Comment PR with RLS Status
106106
uses: actions/github-script@v9
@@ -111,4 +111,4 @@ jobs:
111111
owner: context.repo.owner,
112112
repo: context.repo.repo,
113113
body: '✅ **RLS Policy Audit Passed**\n\nAll tables in the database have Row Level Security enabled with appropriate policies. Your changes maintain data security compliance.'
114-
});
114+
});

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
cache-dependency-path: backend/package-lock.json
8686

8787
- name: Install dependencies
88-
run: npm ci
88+
run: npm install
8989

9090
- name: Run tests with coverage
9191
run: npm test -- --coverage --ci

.github/workflows/typecheck.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99
inputs:
1010
force_full_run:
11-
description: 'Force a full typecheck run'
11+
description: "Force a full typecheck run"
1212
type: boolean
1313
default: false
1414

@@ -54,7 +54,7 @@ jobs:
5454
fail-fast: false
5555
matrix:
5656
package: [backend, client, sdk, shared, root]
57-
57+
5858
if: |
5959
needs.changes.outputs.force_full_run == 'true' ||
6060
(matrix.package == 'backend' && needs.changes.outputs.backend == 'true') ||
@@ -65,15 +65,15 @@ jobs:
6565
6666
steps:
6767
- uses: actions/checkout@v6
68-
68+
6969
- uses: actions/setup-node@v6
7070
with:
7171
node-version: "20"
7272
cache: "npm"
73-
73+
7474
- name: Install dependencies
7575
run: npm install
76-
76+
7777
- name: Run Typecheck
7878
run: |
7979
if [ "${{ matrix.package }}" = "root" ]; then

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ supabase migration new <description>
229229

230230
**Why `supabase/migrations/` wins:** SYNCRO uses Supabase as its database provider. The Supabase CLI is the authoritative migration runner. Any migrations run outside it will not be tracked in `supabase_migrations.schema_migrations` and can cause sync errors.
231231

232+
**Rollback strategy:** Supabase does not support automatic down migrations. For destructive changes, document manual rollback SQL in a comment block at the top of the migration file.
233+
232234
For rollback guidance see [docs/MIGRATION_ROLLBACK_PLAYBOOKS.md](./docs/MIGRATION_ROLLBACK_PLAYBOOKS.md).
233235

234236
## Package-specific guides

backend/src/dependency-vulnerability-scanning/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Node.js
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: '20'
25+
node-version: "20"
2626

2727
- name: Validate client environment variables
2828
env:
@@ -66,13 +66,13 @@ jobs:
6666
- name: Set up Node.js
6767
uses: actions/setup-node@v4
6868
with:
69-
node-version: '20'
70-
cache: 'npm'
69+
node-version: "20"
70+
cache: "npm"
7171
cache-dependency-path: client/package-lock.json
7272

7373
- name: Install client dependencies
7474
working-directory: client
75-
run: npm ci --ignore-scripts
75+
run: npm install --ignore-scripts
7676

7777
- name: Security audit – client
7878
working-directory: client
@@ -93,8 +93,8 @@ jobs:
9393
- name: Set up Node.js
9494
uses: actions/setup-node@v4
9595
with:
96-
node-version: '20'
97-
cache: 'npm'
96+
node-version: "20"
97+
cache: "npm"
9898
cache-dependency-path: backend/package-lock.json
9999

100100
- name: Install backend dependencies
@@ -121,13 +121,13 @@ jobs:
121121
- name: Set up Node.js
122122
uses: actions/setup-node@v4
123123
with:
124-
node-version: '20'
125-
cache: 'npm'
124+
node-version: "20"
125+
cache: "npm"
126126
cache-dependency-path: client/package-lock.json
127127

128128
- name: Install client dependencies
129129
working-directory: client
130-
run: npm ci
130+
run: npm install
131131

132132
- name: Build client
133133
working-directory: client
@@ -156,8 +156,8 @@ jobs:
156156
- name: Set up Node.js
157157
uses: actions/setup-node@v4
158158
with:
159-
node-version: '20'
160-
cache: 'npm'
159+
node-version: "20"
160+
cache: "npm"
161161
cache-dependency-path: backend/package-lock.json
162162

163163
- name: Install backend dependencies

backend/src/dependency-vulnerability-scanning/security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
- name: Install client dependencies (ci — no scripts)
4646
working-directory: client
47-
run: npm ci --ignore-scripts
47+
run: npm install --ignore-scripts
4848

4949
# --audit-level=high → exit 1 on high or critical CVEs
5050
# The JSON output is saved so it can be inspected in the log even after

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
"typecheck:client": "npm run typecheck -w client",
1717
"typecheck:sdk": "npm run typecheck -w sdk",
1818
"typecheck:shared": "npm run typecheck -w shared",
19-
"generate:openapi": "cd backend && npm run swagger:export"
19+
"generate:openapi": "cd backend && npm run swagger:export",
20+
"lint:todos": "node scripts/check-todos.mjs",
21+
"check:migrations": "node scripts/check-migration-drift.js",
22+
"cleanup:migrations": "node scripts/cleanup-duplicate-migrations.js"
2023
},
2124
"devDependencies": {
2225
"@types/node": "^25.6.0"
2326
},
2427
"dependencies": {
2528
"@supabase/supabase-js": "^2.105.0",
2629
"typescript": "^6.0.3"
27-
},
28-
"scripts": {
29-
"lint:todos": "node scripts/check-todos.mjs"
3030
}
3131
}

0 commit comments

Comments
 (0)