Skip to content

Commit f700e85

Browse files
authored
Merge branch 'master' into fix/version-uninstall-missing-error
2 parents 426d52f + 4f2c064 commit f700e85

207 files changed

Lines changed: 7987 additions & 2815 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.

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ llm = "run --package xtask-llm-benchmark --bin llm_benchmark --"
77
ci = "run -p ci --"
88
smoketest = "ci smoketests --"
99
smoketests = "smoketest"
10+
lint = "ci lint --"
1011

1112
[target.x86_64-pc-windows-msvc]
1213
# Use a different linker. Otherwise, the build fails with some obscure linker error that

.github/CODEOWNERS

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
/crates/core/src/db/datastore/traits.rs @cloutiertyler
22
/rust-toolchain.toml @cloutiertyler
3-
/.github/CODEOWNERS @cloutiertyler
43
LICENSE @cloutiertyler
54
LICENSE.txt @cloutiertyler
65
/licenses/ @cloutiertyler
76
/crates/client-api-messages/src/websocket.rs @centril @gefjon
87

98
/crates/cli/src/ @bfops @cloutiertyler @jdetter
109
/tools/ci/ @bfops @cloutiertyler @jdetter
11-
/tools/upgrade-version/ @bfops @jdetter
12-
/tools/license-check/ @bfops @jdetter
13-
/.github/ @bfops @jdetter
10+
/tools/upgrade-version/ @bfops @jdetter @cloutiertyler
11+
/tools/license-check/ @bfops @jdetter @cloutiertyler
12+
/.github/ @bfops @jdetter @cloutiertyler
1413

1514
/crates/sdk/examples/quickstart-chat/ @gefjon
1615
/modules/quickstart-chat/ @gefjon
16+
17+
/.github/CODEOWNERS @cloutiertyler

.github/workflows/ci.yml

Lines changed: 166 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ concurrency:
1717
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.inputs.pr_number || format('sha-{0}', github.sha) }}
1818
cancel-in-progress: true
1919

20+
permissions:
21+
contents: read
22+
pull-requests: read
23+
2024
jobs:
2125
smoketests:
2226
needs: [lints]
@@ -27,7 +31,7 @@ jobs:
2731
- name: Linux
2832
runner: spacetimedb-new-runner-2
2933
- name: Windows
30-
runner: windows-latest
34+
runner: spacetimedb-windows-runner
3135
runs-on: ${{ matrix.runner }}
3236
timeout-minutes: 120
3337
env:
@@ -171,13 +175,6 @@ jobs:
171175
}
172176
cargo ci smoketests -- --test-threads=1
173177
174-
- name: Check for changes
175-
run: |
176-
tools/check-diff.sh crates/smoketests || {
177-
echo 'Error: There is a diff in the smoketests directory.'
178-
exit 1
179-
}
180-
181178
test:
182179
needs: [lints]
183180
name: Test Suite
@@ -262,10 +259,6 @@ jobs:
262259
263260
wasm-bindgen --version
264261
265-
- name: Build typescript module sdk
266-
working-directory: crates/bindings-typescript
267-
run: pnpm build
268-
269262
# Source emsdk environment to make emcc (Emscripten compiler) available in PATH.
270263
- name: Run tests
271264
run: |
@@ -299,6 +292,15 @@ jobs:
299292
with:
300293
global-json-file: global.json
301294

295+
- name: Set up Node.js
296+
uses: actions/setup-node@v4
297+
with:
298+
node-version: 22
299+
300+
- uses: pnpm/action-setup@v4
301+
with:
302+
run_install: true
303+
302304
- name: Run ci lint
303305
run: cargo ci lint
304306

@@ -336,24 +338,8 @@ jobs:
336338
- uses: dsherret/rust-toolchain-file@v1
337339
- name: Set default rust toolchain
338340
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
339-
- name: Set up Python env
340-
run: |
341-
test -d venv || python3 -m venv venv
342-
venv/bin/pip3 install argparse toml
343341
- name: Run checks
344-
run: |
345-
set -ueo pipefail
346-
FAILED=0
347-
ROOTS=(spacetimedb spacetimedb-sdk)
348-
CRATES=$(venv/bin/python3 tools/find-publish-list.py --recursive --directories --quiet "${ROOTS[@]}")
349-
for crate_dir in $CRATES; do
350-
if ! venv/bin/python3 tools/crate-publish-checks.py "${crate_dir}"; then
351-
FAILED=$(( $FAILED + 1 ))
352-
fi
353-
done
354-
if [ $FAILED -gt 0 ]; then
355-
exit 1
356-
fi
342+
run: cargo ci publish-checks
357343

358344
update:
359345
name: Test spacetimedb-update flow (${{ matrix.target }})
@@ -383,28 +369,10 @@ jobs:
383369
shell: bash
384370
run: sudo apt install -y libssl-dev
385371

