Skip to content

Commit 014dccf

Browse files
Merge branch 'dev' into Project-transfer-page-redesign
2 parents b491e83 + 7caff35 commit 014dccf

675 files changed

Lines changed: 33107 additions & 22300 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor/commands/pre-push.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Please compare `dev` to `main` and ensure that all migrations are backwards compatible. In what ways could breakage occur? Report the result to me in detail.
1+
Please compare `dev` to `main` and ensure that all migrations are backwards compatible. In what ways could breakage occur? Report the result to me in detail. Anything else that's scary that could occur, or that we should think about while migrating?

.github/workflows/db-migration-backwards-compatibility.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,13 @@ jobs:
145145
run: pnpm run wait-until-postgres-is-ready:pg_isready
146146

147147
- name: Wait on Inbucket
148-
run: pnpx wait-on tcp:localhost:8129
148+
run: pnpm exec wait-on tcp:localhost:8129
149149

150150
- name: Wait on Svix
151-
run: pnpx wait-on tcp:localhost:8113
151+
run: pnpm exec wait-on tcp:localhost:8113
152152

153153
- name: Wait on ClickHouse
154-
run: pnpx wait-on http://localhost:8136/ping
154+
run: pnpm exec wait-on http://localhost:8136/ping
155155

156156
- name: Initialize database
157157
run: pnpm run db:init
@@ -200,7 +200,7 @@ jobs:
200200
uses: JarvusInnovations/background-action@v1.0.7
201201
if: ${{ hashFiles('apps/backend/scripts/run-cron-jobs.ts') != '' }}
202202
with:
203-
run: pnpm -C apps/backend run with-env:dev tsx scripts/run-cron-jobs.ts --log-order=stream &
203+
run: pnpm -C apps/backend run run-cron-jobs:test --log-order=stream &
204204
wait-on: |
205205
http://localhost:8102
206206
tail: true
@@ -339,13 +339,13 @@ jobs:
339339
run: pnpm run wait-until-postgres-is-ready:pg_isready
340340

341341
- name: Wait on Inbucket
342-
run: pnpx wait-on tcp:localhost:8129
342+
run: pnpm exec wait-on tcp:localhost:8129
343343

344344
- name: Wait on Svix
345-
run: pnpx wait-on tcp:localhost:8113
345+
run: pnpm exec wait-on tcp:localhost:8113
346346

347347
- name: Wait on ClickHouse
348-
run: pnpx wait-on http://localhost:8136/ping
348+
run: pnpm exec wait-on http://localhost:8136/ping
349349

350350
- name: Initialize database
351351
run: pnpm run db:init
@@ -394,7 +394,7 @@ jobs:
394394
uses: JarvusInnovations/background-action@v1.0.7
395395
if: ${{ hashFiles('apps/backend/scripts/run-cron-jobs.ts') != '' }}
396396
with:
397-
run: pnpm -C apps/backend run with-env:dev tsx scripts/run-cron-jobs.ts --log-order=stream &
397+
run: pnpm -C apps/backend run run-cron-jobs:test --log-order=stream &
398398
wait-on: |
399399
http://localhost:8102
400400
tail: true

.github/workflows/e2e-api-tests-local-emulator.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,16 @@ jobs:
9393
run: pnpm run wait-until-postgres-is-ready:pg_isready
9494

9595
- name: Wait on Inbucket
96-
run: pnpx wait-on tcp:localhost:8129
96+
run: pnpm exec wait-on tcp:localhost:8129
9797

9898
- name: Wait on Svix
99-
run: pnpx wait-on tcp:localhost:8113
99+
run: pnpm exec wait-on tcp:localhost:8113
100100

101101
- name: Wait on QStash
102-
run: pnpx wait-on tcp:localhost:8125
102+
run: pnpm exec wait-on tcp:localhost:8125
103103

104104
- name: Wait on ClickHouse
105-
run: pnpx wait-on http://localhost:8136/ping
105+
run: pnpm exec wait-on http://localhost:8136/ping
106106

107107
- name: Initialize database
108108
run: pnpm run db:init

.github/workflows/e2e-api-tests.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ jobs:
9999
run: pnpm run wait-until-postgres-is-ready:pg_isready
100100

