Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
9e41309
added external-db-sync
aadesh18 Nov 30, 2025
3879001
stopped using yupArray
aadesh18 Nov 30, 2025
937db90
fixed build errors
aadesh18 Nov 30, 2025
3f2a8ef
Revert "fixed build errors"
aadesh18 Nov 30, 2025
dcda402
Update apps/backend/scripts/run-cron-jobs.ts
aadesh18 Dec 1, 2025
9e954b9
Update apps/backend/src/app/api/latest/internal/external-db-sync/poll…
aadesh18 Dec 1, 2025
f0cc311
Update apps/backend/src/app/api/latest/internal/external-db-sync/poll…
aadesh18 Dec 1, 2025
1d7a0de
pr changes
aadesh18 Dec 2, 2025
8c2d1c3
merge dev
BilalG1 Jan 28, 2026
409d89b
Merge remote-tracking branch 'origin/dev' into external-db-sync
BilalG1 Jan 29, 2026
0d2b3b9
fix pnpm lock
BilalG1 Jan 29, 2026
ef8f74e
fix typecheck
BilalG1 Jan 29, 2026
8cdd107
prisma fix
BilalG1 Jan 29, 2026
871fe12
fix tests
BilalG1 Jan 29, 2026
5d6bde2
fix lint
BilalG1 Jan 29, 2026
c4ed09a
fix
BilalG1 Jan 29, 2026
b102db3
fix tests
BilalG1 Jan 29, 2026
2eeb537
fix tests
BilalG1 Jan 29, 2026
c61a2b9
fix test
BilalG1 Jan 30, 2026
ac261d2
increase session test time
BilalG1 Jan 30, 2026
0c1a02e
fix flaky test and external sot sync
BilalG1 Jan 30, 2026
79e330f
comment resolving
BilalG1 Jan 30, 2026
939b1a9
resolve pr comments
BilalG1 Jan 30, 2026
2974c83
retry
BilalG1 Jan 30, 2026
0799a0b
attempt test fixes
BilalG1 Jan 30, 2026
1f67742
fix env
BilalG1 Jan 30, 2026
bd788b4
fix env
BilalG1 Jan 30, 2026
4b7dd53
attempt test fixes
BilalG1 Jan 30, 2026
044377e
fix tests
BilalG1 Jan 30, 2026
744b871
Merge branch 'dev' into external-db-sync
BilalG1 Jan 30, 2026
74c634b
fix lint
BilalG1 Jan 30, 2026
ce5a1bb
fix tests
BilalG1 Jan 30, 2026
2c5440b
fix tests
BilalG1 Jan 30, 2026
f726f61
Merge remote-tracking branch 'origin/dev' into external-db-sync
BilalG1 Jan 31, 2026
665c084
fix tests
BilalG1 Jan 31, 2026
85bb893
Merge branch 'dev' into external-db-sync
BilalG1 Jan 31, 2026
856aaf3
fix tests
BilalG1 Jan 31, 2026
8f3ad45
m
BilalG1 Jan 31, 2026
fe393e9
merge dev
BilalG1 Feb 2, 2026
b9c0ef4
fix lockfile
BilalG1 Feb 2, 2026
b5781a1
Merge remote-tracking branch 'origin/dev' into external-db-sync
BilalG1 Feb 2, 2026
b841f7b
fix tests
BilalG1 Feb 2, 2026
2e0d8de
m
BilalG1 Feb 2, 2026
e5cbc1a
Merge branch 'dev' into external-db-sync
BilalG1 Feb 2, 2026
ba1df26
fix tests
BilalG1 Feb 2, 2026
093eaf0
e2e: isolate external DB sync cleanup per suite (#1148)
BilalG1 Feb 3, 2026
5192875
CI: run dev tests single-worker (#1153)
BilalG1 Feb 3, 2026
686a1e6
Merge branch 'dev' into external-db-sync
BilalG1 Feb 3, 2026
8910138
fixes
BilalG1 Feb 3, 2026
62171dc
single test run
BilalG1 Feb 3, 2026
1038d1a
Merge branch 'dev' into external-db-sync
BilalG1 Feb 3, 2026
3370e63
test fixes (#1155)
BilalG1 Feb 3, 2026
d04e944
concurrent fix
BilalG1 Feb 3, 2026
61f2b79
Merge branch 'external-db-sync' of https://github.com/stack-auth/stac…
BilalG1 Feb 3, 2026
bbac70e
Merge branch 'dev' into external-db-sync
BilalG1 Feb 3, 2026
8e92205
fix routes, external-db dashboard
BilalG1 Feb 4, 2026
3b9c22e
merge dev
BilalG1 Feb 4, 2026
c0a3f7a
replace trigger
BilalG1 Feb 4, 2026
d34a2c7
fusebox
BilalG1 Feb 4, 2026
c91998e
add tracing
BilalG1 Feb 4, 2026
64d9d93
remove old tests
BilalG1 Feb 4, 2026
7fd7886
fix sot test
BilalG1 Feb 4, 2026
719d1c2
Merge remote-tracking branch 'origin/dev' into external-db-sync
BilalG1 Feb 4, 2026
04970c2
Update vercel.json
N2D4 Feb 4, 2026
4abd410
Various fixes
N2D4 Feb 4, 2026
8247481
test: disable direct external db sync in CI
BilalG1 Feb 5, 2026
362e1fb
merge dev
BilalG1 Feb 5, 2026
98d451d
increase test timeout
BilalG1 Feb 5, 2026
8be639d
Merge branch 'dev' into external-db-sync
BilalG1 Feb 5, 2026
caa3dca
remove fusebox sync engine col
BilalG1 Feb 5, 2026
445e889
Merge branch 'external-db-sync' of https://github.com/stack-auth/stac…
BilalG1 Feb 5, 2026
63df87a
fix test
BilalG1 Feb 5, 2026
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
12 changes: 11 additions & 1 deletion .github/workflows/db-migration-backwards-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,17 @@ jobs:
wait-for: 30s
log-output-if: true

- name: Start run-cron-jobs in background
uses: JarvusInnovations/background-action@v1.0.7
if: ${{ hashFiles('apps/backend/scripts/run-cron-jobs.ts') != '' }}
with:
run: pnpm -C apps/backend run with-env:dev tsx scripts/run-cron-jobs.ts --log-order=stream &
wait-on: |
http://localhost:8102
tail: true
wait-for: 30s
log-output-if: true
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Wait 10 seconds
run: sleep 10

Expand Down Expand Up @@ -230,4 +241,3 @@ jobs:
steps:
- name: No migration changes detected
run: echo "No changes to migrations folder detected. Skipping backwards compatibility test."

25 changes: 20 additions & 5 deletions .github/workflows/e2e-api-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
NODE_ENV: test
STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING: yes
STACK_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/stackframe"
STACK_FORCE_EXTERNAL_DB_SYNC: "true"
STACK_EXTERNAL_DB_SYNC_MAX_DURATION_MS: "20000"
STACK_EXTERNAL_DB_SYNC_DIRECT: "false"

strategy:
matrix:
Expand Down Expand Up @@ -100,6 +103,9 @@ jobs:

- name: Wait on Svix
run: pnpx wait-on tcp:localhost:8113

- name: Wait on QStash
run: pnpx wait-on tcp:localhost:8125

- name: Initialize database
run: pnpm run db:init
Expand Down Expand Up @@ -140,20 +146,29 @@ jobs:
tail: true
wait-for: 30s
log-output-if: true
- name: Start run-cron-jobs in background
uses: JarvusInnovations/background-action@v1.0.7
with:
run: pnpm -C apps/backend run run-cron-jobs:test --log-order=stream &
wait-on: |
http://localhost:8102
tail: true
wait-for: 30s
log-output-if: true

- name: Wait 10 seconds
run: sleep 10

- name: Run tests
run: pnpm test ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }}
run: pnpm test run ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }}