386-
- name: Build spacetimedb-update
387-
run: cargo build --features github-token-auth --target ${{ matrix.target }} -p spacetimedb-update
388-
if: runner.os == 'Windows'
389-
390-
- name: Run self-install
391-
env:
392-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
393-
shell: bash
394-
run: |
395-
ROOT_DIR="$(mktemp -d)"
396-
# NOTE(bfops): We need the `github-token-auth` feature because we otherwise tend to get ratelimited when we try to fetch `/releases/latest`.
397-
# My best guess is that, on the GitHub runners, the "anonymous" ratelimit is shared by *all* users of that runner (I think this because it
398-
# happens very frequently on the `macos-runner`, but we haven't seen it on any others).
399-
cargo run --features github-token-auth --target ${{ matrix.target }} -p spacetimedb-update -- self-install --root-dir="${ROOT_DIR}" --yes
400-
"${ROOT_DIR}"/spacetime --root-dir="${ROOT_DIR}" help
401-
if: runner.os == 'Windows'
402-
403372
- name: Test spacetimedb-update
404373
env:
405374
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
406375
run: cargo ci update-flow --target=${{ matrix.target }} --github-token-auth
407-
if: runner.os != 'Windows'
408376

409377
unreal_engine_tests:
410378
name: Unreal Engine Tests
@@ -919,15 +887,16 @@ jobs:
919887
const targetRepo = process.env.TARGET_REPO;
920888
// Use the ref for pull requests because the head sha is brittle (github does some extra dance where it merges in master).
921889
const publicRef = (context.eventName === 'pull_request') ? context.payload.pull_request.head.ref : context.sha;
890+
const publicPrNumber = context.payload.pull_request?.number ?? context.payload.inputs?.pr_number;
922891
const preDispatch = new Date().toISOString();
923-
892+
924893
// Dispatch the workflow in the target repository
925894
await github.rest.actions.createWorkflowDispatch({
926895
owner: targetOwner,
927896
repo: targetRepo,
928897
workflow_id: workflowId,
929898
ref: targetRef,
930-
inputs: { public_ref: publicRef }
899+
inputs: { public_ref: publicRef, public_pr_number: String(publicPrNumber) }
931900
});
932901
933902
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
@@ -1141,3 +1110,151 @@ jobs:
11411110
- name: Verify crates/smoketests/tests/smoketests/mod.rs lists all entries
11421111
run: |
11431112
cargo ci smoketests check-mod-list
1113+
1114+
docs-build:
1115+
name: Docs build
1116+
runs-on: spacetimedb-new-runner-2
1117+
steps:
1118+
- name: Checkout repository
1119+
uses: actions/checkout@v3
1120+
1121+
- name: Set up Node.js
1122+
uses: actions/setup-node@v3
1123+
with:
1124+
node-version: '22'
1125+
1126+
- uses: pnpm/action-setup@v4
1127+
with:
1128+
run_install: true
1129+
1130+
- name: Get pnpm store directory
1131+
working-directory: sdks/typescript
1132+
shell: bash
1133+
run: |
1134+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
1135+
1136+
- uses: actions/cache@v4
1137+
name: Setup pnpm cache
1138+
with:
1139+
path: ${{ env.STORE_PATH }}
1140+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
1141+
restore-keys: |
1142+
${{ runner.os }}-pnpm-store-
1143+
1144+
- uses: dsherret/rust-toolchain-file@v1
1145+
- name: Set default rust toolchain
1146+
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
1147+
1148+
- name: Docusaurus build
1149+
run: cargo ci docs
1150+
1151+
typescript-test:
1152+
name: TypeScript - Tests
1153+
runs-on: spacetimedb-new-runner-2
1154+
steps:
1155+
- name: Checkout repository
1156+
uses: actions/checkout@v4
1157+
1158+
- name: Set up Node.js
1159+
uses: actions/setup-node@v4
1160+
with:
1161+
node-version: 22
1162+
1163+
- uses: pnpm/action-setup@v4
1164+
with:
1165+
run_install: true
1166+
1167+
- name: Get pnpm store directory
1168+
shell: bash
1169+
working-directory: crates/bindings-typescript
1170+
run: |
1171+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
1172+
1173+
- uses: actions/cache@v4
1174+
name: Setup pnpm cache
1175+
with:
1176+
path: ${{ env.STORE_PATH }}
1177+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
1178+
restore-keys: |
1179+
${{ runner.os }}-pnpm-store-
1180+
1181+
# - name: Extract SpacetimeDB branch name from file
1182+
# id: extract-branch
1183+
# run: |
1184+
# # Define the path to the branch file
1185+
# BRANCH_FILE=".github/spacetimedb-branch.txt"
1186+
1187+
# # Default to master if file doesn't exist
1188+
# if [ ! -f "$BRANCH_FILE" ]; then
1189+
# echo "::notice::No SpacetimeDB branch file found, using 'master'"
1190+
# echo "branch=master" >> $GITHUB_OUTPUT
1191+
# exit 0
1192+
# fi
1193+
1194+
# # Read and trim whitespace from the file
1195+
# branch=$(cat "$BRANCH_FILE" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
1196+
1197+
# # Fallback to master if empty
1198+
# if [ -z "$branch" ]; then
1199+
# echo "::warning::SpacetimeDB branch file is empty, using 'master'"
1200+
# branch="master"
1201+
# fi
1202+
1203+
# echo "branch=$branch" >> $GITHUB_OUTPUT
1204+
# echo "Using SpacetimeDB branch from file: $branch"
1205+
1206+
- name: Install Rust toolchain
1207+
uses: dsherret/rust-toolchain-file@v1
1208+
- name: Set default rust toolchain
1209+
run: rustup default $(rustup show active-toolchain | cut -d' ' -f1)
1210+
1211+
- name: Cache Rust dependencies
1212+
uses: Swatinem/rust-cache@v2
1213+
with:
1214+
workspaces: ${{ github.workspace }}
1215+
shared-key: spacetimedb
1216+
# Let the main CI job save the cache since it builds the most things
1217+
save-if: false
1218+
prefix-key: v1
1219+
1220+
# # This step shouldn't be needed, but somehow we end up with caches that are missing librusty_v8.a.
1221+
# # ChatGPT suspects that this could be due to different build invocations using the same target dir,
1222+
# # and this makes sense to me because we only see it in this job where we mix `cargo build -p` with
1223+
# # `cargo build --manifest-path` (which apparently build different dependency trees).
1224+
# # However, we've been unable to fix it so... /shrug
1225+
# - name: Check v8 outputs
1226+
# run: |
1227+
# find "${CARGO_TARGET_DIR}"/ -type f | grep '[/_]v8' || true
1228+
# if ! [ -f "${CARGO_TARGET_DIR}"/debug/gn_out/obj/librusty_v8.a ]; then
1229+
# echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
1230+
# cargo clean -p v8 || true
1231+
# cargo build -p v8
1232+
# fi
1233+
# if ! [ -f "${CARGO_TARGET_DIR}"/release/gn_out/obj/librusty_v8.a ]; then
1234+
# echo "Could not find v8 output file librusty_v8.a; rebuilding manually."
1235+
# cargo clean --release -p v8 || true
1236+
# cargo build --release -p v8
1237+
# fi
1238+
1239+
# - name: Install SpacetimeDB CLI from the local checkout
1240+
# run: |
1241+
# export CARGO_HOME="$HOME/.cargo"
1242+
# echo "$CARGO_HOME/bin" >> "$GITHUB_PATH"
1243+
# cargo install --force --path crates/cli --locked --message-format=short
1244+
# cargo install --force --path crates/standalone --locked --message-format=short
1245+
# # Add a handy alias using the old binary name, so that we don't have to rewrite all scripts (incl. in submodules).
1246+
# ln -sf $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime
1247+
# # Clear any existing information
1248+
# spacetime server clear -y
1249+
1250+
- name: Run TypeScript tests
1251+
run: cargo ci typescript-test
1252+
1253+
# - name: Run quickstart-chat tests
1254+
# working-directory: examples/quickstart-chat
1255+
# run: pnpm test
1256+
#
1257+
# # Run this step always, even if the previous steps fail
1258+
# - name: Print rows in the user table
1259+
# if: always()
1260+
# run: spacetime sql quickstart-chat "SELECT * FROM user"