101101
- name: Wait on Inbucket
102-
run: pnpx wait-on tcp:localhost:8129
102+
run: pnpm exec wait-on tcp:localhost:8129
103103

104104
- name: Wait on Svix
105-
run: pnpx wait-on tcp:localhost:8113
105+
run: pnpm exec wait-on tcp:localhost:8113
106106

107107
- name: Wait on QStash
108-
run: pnpx wait-on tcp:localhost:8125
108+
run: pnpm exec wait-on tcp:localhost:8125
109109

110110
- name: Wait on ClickHouse
111-
run: pnpx wait-on http://localhost:8136/ping
111+
run: pnpm exec wait-on http://localhost:8136/ping
112112

113113
- name: Initialize database
114114
run: pnpm run db:init

.github/workflows/e2e-custom-base-port-api-tests.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ jobs:
9292
run: pnpm run wait-until-postgres-is-ready:pg_isready
9393

9494
- name: Wait on Inbucket
95-
run: pnpx wait-on tcp:localhost:6729
95+
run: pnpm exec wait-on tcp:localhost:6729
9696

9797
- name: Wait on Svix
98-
run: pnpx wait-on tcp:localhost:6713
98+
run: pnpm exec wait-on tcp:localhost:6713
9999

100100
- name: Wait on QStash
101-
run: pnpx wait-on tcp:localhost:6725
101+
run: pnpm exec wait-on tcp:localhost:6725
102102

103103
- name: Wait on ClickHouse
104-
run: pnpx wait-on http://localhost:6736/ping
104+
run: pnpm exec wait-on http://localhost:6736/ping
105105