- name: Run tests again, to make sure they are stable (attempt 1)
- name: Run tests again (attempt 1)
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
run: pnpm test ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }}
run: pnpm test run ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }}

- name: Run tests again, to make sure they are stable (attempt 2)
- name: Run tests again (attempt 2)
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
run: pnpm test ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }}
run: pnpm test run ${{ matrix.freestyle-mode == 'prod' && '--min-workers=1 --max-workers=1' || '' }}
Comment thread
BilalG1 marked this conversation as resolved.

- name: Verify data integrity
run: pnpm run verify-data-integrity --no-bail
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/e2e-custom-base-port-api-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING: yes
STACK_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:6728/stackframe"
NEXT_PUBLIC_STACK_PORT_PREFIX: "67"
STACK_FORCE_EXTERNAL_DB_SYNC: "true"
STACK_EXTERNAL_DB_SYNC_MAX_DURATION_MS: "20000"
STACK_EXTERNAL_DB_SYNC_DIRECT: "false"

strategy:
matrix:
Expand Down Expand Up @@ -94,6 +97,9 @@ jobs:

- name: Wait on Svix
run: pnpx wait-on tcp:localhost:6713

- name: Wait on QStash
run: pnpx wait-on tcp:localhost:6725

- name: Initialize database
run: pnpm run db:init
Expand Down Expand Up @@ -134,20 +140,29 @@ jobs:
tail: true
wait-for: 30s
log-output-if: true
- name: Start run-cron-jobs in background
uses: JarvusInnovations/background-action@v1.0.7
with:
run: pnpm -C apps/backend run run-cron-jobs --log-order=stream &
wait-on: |
http://localhost:6702
tail: true
wait-for: 30s
log-output-if: true

