Skip to content

Commit 687a9df

Browse files
Merge branch 'phoebe/http-handlers-webhooks' into jlarabie/http-handler-csharp
2 parents 30a8263 + cadc224 commit 687a9df

784 files changed

Lines changed: 28283 additions & 59126 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
@@ -5,6 +5,7 @@ rustflags = ["--cfg", "tokio_unstable"]
55
bump-versions = "run -p upgrade-version --"
66
llm = "run --package xtask-llm-benchmark --bin llm_benchmark --"
77
ci = "run -p ci --"
8+
regen = "run -p regen --"
89
smoketest = "ci smoketests --"
910
smoketests = "smoketest"
1011
lint = "ci lint --"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Set up pnpm
2+
description: Install pnpm and configure repository package-age policy before any install
3+
inputs:
4+
run_install:
5+
description: Run pnpm install after configuring pnpm
6+
required: false
7+
default: "false"
8+
runs:
9+
using: composite
10+
steps:
11+
- uses: pnpm/action-setup@v4
12+
13+
- name: Configure pnpm package age policy
14+
shell: bash
15+
run: pnpm config set --global minimumReleaseAge 1440
16+
17+
- name: Install dependencies
18+
if: inputs.run_install == 'true'
19+
shell: bash
20+
run: pnpm install

.github/workflows/ci.yml

Lines changed: 37 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
with:
8181
node-version: 18
8282

83-
- uses: pnpm/action-setup@v4
83+
- uses: ./.github/actions/setup-pnpm
8484
with:
8585
run_install: true
8686

@@ -221,7 +221,7 @@ jobs:
221221
with:
222222
node-version: 22
223223

224-
- uses: pnpm/action-setup@v4
224+
- uses: ./.github/actions/setup-pnpm
225225
with:
226226
run_install: true
227227

@@ -297,7 +297,7 @@ jobs:
297297
with:
298298
node-version: 22
299299

300-
- uses: pnpm/action-setup@v4
300+
- uses: ./.github/actions/setup-pnpm
301301
with:
302302
run_install: true
303303

@@ -524,7 +524,7 @@ jobs:
524524
with:
525525
node-version: 22
526526

527-
- uses: pnpm/action-setup@v4
527+
- uses: ./.github/actions/setup-pnpm
528528
with:
529529
run_install: true
530530

@@ -558,39 +558,6 @@ jobs:
558558
run: |
559559
cargo ci cli-docs
560560
561-
llm_ci_check:
562-
name: Verify LLM benchmark is up to date
563-
permissions:
564-
contents: read
565-
runs-on: ubuntu-latest
566-
# Disable the tests because they are causing us headaches with merge conflicts and re-runs etc.
567-
if: false
568-
steps:
569-
# Build the tool from master to ensure consistent hash computation
570-
# with the llm-benchmark-update workflow (which also uses master's tool).
571-
- name: Checkout master (build tool from trusted code)
572-
uses: actions/checkout@v4
573-
with:
574-
ref: master
575-
fetch-depth: 1
576-
577-
- uses: dtolnay/rust-toolchain@stable
578-
- uses: Swatinem/rust-cache@v2
579-
580-
- name: Install llm-benchmark tool from master
581-
run: |
582-
cargo install --path tools/xtask-llm-benchmark --locked
583-
command -v llm_benchmark
584-
585-
# Now checkout the PR branch to verify its benchmark files
586-
- name: Checkout PR branch
587-
uses: actions/checkout@v4
588-
with:
589-
clean: false
590-
591-
- name: Run hash check (both langs)
592-
run: llm_benchmark ci-check
593-
594561
unity-testsuite:
595562
needs: [lints]
596563
# Skip if this is an external contribution.
@@ -689,7 +656,7 @@ jobs:
689656
}
690657
691658
- name: Hydrate Unity SDK DLLs
692-
run: cargo ci dlls
659+
run: cargo regen csharp dlls
693660