106106
- name: Initialize database
107107
run: pnpm run db:init
@@ -145,7 +145,7 @@ jobs:
145145
- name: Start run-cron-jobs in background
146146
uses: JarvusInnovations/background-action@v1.0.7
147147
with:
148-
run: pnpm -C apps/backend run run-cron-jobs --log-order=stream &
148+
run: pnpm -C apps/backend run run-cron-jobs:test --log-order=stream &
149149
wait-on: |
150150
http://localhost:6702
151151
tail: true
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# TODO: keep in sync with e2e-tests.yaml — this is a near-copy with the backend
2+
# started on the fallback port (8110) only, so the SDK exercises fallback logic.
3+
name: Runs E2E Fallback Tests
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
- dev
10+
pull_request:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
15+
16+
jobs:
17+
build:
18+
name: E2E Fallback Tests (Node ${{ matrix.node-version }})
19+
runs-on: ubicloud-standard-8
20+
env:
21+
NODE_ENV: test
22+
STACK_ENABLE_HARDCODED_PASSKEY_CHALLENGE_FOR_TESTING: yes
23+
STACK_DATABASE_CONNECTION_STRING: "postgres://postgres:PASSWORD-PLACEHOLDER--uqfEC1hmmv@localhost:8128/stackframe"
24+
STACK_EXTERNAL_DB_SYNC_MAX_DURATION_MS: "20000"
25+
STACK_EXTERNAL_DB_SYNC_DIRECT: "false"
26+
# SDK reads this as the primary URL, discovers hardcoded fallback to port 8110
27+
NEXT_PUBLIC_STACK_API_URL: "http://localhost:8102"
28+
# Tells js-helpers to omit explicit baseUrl so the SDK exercises fallback logic
29+
STACK_TEST_SDK_FALLBACK: "true"
30+
31+
strategy:
32+
matrix:
33+
node-version: [22.x]
34+
35+
steps:
36+
- uses: actions/checkout@v6
37+
38+
- name: Setup Node.js ${{ matrix.node-version }}
39+
uses: actions/setup-node@v6
40+
with:
41+
node-version: ${{ matrix.node-version }}
42+
43+
- name: Setup pnpm
44+
uses: pnpm/action-setup@v4
45+
46+
- name: Start Docker Compose in background
47+
uses: JarvusInnovations/background-action@v1.0.7
48+
with:
49+
run: docker compose -f docker/dependencies/docker.compose.yaml up --pull always -d &
50+
wait-on: /dev/null
51+
tail: true
52+
wait-for: 3s
53+
log-output-if: true
54+
55+
- name: Install dependencies
56+
run: pnpm install --frozen-lockfile
57+
58+
- name: Create .env.test.local files
59+
run: |
60+
cp apps/backend/.env.development apps/backend/.env.test.local
61+
cp apps/dashboard/.env.development apps/dashboard/.env.test.local
62+
cp apps/e2e/.env.development apps/e2e/.env.test.local
63+
cp docs/.env.development docs/.env.test.local
64+
cp examples/cjs-test/.env.development examples/cjs-test/.env.test.local
65+
cp examples/demo/.env.development examples/demo/.env.test.local
66+
cp examples/docs-examples/.env.development examples/docs-examples/.env.test.local
67+
cp examples/e-commerce/.env.development examples/e-commerce/.env.test.local
68+
cp examples/middleware/.env.development examples/middleware/.env.test.local
69+
cp examples/supabase/.env.development examples/supabase/.env.test.local
70+
cp examples/convex/.env.development examples/convex/.env.test.local
71+
72+
- name: Build
73+
run: pnpm build
74+
75+
- name: Wait on Postgres
76+
run: pnpm run wait-until-postgres-is-ready:pg_isready
77+
78+
- name: Wait on Inbucket
79+
run: pnpx wait-on tcp:localhost:8129
80+
81+
- name: Wait on Svix
82+
run: pnpx wait-on tcp:localhost:8113
83+
84+
- name: Wait on QStash
85+
run: pnpx wait-on tcp:localhost:8125
86+
87+
- name: Wait on ClickHouse
88+
run: pnpx wait-on http://localhost:8136/ping
89+
90+
- name: Initialize database
91+
run: pnpm run db:init
92+
93+
# Start backend ONLY on fallback port 8110 — primary port 8102 is intentionally left down
94+
# so the SDK exercises its fallback logic for every request.
95+
- name: Start stack-backend on fallback port (8110)
96+
uses: JarvusInnovations/background-action@v1.0.7
97+
with:
98+
run: pnpm -C apps/backend run with-env:test next start --port 8110 &
99+
wait-on: |
100+
http://localhost:8110
101+
tail: true
102+
wait-for: 30s
103+
log-output-if: true
104+
105+
- name: Start stack-dashboard in background
106+
uses: JarvusInnovations/background-action@v1.0.7
107+
with:
108+
run: pnpm run start:dashboard --log-order=stream &
109+
wait-on: |
110+
http://localhost:8101
111+
tail: true
112+
wait-for: 30s
113+
log-output-if: true
114+
115+
- name: Start mock-oauth-server in background
116+
uses: JarvusInnovations/background-action@v1.0.7
117+
with:
118+
run: pnpm run start:mock-oauth-server --log-order=stream &
119+
wait-on: |
120+
http://localhost:8110
121+
tail: true
122+
wait-for: 30s
123+
log-output-if: true
124+
125+
- name: Start run-email-queue in background
126+
uses: JarvusInnovations/background-action@v1.0.7
127+
with:
128+
run: pnpm -C apps/backend run run-email-queue --log-order=stream &
129+
wait-on: |
130+
http://localhost:8110
131+
tail: true
132+
wait-for: 30s
133+
log-output-if: true
134+
135+
- name: Start run-cron-jobs in background
136+
uses: JarvusInnovations/background-action@v1.0.7
137+
with:
138+
run: pnpm -C apps/backend run run-cron-jobs:test --log-order=stream &
139+
wait-on: |
140+
http://localhost:8110
141+
tail: true
142+
wait-for: 30s
143+
log-output-if: true
144+
145+
- name: Wait 10 seconds
146+
run: sleep 10
147+
148+
- name: Verify primary port 8102 is NOT running
149+
run: |
150+
if curl -s -o /dev/null -w "%{http_code}" http://localhost:8102/health 2>/dev/null | grep -q "200"; then
151+
echo "ERROR: Primary backend on port 8102 should NOT be running for fallback tests"
152+
exit 1
153+
fi
154+
echo "Confirmed: primary port 8102 is down, fallback tests will exercise SDK fallback logic"
155+
156+
# Only run JS SDK tests — these exercise the SDK's fallback logic.
157+
# Backend API tests use direct HTTP calls that don't go through fallback.
158+
# Exclude cross-domain-auth which hardcodes the primary URL.
159+
- name: Run SDK fallback tests
160+
run: pnpm -w run pre && cd apps/e2e && npx vitest run tests/js/ --exclude '**/{cross-domain-auth,oauth,email-template-existing-project}*'
161+
162+
- name: Print Docker Compose logs
163+
if: always()
164+
run: docker compose -f docker/dependencies/docker.compose.yaml logs