- name: Wait 10 seconds
run: sleep 10

- name: Run tests
run: pnpm test
run: pnpm test run

- name: Run tests again, to make sure they are stable (attempt 1)
- name: Run tests again (attempt 1)
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
run: pnpm test
run: pnpm test run

- name: Run tests again, to make sure they are stable (attempt 2)
- name: Run tests again (attempt 2)
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
run: pnpm test
run: pnpm test run

- name: Verify data integrity
run: pnpm run verify-data-integrity --no-bail
Expand Down
26 changes: 21 additions & 5 deletions .github/workflows/e2e-source-of-truth-api-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ jobs:
env:
NODE_ENV: test
STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING: yes
STACK_ACCESS_TOKEN_EXPIRATION_TIME: 30m
STACK_OVERRIDE_SOURCE_OF_TRUTH: '{"type": "postgres", "connectionString": "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/source-of-truth-db?schema=sot-schema"}'
STACK_TEST_SOURCE_OF_TRUTH: true
STACK_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/stackframe"
STACK_FORCE_EXTERNAL_DB_SYNC: "true"
STACK_EXTERNAL_DB_SYNC_MAX_DURATION_MS: "20000"
STACK_EXTERNAL_DB_SYNC_DIRECT: "false"

strategy:
matrix:
Expand Down Expand Up @@ -95,6 +99,9 @@ jobs:

- name: Wait on Svix
run: pnpx wait-on tcp:localhost:8113

- name: Wait on QStash
run: pnpx wait-on tcp:localhost:8125

- name: Create source-of-truth database and schema
run: |
Expand Down Expand Up @@ -140,20 +147,29 @@ jobs:
tail: true
wait-for: 30s
log-output-if: true
- name: Start run-cron-jobs in background
uses: JarvusInnovations/background-action@v1.0.7
with:
run: pnpm -C apps/backend run run-cron-jobs --log-order=stream &
wait-on: |
http://localhost:8102
tail: true
wait-for: 30s
log-output-if: true

- name: Wait 10 seconds
run: sleep 10