694661
- name: Check Unity meta files
695662
uses: DeNA/unity-meta-check@v3
@@ -830,10 +797,9 @@ jobs:
830797
ln -sf $CARGO_HOME/bin/spacetimedb-cli $CARGO_HOME/bin/spacetime
831798
832799
- name: Check quickstart-chat bindings are up to date
833-
working-directory: sdks/csharp
834800
run: |
835-
bash tools~/gen-quickstart.sh
836-
"${GITHUB_WORKSPACE}"/tools/check-diff.sh examples~/quickstart-chat || {
801+
bash sdks/csharp/tools~/gen-quickstart.sh
802+
tools/check-diff.sh templates/chat-console-cs/module_bindings || {
837803
echo 'Error: quickstart-chat bindings have changed. Please run `sdks/csharp/tools~/gen-quickstart.sh`.'
838804
exit 1
839805
}
@@ -887,15 +853,20 @@ jobs:
887853
const targetRepo = process.env.TARGET_REPO;
888854
// Use the ref for pull requests because the head sha is brittle (github does some extra dance where it merges in master).
889855
const publicRef = (context.eventName === 'pull_request') ? context.payload.pull_request.head.ref : context.sha;
856+
const publicPrNumber = context.payload.pull_request?.number ?? context.payload.inputs?.pr_number;
890857
const preDispatch = new Date().toISOString();
891-
858+
const inputs = { public_ref: publicRef };
859+
if (publicPrNumber) {
860+
inputs.public_pr_number = String(publicPrNumber);
861+
}
862+
892863
// Dispatch the workflow in the target repository
893864
await github.rest.actions.createWorkflowDispatch({
894865
owner: targetOwner,
895866
repo: targetRepo,
896867
workflow_id: workflowId,
897868
ref: targetRef,
898-
inputs: { public_ref: publicRef }
869+
inputs,
899870
});
900871
901872
const sleep = (ms) => new Promise(r => setTimeout(r, ms));
@@ -1024,36 +995,6 @@ jobs:
1024995
- name: Check global.json policy
1025996
run: cargo ci global-json-policy
1026997

1027-
warn-python-smoketests:
1028-
name: Check for Python smoketest edits
1029-
runs-on: ubuntu-latest
1030-
if: github.event_name == 'pull_request'
1031-
permissions:
1032-
contents: read
1033-
steps:
1034-
- name: Checkout sources
1035-
uses: actions/checkout@v4
1036-
with:
1037-
fetch-depth: 0
1038-
1039-
- name: Fail if Python smoketests were modified
1040-
run: |
1041-
MERGE_BASE="$(git merge-base origin/${{ github.base_ref }} HEAD)"
1042-
PYTHON_SMOKETEST_CHANGES="$(git diff --name-only "$MERGE_BASE" HEAD -- 'smoketests/**.py')"
1043-
1044-
if [ -n "$PYTHON_SMOKETEST_CHANGES" ]; then
1045-
echo "::error::This PR modifies legacy Python smoketests. Please add new tests to the Rust smoketests in crates/smoketests/ instead."
1046-
echo ""
1047-
echo "Changed files:"
1048-
echo "$PYTHON_SMOKETEST_CHANGES"
1049-
echo ""
1050-
echo "The Python smoketests are being replaced by Rust smoketests."
1051-
echo "See crates/smoketests/DEVELOP.md for instructions on adding Rust smoketests."
1052-
exit 1
1053-
fi
1054-
1055-
echo "No Python smoketest changes detected."
1056-
1057998
smoketests_mod_rs_complete:
1058999
name: Check smoketests/mod.rs is complete
10591000
runs-on: ubuntu-latest
@@ -1122,7 +1063,7 @@ jobs:
11221063
with:
11231064
node-version: '22'
11241065

1125-
- uses: pnpm/action-setup@v4
1066+
- uses: ./.github/actions/setup-pnpm
11261067
with:
11271068
run_install: true
11281069

@@ -1159,7 +1100,7 @@ jobs:
11591100
with:
11601101
node-version: 22
11611102

1162-
- uses: pnpm/action-setup@v4
1103+
- uses: ./.github/actions/setup-pnpm
11631104
with:
11641105
run_install: true
11651106

@@ -1257,3 +1198,24 @@ jobs:
12571198
# - name: Print rows in the user table
12581199
# if: always()
12591200
# run: spacetime sql quickstart-chat "SELECT * FROM user"
1201+
1202+
version_upgrade_check:
1203+
runs-on: spacetimedb-new-runner-2
1204+
steps:
1205+
- name: Checkout
1206+
uses: actions/checkout@v3
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+
# pnpm is required for regenerating the typescript bindings
1211+
- name: Set up Node.js
1212+
uses: actions/setup-node@v4
1213+
with:
1214+
node-version: 20
1215+
- uses: ./.github/actions/setup-pnpm
1216+
with:
1217+
run_install: true
1218+
- name: Verify that upgrade-version still works
1219+
run: cargo ci version-upgrade-check
1220+
- name: Show diff
1221+
run: git diff HEAD

.github/workflows/docs-publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
node-version: '22'
2222

23-
- uses: pnpm/action-setup@v4
23+
- uses: ./.github/actions/setup-pnpm
2424
with:
2525
run_install: true
2626

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Docs / Update llms files
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
branches:
9+
- docs/release
10+
paths:
11+
- 'docs/docs/**'
12+
- 'skills/**'
13+
workflow_dispatch: # Allow manual trigger
14+
15+
jobs:
16+
update-llms:
17+
runs-on: spacetimedb-new-runner-2
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v3
21+
with:
22+
ref: docs/release
23+
24+
- name: Set up Node.js
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version: '22'
28+
29+
- uses: ./.github/actions/setup-pnpm
30+
with:
31+
run_install: true
32+
33+
- name: Get pnpm store directory
34+
working-directory: sdks/typescript
35+
shell: bash
36+
run: |
37+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
38+
39+
- uses: actions/cache@v4
40+
name: Setup pnpm cache
41+
with:
42+
path: ${{ env.STORE_PATH }}
43+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
44+
restore-keys: |
45+
${{ runner.os }}-pnpm-store-
46+
47+
- name: Install dependencies
48+
working-directory: docs
49+
run: pnpm install
50+
51+
- name: Docusaurus build
52+
working-directory: docs
53+
run: pnpm build
54+
55+
- name: Generate llms files
56+
working-directory: docs
57+
run: node scripts/generate-llms.mjs
58+
59+
- name: Commit updated llms files
60+
working-directory: docs
61+
run: |
62+
git config user.name "github-actions[bot]"
63+
git config user.email "github-actions[bot]@users.noreply.github.com"
64+
git add static/llms.md
65+
git diff --staged --quiet && echo "No changes" && exit 0
66+
git commit -m "Update llms files from docs build"
67+
git push

0 commit comments

Comments
 (0)