.github/workflows/discord-posts.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
sudo apt-get update
2121
sudo apt-get install -y gh
2222
23+
# TODO: Perhaps we should merge this into the public-pr-merge.yml workflow, now that that exists.
2324
- name: Send Discord notification
2425
env:
2526
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
@@ -69,3 +70,25 @@ jobs:
6970
# Use `jq` to construct the json data blob in the format required by the webhook.
7071
data="$(jq --null-input --arg msg "$message" '.content=$msg')"
7172
curl -X POST -H 'Content-Type: application/json' -d "$data" "${DISCORD_WEBHOOK_URL}"
73+
74+
invokePrivate:
75+
runs-on: ubuntu-latest
76+
if: github.event.pull_request.merged == true &&
77+
github.event.pull_request.base.ref == 'master'
78+
permissions:
79+
contents: read
80+
steps:
81+
- name: Dispatch private merge workflow
82+
uses: actions/github-script@v7
83+
with:
84+
github-token: ${{ secrets.SPACETIMEDB_PRIVATE_TOKEN }}
85+
script: |
86+
await github.rest.actions.createWorkflowDispatch({
87+
owner: 'clockworklabs',
88+
repo: 'SpacetimeDBPrivate',
89+
workflow_id: 'public-pr-merge.yml',
90+
ref: 'master',
91+
inputs: {
92+
public_pr_number: String(context.payload.pull_request.number),
93+
}
94+
});

.github/workflows/docs-test.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)