- name: Run tests
run: pnpm test
run: pnpm test run --exclude "**/external-db-sync*.test.ts" # external-db-sync does not support external sot

- name: Run tests again, to make sure they are stable (attempt 1)
- name: Run tests again (attempt 1)
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
run: pnpm test
run: pnpm test run --exclude "**/external-db-sync*.test.ts"

- name: Run tests again, to make sure they are stable (attempt 2)
- name: Run tests again (attempt 2)
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
run: pnpm test
run: pnpm test run --exclude "**/external-db-sync*.test.ts"

- name: Verify data integrity
run: pnpm run verify-data-integrity --no-bail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
runs-on: ubicloud-standard-16
env:
NEXT_PUBLIC_STACK_PORT_PREFIX: "69"
STACK_FORCE_EXTERNAL_DB_SYNC: "true"
STACK_EXTERNAL_DB_SYNC_MAX_DURATION_MS: "20000"
STACK_EXTERNAL_DB_SYNC_DIRECT: "false"

steps:
- uses: actions/checkout@v6
Expand All @@ -38,7 +41,7 @@ jobs:
run: pnpm run restart-dev-environment

- name: Run tests
run: pnpm run test --reporter=verbose
run: pnpm run test run --reporter=verbose

- name: Print dev server logs
run: cat dev-server.log.untracked.txt
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/restart-dev-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ env:
jobs:
restart-dev-and-test:
runs-on: ubicloud-standard-16
env:
STACK_FORCE_EXTERNAL_DB_SYNC: "true"
STACK_EXTERNAL_DB_SYNC_MAX_DURATION_MS: "20000"
STACK_EXTERNAL_DB_SYNC_DIRECT: "false"

steps:
- uses: actions/checkout@v6
Expand All @@ -36,7 +40,7 @@ jobs:
run: pnpm run restart-dev-environment

- name: Run tests
run: pnpm run test --reporter=verbose
run: pnpm run test run --reporter=verbose

- name: Print dev server logs
run: cat dev-server.log.untracked.txt
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/setup-tests-with-custom-base-port.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
runs-on: ubicloud-standard-16
env:
NEXT_PUBLIC_STACK_PORT_PREFIX: "69"
STACK_FORCE_EXTERNAL_DB_SYNC: "true"
STACK_EXTERNAL_DB_SYNC_MAX_DURATION_MS: "20000"
STACK_EXTERNAL_DB_SYNC_DIRECT: "false"

steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -46,4 +49,5 @@ jobs:
tail: true
wait-for: 120s
log-output-if: true
- run: pnpm run test --reporter=verbose
- name: Run tests
run: pnpm run test run --reporter=verbose
7 changes: 6 additions & 1 deletion .github/workflows/setup-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ env:
jobs:
setup-tests:
runs-on: ubicloud-standard-16
env:
STACK_FORCE_EXTERNAL_DB_SYNC: "true"
STACK_EXTERNAL_DB_SYNC_MAX_DURATION_MS: "20000"
STACK_EXTERNAL_DB_SYNC_DIRECT: "false"
steps:
- uses: actions/checkout@v6

Expand All @@ -43,4 +47,5 @@ jobs:
tail: true
wait-for: 120s
log-output-if: true
- run: pnpm run test --reporter=verbose
- name: Run tests
run: pnpm run test run --reporter=verbose
6 changes: 3 additions & 3 deletions apps/backend/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ STACK_DATABASE_REPLICATION_WAIT_STRATEGY=pg-stat-replication
STACK_EMAIL_HOST=127.0.0.1
STACK_EMAIL_PORT=${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}29
STACK_EMAIL_SECURE=false
STACK_EMAIL_USERNAME=does not matter, ignored by Inbucket
STACK_EMAIL_PASSWORD=does not matter, ignored by Inbucket
STACK_EMAIL_USERNAME="does not matter, ignored by Inbucket"
STACK_EMAIL_PASSWORD="does not matter, ignored by Inbucket"
Comment thread
BilalG1 marked this conversation as resolved.
STACK_EMAIL_SENDER=noreply@example.com