.github/workflows/lint-and-build.yaml

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

1818
strategy:
1919
matrix:
20-
node-version: [latest]
20+
node-version: [24]
2121

2222
steps:
2323
- uses: actions/checkout@v6

.github/workflows/qemu-emulator-build.yaml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,23 @@ env:
2626
jobs:
2727
build:
2828
name: Build QEMU Image (${{ matrix.arch }})
29-
runs-on: ubicloud-standard-8
29+
runs-on: ${{ matrix.runner }}
3030
timeout-minutes: 120
3131
strategy:
3232
fail-fast: false
3333
matrix:
3434
include:
35+
# amd64 runs natively under KVM on ubicloud's amd64 runner.
3536
- arch: amd64
37+
runner: ubicloud-standard-8
38+
# arm64 runs under cross-arch TCG on ubicloud's amd64 runner.
39+
# No KVM for arm64 guests on an amd64 host; cortex-a72 + V8
40+
# --jitless together sidestep the SIGTRAPs that cross-arch TCG
41+
# hits on aggressive arm64 JIT code. Smoke test is still skipped
42+
# because the backend can't come up reliably under cross-arch
43+
# TCG within any sane window.
3644
- arch: arm64
45+
runner: ubicloud-standard-8
3746

3847
steps:
3948
- uses: actions/checkout@v6
@@ -47,7 +56,20 @@ jobs:
4756
- name: Install QEMU dependencies
4857
run: |
4958
sudo apt-get update
50-
sudo apt-get install -y qemu-system-x86 qemu-system-arm qemu-utils genisoimage socat qemu-efi-aarch64
59+
sudo apt-get install -y qemu-system-x86 qemu-system-arm qemu-kvm qemu-utils genisoimage socat qemu-efi-aarch64
60+
61+
- name: Enable KVM access
62+
run: |
63+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
64+
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
65+
sudo udevadm control --reload-rules
66+
sudo udevadm trigger --name-match=kvm || true
67+
ls -la /dev/kvm || echo "no /dev/kvm present"
68+
if [ -w /dev/kvm ]; then
69+
echo "KVM is writable — hardware acceleration will be used"
70+
else
71+
echo "WARNING: /dev/kvm is not writable — will fall back to TCG (very slow)"
72+
fi
5173
5274
- name: Build QEMU image
5375
run: |
@@ -58,20 +80,27 @@ jobs:
5880
- name: Generate emulator env
5981
run: node docker/local-emulator/generate-env-development.mjs
6082

83+
# arm64 runs under cross-arch TCG on an amd64 runner; the backend's
84+
# V8 TurboFan JIT re-triggers the SIGTRAPs we dodge in migrations
85+
# with --no-opt, and even if it didn't, boot is too slow under TCG
86+
# to verify in any sane window. amd64 KVM already exercises the
87+
# service stack; real arm64 hosts have KVM for end-users.
6188
- name: Start emulator and verify
89+
if: matrix.arch == 'amd64'
6290
run: |
6391
chmod +x docker/local-emulator/qemu/run-emulator.sh
6492
EMULATOR_ARCH=${{ matrix.arch }} \
6593
EMULATOR_READY_TIMEOUT=3200 \
6694
docker/local-emulator/qemu/run-emulator.sh start
6795
6896
- name: Verify services are healthy
97+
if: matrix.arch == 'amd64'
6998
run: |
7099
EMULATOR_ARCH=${{ matrix.arch }} \
71100
docker/local-emulator/qemu/run-emulator.sh status
72101
73102
- name: Stop emulator
74-
if: always()
103+
if: always() && matrix.arch == 'amd64'
75104
run: |
76105
EMULATOR_ARCH=${{ matrix.arch }} \
77106
docker/local-emulator/qemu/run-emulator.sh stop

0 commit comments

Comments
 (0)