Skip to content

Commit 28003a2

Browse files
authored
Merge branch 'dev' into anon-cli-auth
2 parents 754ad22 + 1b3e7f5 commit 28003a2

270 files changed

Lines changed: 57626 additions & 2372 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.

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ dist
6161
.docusaurus
6262
.cache-loader
6363
**.tsbuildinfo
64+
docker/local-emulator/qemu/images
65+
docker/local-emulator/qemu/run
6466

6567
.xata*
6668

@@ -149,4 +151,3 @@ packages/stack/*
149151
!packages/react/package.json
150152
!packages/next/package.json
151153
!packages/stack/package.json
152-

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

Lines changed: 6 additions & 6 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
@@ -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

.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: 4 additions & 4 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

.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
Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
name: Build & Publish QEMU Emulator Images
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
pull_request:
9+
paths:
10+
- 'docker/local-emulator/**'
11+
- '.github/workflows/qemu-emulator-build.yaml'
12+
workflow_dispatch:
13+
inputs:
14+
publish:
15+
description: 'Publish images to GitHub Releases'
16+
type: boolean
17+
default: false
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
22+
23+
env:
24+
EMULATOR_IMAGE_NAME: stack-local-emulator
25+
26+
jobs:
27+
build:
28+
name: Build QEMU Image (${{ matrix.arch }})
29+
runs-on: ubicloud-standard-8
30+
timeout-minutes: 120
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
include:
35+
- arch: amd64
36+
- arch: arm64
37+
38+
steps:
39+
- uses: actions/checkout@v6
40+
41+
- name: Set up QEMU user-mode emulation
42+
uses: docker/setup-qemu-action@v3
43+
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@v3
46+
47+
- name: Install QEMU dependencies
48+
run: |
49+
sudo apt-get update
50+
sudo apt-get install -y qemu-system-x86 qemu-system-arm qemu-utils genisoimage socat qemu-efi-aarch64
51+
52+
- name: Build QEMU image
53+
run: |
54+
chmod +x docker/local-emulator/qemu/build-image.sh
55+
EMULATOR_PROVISION_TIMEOUT=6000 \
56+
docker/local-emulator/qemu/build-image.sh ${{ matrix.arch }}
57+
58+
- name: Generate emulator env
59+
run: node docker/local-emulator/generate-env-development.mjs
60+
61+
- name: Start emulator and verify
62+
run: |
63+
chmod +x docker/local-emulator/qemu/run-emulator.sh
64+
EMULATOR_ARCH=${{ matrix.arch }} \
65+
EMULATOR_READY_TIMEOUT=3200 \
66+
docker/local-emulator/qemu/run-emulator.sh start
67+
68+
- name: Verify services are healthy
69+
run: |
70+
EMULATOR_ARCH=${{ matrix.arch }} \
71+
docker/local-emulator/qemu/run-emulator.sh status
72+
73+
- name: Stop emulator
74+
if: always()
75+
run: |
76+
EMULATOR_ARCH=${{ matrix.arch }} \
77+
docker/local-emulator/qemu/run-emulator.sh stop
78+
79+
- name: Package image
80+
run: |
81+
BASE_IMG="docker/local-emulator/qemu/images/stack-emulator-${{ matrix.arch }}.qcow2"
82+
cp "$BASE_IMG" "stack-emulator-${{ matrix.arch }}.qcow2"
83+
84+
- name: Upload image artifact
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: qemu-emulator-${{ matrix.arch }}
88+
path: stack-emulator-${{ matrix.arch }}.qcow2
89+
retention-days: 30
90+
compression-level: 0
91+
92+
test:
93+
name: Smoke Test (${{ matrix.arch }})
94+
needs: build
95+
runs-on: ubicloud-standard-8
96+
timeout-minutes: 60
97+
strategy:
98+
fail-fast: false
99+
matrix:
100+
include:
101+
- arch: amd64
102+
103+
steps:
104+
- uses: actions/checkout@v6
105+
106+
- name: Install QEMU dependencies
107+
run: |
108+
sudo apt-get update
109+
sudo apt-get install -y qemu-system-x86 qemu-utils genisoimage socat
110+
111+
- name: Download built image
112+
uses: actions/download-artifact@v4
113+
with:
114+
name: qemu-emulator-${{ matrix.arch }}
115+
path: docker/local-emulator/qemu/images/
116+
117+
- name: Generate emulator env
118+
run: node docker/local-emulator/generate-env-development.mjs
119+
120+
- name: Start emulator from artifact
121+
run: |
122+
chmod +x docker/local-emulator/qemu/run-emulator.sh docker/local-emulator/qemu/common.sh
123+
EMULATOR_ARCH=${{ matrix.arch }} \
124+
EMULATOR_READY_TIMEOUT=600 \
125+
docker/local-emulator/qemu/run-emulator.sh start
126+
127+
- name: Verify services are healthy
128+
run: |
129+
EMULATOR_ARCH=${{ matrix.arch }} \
130+
docker/local-emulator/qemu/run-emulator.sh status
131+
132+
- name: Smoke test — backend health
133+
run: curl -sf http://localhost:26701/health?db=1
134+
135+
- name: Smoke test — dashboard reachable
136+
run: curl -sf -o /dev/null -w "HTTP %{http_code}\n" http://localhost:26700/handler/sign-in
137+
138+
- name: Smoke test — MinIO health
139+
run: curl -sf http://localhost:26702/minio/health/live
140+
141+
- name: Smoke test — Inbucket reachable
142+
run: curl -sf -o /dev/null -w "HTTP %{http_code}\n" http://localhost:26703/
143+
144+
- name: Stop emulator
145+
if: always()
146+
run: |
147+
EMULATOR_ARCH=${{ matrix.arch }} \
148+
docker/local-emulator/qemu/run-emulator.sh stop
149+
150+
- name: Print serial log on failure
151+
if: failure()
152+
run: tail -100 docker/local-emulator/qemu/run/vm/serial.log 2>/dev/null || true
153+
154+
publish:
155+
name: Publish to GitHub Releases
156+
needs: [build, test]
157+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || (github.event_name == 'workflow_dispatch' && inputs.publish)
158+
runs-on: ubuntu-latest
159+
permissions:
160+
contents: write
161+
162+
steps:
163+
- uses: actions/checkout@v6
164+
165+
- name: Download all artifacts
166+
uses: actions/download-artifact@v4
167+
with:
168+
path: artifacts
169+
170+
- name: Prepare release assets
171+
run: |
172+
mkdir -p release
173+
SHORT_SHA="${GITHUB_SHA:0:8}"
174+
BRANCH="${GITHUB_REF_NAME}"
175+
DATE="$(date -u +%Y%m%d)"
176+
TAG="emulator-${BRANCH}-${DATE}-${SHORT_SHA}"
177+
echo "RELEASE_TAG=${TAG}" >> "$GITHUB_ENV"
178+
echo "SHORT_SHA=${SHORT_SHA}" >> "$GITHUB_ENV"
179+
180+
for f in artifacts/qemu-emulator-*/*.qcow2; do
181+
cp "$f" release/
182+
done
183+
184+
cat > release-notes.md <<EOF
185+
## QEMU Emulator Images
186+
187+
Built from \`${BRANCH}\` @ \`${GITHUB_SHA}\`
188+
189+
### Images
190+
| File | Description |
191+
|------|-------------|
192+
| \`stack-emulator-arm64.qcow2\` | ARM64 emulator image |
193+
| \`stack-emulator-amd64.qcow2\` | AMD64 emulator image |
194+
195+
### Usage
196+
\`\`\`bash
197+
stack emulator pull
198+
stack emulator start
199+
\`\`\`
200+
EOF
201+
202+
ls -lh release/
203+
204+
- name: Create or update GitHub Release
205+
env:
206+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
207+
run: |
208+
TITLE="QEMU Emulator — ${{ github.ref_name }} ($SHORT_SHA)"
209+
210+
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
211+
gh release edit "$RELEASE_TAG" \
212+
--title "$TITLE" \
213+
--notes-file release-notes.md \
214+
--prerelease
215+
gh release upload "$RELEASE_TAG" release/* --clobber
216+
else
217+
gh release create "$RELEASE_TAG" \
218+
--title "$TITLE" \
219+
--notes-file release-notes.md \
220+
--prerelease \
221+
release/*
222+
fi
223+
224+
- name: Update latest tag for branch
225+
env:
226+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
227+
run: |
228+
LATEST_TAG="emulator-${{ github.ref_name }}-latest"
229+
TITLE="QEMU Emulator — ${{ github.ref_name }} (latest)"
230+
NOTES="Latest emulator images from \`${{ github.ref_name }}\`. Auto-updated on each build."
231+
232+
if gh release view "$LATEST_TAG" >/dev/null 2>&1; then
233+
gh release edit "$LATEST_TAG" \
234+
--draft \
235+
--prerelease \
236+
--target "${{ github.sha }}" \
237+
--title "$TITLE" \
238+
--notes "$NOTES"
239+
else
240+
gh release create "$LATEST_TAG" \
241+
--draft \
242+
--prerelease \
243+
--target "${{ github.sha }}" \
244+
--title "$TITLE" \
245+
--notes "$NOTES" \
246+
|| gh release edit "$LATEST_TAG" \
247+
--draft \
248+
--prerelease \
249+
--target "${{ github.sha }}" \
250+
--title "$TITLE" \
251+
--notes "$NOTES"
252+
fi
253+
254+
gh release upload "$LATEST_TAG" release/* --clobber
255+
gh release edit "$LATEST_TAG" --draft=false --prerelease

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ vite.config.ts.timestamp-*
2424
.eslintcache
2525
.env.local
2626
.env.*.local
27+
docker/local-emulator/.env.development
2728
scratch/
2829

2930
npm-debug.log*
@@ -51,6 +52,7 @@ dist
5152
.docusaurus
5253
.cache-loader
5354
**.tsbuildinfo
55+
implementation.generated.ts
5456

5557
.xata*
5658

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ To see all development ports, refer to the index.html of `apps/dev-launchpad/pub
108108
- Any design components you add or modify in the dashboard, update the Playground page accordingly to showcase the changes.
109109
- Unless very clearly equivalent from types, prefer explicit null/undefinedness checks over boolean checks, eg. `foo == null` instead of `!foo`.
110110
- Ensure **aggressively** that all code has low coupling and high cohesion. This is really important as it makes sure our code remains consistent and maintainable. Eagerly refactor things into better abstractions and look out for them actively.
111+
- Whenever you change the URL of a page in the docs (or remove one), add a redirect in the docs-mintlify/docs.json file to make sure we don't lose any SEO juice.
111112

112113
### Code-related
113114
- Use ES6 maps instead of records wherever you can.

0 commit comments

Comments
 (0)