STACK_ACCESS_TOKEN_EXPIRATION_TIME=60s
Expand All @@ -50,7 +50,7 @@ STACK_ARTIFICIAL_DEVELOPMENT_DELAY_MS=500

STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING=yes

STACK_INTEGRATION_CLIENTS_CONFIG=[{"client_id": "neon-local", "client_secret": "neon-local-secret", "id_token_signed_response_alg": "ES256", "redirect_uris": ["http://localhost:30000/api/v2/identity/authorize", "http://localhost:30000/api/v2/auth/authorize"]}, {"client_id": "custom-local", "client_secret": "custom-local-secret", "id_token_signed_response_alg": "ES256", "redirect_uris": ["http://localhost:30000/api/v2/identity/authorize", "http://localhost:30000/api/v2/auth/authorize"]}]
STACK_INTEGRATION_CLIENTS_CONFIG='[{"client_id": "neon-local", "client_secret": "neon-local-secret", "id_token_signed_response_alg": "ES256", "redirect_uris": ["http://localhost:30000/api/v2/identity/authorize", "http://localhost:30000/api/v2/auth/authorize"]}, {"client_id": "custom-local", "client_secret": "custom-local-secret", "id_token_signed_response_alg": "ES256", "redirect_uris": ["http://localhost:30000/api/v2/identity/authorize", "http://localhost:30000/api/v2/auth/authorize"]}]'
CRON_SECRET=mock_cron_secret
STACK_FREESTYLE_API_KEY=mock_stack_freestyle_key
STACK_VERCEL_SANDBOX_TOKEN=vercel_sandbox_disabled_for_local_development
Expand Down
5 changes: 4 additions & 1 deletion apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"with-env": "dotenv -c --",
"with-env:dev": "dotenv -c development --",
"with-env:prod": "dotenv -c production --",
"dev": "concurrently -n \"dev,codegen,prisma-studio,email-queue\" -k \"next dev --port ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}02 ${STACK_BACKEND_DEV_EXTRA_ARGS:-}\" \"pnpm run codegen:watch\" \"pnpm run prisma-studio\" \"pnpm run run-email-queue\"",
"with-env:test": "dotenv -c test --",
"dev": "concurrently -n \"dev,codegen,prisma-studio,email-queue,cron-jobs\" -k \"next dev --port ${NEXT_PUBLIC_STACK_PORT_PREFIX:-81}02 ${STACK_BACKEND_DEV_EXTRA_ARGS:-}\" \"pnpm run codegen:watch\" \"pnpm run prisma-studio\" \"pnpm run run-email-queue\" \"pnpm run run-cron-jobs\"",
"dev:inspect": "STACK_BACKEND_DEV_EXTRA_ARGS=\"--inspect\" pnpm run dev",
"dev:profile": "STACK_BACKEND_DEV_EXTRA_ARGS=\"--experimental-cpu-prof\" pnpm run dev",
"build": "pnpm run codegen && next build",
Expand Down Expand Up @@ -42,6 +43,8 @@
"codegen-docs:watch": "pnpm run with-env tsx watch --exclude '**/node_modules/**' --clear-screen=false scripts/generate-openapi-fumadocs.ts",
"generate-keys": "pnpm run with-env tsx scripts/generate-keys.ts",
"db-seed-script": "pnpm run db:seed",
"run-cron-jobs": "pnpm run with-env:dev tsx scripts/run-cron-jobs.ts",
"run-cron-jobs:test": "pnpm run with-env:test tsx scripts/run-cron-jobs.ts",
"verify-data-integrity": "pnpm run with-env:dev tsx scripts/verify-data-integrity/index.ts",
"run-email-queue": "pnpm run with-env:dev tsx scripts/run-email-queue.ts"
},
Expand Down
Loading
Loading