Commit Graph

212 Commits

Author SHA1 Message Date
Tyler Cloutier 73881e38f7 Further misc docs changes (#4029)
# Description of Changes

Major documentation overhaul focusing on tables, column types, and
indexes.

  **Quickstart Guides:**
- Updated React, TypeScript, Rust, and C# quickstarts with table/reducer
examples
  - Fixed CLI syntax (positional `--database` argument)
  - Improved template consistency across languages

  **Tables Documentation:**
- Added "Why Tables" section explaining table-oriented design philosophy
(tables as fundamental unit, system tables, data-oriented design
principles)
- Added "Physical and Logical Independence" section explaining how
subscription queries use the relational model independently of physical
storage
- Added brief sections linking to related pages (Visibility,
Constraints, Schedule Tables)
- Renamed "Scheduled Tables" to "Schedule Tables" throughout (tables
store schedules; reducers are scheduled)

  **Column Types:**
  - Split into dedicated page with unified type reference table
- Added "Representing Collections" section (Vec/Array vs table
tradeoffs)
  - Added "Binary Data and Files" section for Vec<u8> storage patterns
- Added "Type Performance" section (smaller types, fixed-size types,
column ordering for alignment)
  - Added complete example struct demonstrating all type categories
  - Renamed "Structured" category to "Composite"

  **Indexes:**
  - Complete rewrite with textbook-style documentation
  - Added "When to Use Indexes" guidance
- Documented single-column and multi-column index syntax (field-level
and table-level)
- Comprehensive range query examples with correct TypeScript `Range`
class syntax
  - Explained multi-column index prefix matching semantics
  - Added index-accelerated deletion examples
  - Included index design guidelines

  **Styling:**
  - Added CSS for table border radius and row separators
  - Created Check component for green checkmarks in tables

  # API and ABI breaking changes

  None. Documentation only.

  # Expected complexity level and risk

  1 - Documentation changes only, no code changes.

  # Testing

  - [ ] Verify docs build without errors
  - [ ] Review rendered pages for formatting issues
  - [ ] Confirm code examples are syntactically correct

---------

Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2026-01-17 17:44:58 +00:00
Jeffrey Dallatezza dc51635622 Build all of the typescript templates in CI (#3980)
This also has a few minor changes to fix build errors for the
`test-app`.

# Description of Changes

Updates the typescript-test CI job to build some packages that weren't
being built before.

This also updates the root-level `pnpm generate/format/lint/build`
commands to also apply to templates.

# Expected complexity level and risk

1

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-01-14 20:21:50 +00:00
Zeke Foppa 5508f620e2 CI - Fix /update-llm-benchmark getting cancelled (#4027)
# Description of Changes

Augmented the concurrency group to not have unrelated comments cancel
the `/update-llm-benchmark` command.

# API and ABI breaking changes

CI only

# Expected complexity level and risk

1

# Testing

I think this can only be tested once merged? Comments on this PR still
seem to use the old workflow.

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-01-14 03:03:20 +00:00
Zeke Foppa 29407cc42b CI - "Fix" v8 error in TypeScript CI (#4022)
# Description of Changes

See https://github.com/clockworklabs/SpacetimeDB/pull/3921 for a
previous version of this PR. Just expanding that hacky fix.

# API and ABI breaking changes

CI-only change.

# Expected complexity level and risk

1

# Testing

- [x] Build fixed in
https://github.com/clockworklabs/SpacetimeDB/pull/3980

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-01-13 20:17:02 +00:00
Zeke Foppa 92c5136629 CI - LLM benchmark update uses clockwork-labs-bot (#4004)
# Description of Changes

Fix https://github.com/clockworklabs/SpacetimeDB/pull/3998

# API and ABI breaking changes

CI only

# Expected complexity level and risk

1

# Testing

We'll do it live!

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-01-12 21:32:21 +00:00
Zeke Foppa 7794bba89c CI - LLM benchmark update uses clockworklabs-bot (#3998)
# Description of Changes

Make the GH username for this job correspond to an actual GH user, so we
can have it sign our CLA.

# API and ABI breaking changes

CI only

# Expected complexity level and risk

1

# Testing

I think we could test this by having clockworklabs-bot create an
external PR, if we think that's worth it. Alternatively we could merge
and test in prod.

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2026-01-12 15:51:29 +00:00
Piotr Sarnacki 3c8836b1a3 Templates rework (#3879)
# Description of Changes

We would like to move all of the templates to a central directory

# API and ABI breaking changes

None

# Expected complexity level and risk

2

# Testing

---------

Co-authored-by: spacetimedb-bot <spacetimedb-bot@users.noreply.github.com>
2026-01-09 15:09:26 +00:00
bradleyshep b75bf6decf LLM Benchmarking (#3486)
# Description of Changes

Introduce a new **LLM benchmarking app** and supporting code.

* **CLI:** `llm` with subcommands `run`, `routes list`, `diff`,
`ci-check`.
* **Runner:** executes globally numbered tasks; filters by `--lang`,
`--categories`, `--tasks`, `--providers`, `--models`.
* **Providers/clients:** route layer (`provider:model`) with HTTP LLM
Vendor clients; env-driven keys/base URLs.
* **Evaluation:** deterministic scorers (hash/equality, JSON
shape/count, light schema/reducer parity) with clear failure messages.
* **Results:** stable JSON schema; single-file HTML viewer to
inspect/filter/export CSV.
* **Build & guards:** build script for compile-time setup;
* **Docs:** `DEVELOP.md` includes `cargo llm …` usage.

This PR is the initial addition of the app and its modules (runner,
config, routes, prompt/segmentation, scorers, schema/types,
defaults/constants/paths/hashing/combine, publishers, spacetime guard,
HTML stats viewer).

### How it works
1. **Pick what to run**

* Choose tasks (`--tasks 0,7,12`), or a language (`--lang rust|csharp`),
or categories (`--categories basics,schema`).
   * Optionally limit vendors/models (`--providers …`, `--models …`).

2. **Resolve routes**

* Read env (API keys + base URLs) and build the active set (e.g.,
`openai:gpt-5`).

3. **Build context**

   * Start Spacetime
   * Publish golden answer modules
   * Prepare prompts and send to LLM model
   * Attempt to publish LLM module

4. **Execute calls**

* Run the selected tasks within each test against selected models and
languages.

5. **Score outputs**

* Apply deterministic scorers (hash/equality, JSON shape/count, simple
schema/reducer checks).
   * Record the score and any short failure reason.

6. **Update results file**

* Write/update the single results JSON with task/route outcomes,
timings, and summaries.


# API and ABI breaking changes

None. New application and modules; no existing public APIs/ABIs altered.

# Expected complexity level and risk

**4/5.** New CLI, routing, evaluation, and artifact format.

* External model APIs may rate-limit/timeout; concurrency tunable via
`LLM_BENCH_CONCURRENCY` / `LLM_BENCH_ROUTE_CONCURRENCY`.

# Testing

I ran the full test matrix and generated results for every task against
every vendor, model, and language (rust + C#). I also tested the CI
check locally using [act](https://github.com/nektos/act).

**Please verify**

* [ ] `llm run --tasks 0,1,2` (explicit `run`)
* [ ] `llm run --lang rust --categories basics` (filters)
* [ ] `llm run --categories basics,schema` (multiple categories)
* [ ] `llm run --lang csharp` (language switch)
* [ ] `llm run --providers openai,anthropic --models "openai:gpt-5
anthropic:claude-sonnet-4-5"` (provider/model limits)
* [ ] `llm run --hash-only` (dry integrity)
* [ ] `llm run --goldens-only` (test goldens only)
* [ ] `llm run --force` (skip hash check)
* [ ] `llm ci-check`
* [ ] Stats viewer loads the JSON; filtering and CSV export work
* [ ] CI works as intended

---------

Signed-off-by: bradleyshep <148254416+bradleyshep@users.noreply.github.com>
Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Co-authored-by: spacetimedb-bot <spacetimedb-bot@users.noreply.github.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2026-01-06 22:22:57 +00:00
Zeke Foppa 264e45eafc CI - Hackily fix V8 linker errors (#3921)
# Description of Changes

Introduce a hacky workaround to our `csharp-testsuite` to address
missing `librusty_v8.a`: manually check for that file and manually build
the package if it's missing.

# API and ABI breaking changes

CI-only change

# Expected complexity level and risk

1

# Testing

- [x] Locally tested removing the `librusty_v8.a` and then running
`cargo clean -p v8 && cargo build -p v8`, and this does seem to repair
it.
- [x] The CI has run with a cache that is "broken", but successfully
passes `csharp-testsuite`

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-12-19 21:22:18 +00:00
Zeke Foppa c38b135038 CI - No cache-on-failure (#3903)
# Description of Changes

Disable `cache-on-failure` as we think that it's contributing to
mysterious `rusty_v8` linker issues.

I bumped the prefix key so that PRs with this change don't share caches
with PRs missing this change.

# API and ABI breaking changes

CI only.

# Expected complexity level and risk

1

# Testing

None. We'll have to see if we stop having issues once this is merged.

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-12-18 18:20:02 +00:00
Zeke Foppa 70628fb51e cargo ci on windows (#3859)
# Description of Changes

Make `cargo ci` work properly on Windows, in preparation for
https://github.com/clockworklabs/SpacetimeDB/pull/3702.

# API and ABI breaking changes

No. CI-only.

# Expected complexity level and risk

2. Not trivial, but not complicated.

# Testing

- [x] CI output seems to be genuinely running the tests, and it's
passing on Windows
- [x] Make a change to `crates/bindings-csharp` and see that `cargo ci
test` fails
- [x] I can manually run a minimal `cargo ci smoketests` invocation on a
Windows machine

---------

Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Kasama <robertoaall@gmail.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-12-17 17:34:49 +00:00
Zeke Foppa 8967ea7b59 CI - Use rust-toolchain-file everywhere (#3872)
# Description of Changes

We were using `rust-toolchain` in some places, and `rust-toolchain-file`
in others. I think Rust released a new version, which made the
`rust-toolchain` parts break with:

```
info: downloading component 'rustfmt'
info: removing previous version of component 'rust-src'
info: rolling back changes
error: could not rename component file from '/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/test/src/term/terminfo/searcher' to '/root/.rustup/tmp/a4eo07uz83vsyfhk_dir/bk': Invalid cross-device link (os error 18)
Error: Process completed with exit code 1.
```

(Separately, this breakage is confusing.. we'll probably run into this
again when we roll forward our rust version..)

# API and ABI breaking changes

None. CI-only change.

# Expected complexity level and risk

1

# Testing

- [x] CI passes
- [x] There are no more instances of `rust-toolchain`:
```
$ grep -rIP 'rust-toolchain(?!-file)' .github/workflows
.github/CODEOWNERS:/rust-toolchain.toml @cloutiertyler
```
(on `master`, this finds the instances we changed)

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-12-11 18:51:48 +00:00
Roberto Pommella Alegro 5ac65739e5 add initial cargo ci (#3409)
# Description of Changes

This changes the ci runs to execute `cargo ci` instead of running
commands directly from the github workflow.

The goal here is to unify the commands under `cargo ci` so that it's
easier and more intuitive to run locally

# API and ABI breaking changes

There are no API/ABI changes.

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

Complexity: 1

It is not a complex change as it is mostly localized to the ci runs and
is easily reversible if something goes wrong. The biggest risk here is
to have future CI runs break, which can be remediated by reverting these
changes.

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] run `cargo ci` and its subcommands locally
- [x] run the github workflow against this branch to check if the CI
jobs are working properly.

---------

Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Signed-off-by: Roberto Pommella Alegro <robertoaall@gmail.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-12-10 19:18:43 +00:00
Zeke Foppa 64aa808957 CI - Skip the Unity testsuite on external PRs (#3805)
# Description of Changes

Bubbling up an `if` since we split out the unity testsuite into its own
job.

The GitHub docs say
(https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks):
> A job that is skipped will report its status as "Success". It will not
prevent a pull request from merging, even if it is a required check.

# API and ABI breaking changes

None. CI-only change.

# Expected complexity level and risk

1

# Testing

Unsure how to test this honestly 🤷

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-12-02 21:09:52 +00:00
John Detter 1d3421745c Split Unity and C# tests into separate jobs (#3779)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

This has 2 benefits:
1. If the Unity test fails because of a license issue then we don't have
to re-run the C# tests again as part of this flow. Re-running the Unity
tests will be much faster if that's the only thing the job is doing.
2. These tests will run faster because they will now run in parallel as
separate CI jobs.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None

# Expected complexity level and risk

1

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] Both tests pass

---------

Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-26 21:33:35 +00:00
John Detter 9c6e5a5cbe Set timeout for smoketests (#3772)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

Sets a 2 hour timeout for the smoketests. If the smoketests are taking
more than 2 hours they likely will never finish and we should just time
them out.

# API and ABI breaking changes

None

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

1

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x]
https://github.com/clockworklabs/SpacetimeDB/actions/runs/19697510980/job/56425630374?pr=3772
2025-11-26 19:08:49 +00:00
John Detter 66606d29bc Move docs tests to custom runner (#3699)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

Just moving more jobs to the custom runner.

|Test|Before|After|% Change|
|---|---|---|---|
|Docs - Build + Test|2m|1m|No change|
|Docs - Publish|2m|<2m|No change|

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None

# Expected complexity level and risk

1 - This is very low risk

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

I ran a publish test and it worked just fine:
<https://github.com/clockworklabs/SpacetimeDB/actions/runs/19515454265/job/55865908554>

- [x] CI still passes

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-25 22:06:32 +00:00
Zeke Foppa 462cac9af7 CI - Migrate off of spacetimedb-runner (#3763)
# Description of Changes

Move anything running on `spacetimedb-runner` to
`spacetimedb-new-runner`

# API and ABI breaking changes

None.

# Expected complexity level and risk

1

# Testing

- [x] CI passes

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-25 20:16:23 +00:00
Zeke Foppa 8552048aca CI - Clearer CTA in discord post (#3738)
# Description of Changes

Our automated discord posts have a more explicit call to action for the
PR author.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

Did a test post and it looks fine

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-24 20:48:55 +00:00
Zeke Foppa f071c213d3 CI - CLI doc check shouldn't fail on Cargo.lock diff (#3739)
# Description of Changes

Stop the CLI doc check from failing on `Cargo.lock` diffs, which it was
doing before.

# API and ABI breaking changes

CI only.

# Expected complexity level and risk

1

# Testing

- [x] CI still fails elsewhere if `Cargo.lock` needs updating

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-24 20:11:37 +00:00
John Detter 71ff927711 Attach artifacts workflow (#3724)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

This adds a github actions workflow for attaching artifacts to a
release. After this PR merges it can manually be invoked in the github
actions page.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

None

# Expected complexity level and risk

1 - This can't really break anything other than the release artifacts

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

It worked when I tested it just now. Look at the release here:
https://github.com/clockworklabs/SpacetimeDB/releases
Plus you can check the job output here:
https://github.com/clockworklabs/SpacetimeDB/actions/runs/19578784486/job/56071106846?pr=3724

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-22 03:36:01 +00:00
John Detter dc881f2bc9 Use custom runner for building CLI (#3716)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

- This has 2 benefits:
1. `ubuntu-latest` recently changed to 24.04 instead of 22.04 so that
broke the last CLI on some systems. This will fix that issue.
2. Performance - this should build much much faster.

# API and ABI breaking changes

None

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

2 - if the CLI fails to build this might be why.

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

- [x] Tested via today's release:
https://github.com/clockworklabs/SpacetimeDB/actions/runs/19550648024/job/55980960439
2025-11-20 21:30:43 +00:00
Zeke Foppa 2902441898 CI - No discord ping for skipped checks (#3718)
# Description of Changes

I thought this was covered by the `NEUTRAL` case, but apparently
`SKIPPED` is separate.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

We'll see when it merges 🤷

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-20 21:11:45 +00:00
Zeke Foppa c829c9d73d Disable Unreal tests (#3711)
# Description of Changes

These tests have been flaky, so we're disabling them until they're
working more consistently.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Tests are indeed skipped? 🤷

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-20 19:25:45 +00:00
Zeke Foppa ca2fd8b709 Add smoketests/requirements.txt (#3701)
# Description of Changes

We have added one too many python dependencies. I'm putting them in a
shared file, which will also ease installation for devs running them
locally.

# API and ABI breaking changes

None. CI only.

# Expected complexity level and risk

1

# Testing

Existing CI still passes

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-19 22:35:44 +00:00
John Detter aff07a0c2b Move typescript tests to new runner (#3696)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

- This just moves the typescript tests onto the custom runner.

|Test|Before|After|% Change|
|---|---|---|---|
|Typescript - Lint|1m|<1m|No change|
|Typescript - Build + Test|14m|5m|64%|

# API and ABI breaking changes

None

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk

1 - if the typescript tests become flaky this could be the reason.

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

- [x] The typescript CI still passes and is faster.

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-19 22:17:24 +00:00
Zeke Foppa 3395b1e905 CI - Cache more of our build outputs (#3521)
# Description of Changes

Changes with cache hit:
CI / Smoketests (spacetimedb-runner): 17m -> 10m
CI / Smoketests (windows-latest): 39m -> 31m
CI / Lints: 3m30s -> 2m
unity-testsuite: 23m -> 19m

This included creating a stripped-down `Dockerfile` that only runs
SpacetimeDB (as opposed to e.g. building tracy, flamegraphs, etc.). That
shaves off about 4-5m on the linux smoketests job.

# API and ABI breaking changes

No. CI only.

# Expected complexity level and risk

2

# Testing

Ran existing CI and noted the change in times in the description above

---------

Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2025-11-19 20:18:26 +00:00
Zeke Foppa cb5eb21eae CI - Fix empty lookup (#3693)
# Description of Changes

When the author isn't in the lookup table, we were getting `null`
instead of the empty string. This fixes that.

# API and ABI breaking changes

None. CI only.

# Expected complexity level and risk

1

# Testing

None

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-19 00:02:57 +00:00
Zeke Foppa 9d57c4d4ea CI - Ping PR author directly if checks fail (#3671)
# Description of Changes

When a merged PR fails checks, ping the PR author as well.

# API and ABI breaking changes

None. CI only.

# Expected complexity level and risk

2

# Testing

Demo message (not on an actual PR merge):
<img width="508" height="202" alt="image"
src="https://github.com/user-attachments/assets/69c16cf8-cad3-4744-8054-ea2b2d74cee0"
/>

---------

Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-17 22:39:17 +00:00
Zeke Foppa ee69be7073 CI - Cancel internal tests if cancelled (#3674)
# Description of Changes

`Internal Tests` invoke another workflow. If the calling workflow is
cancelled, now we also cancel the invoked workflow.

# API and ABI breaking changes

None.

# Expected complexity level and risk

2

# Testing

- [x] Push multiple commits to this PR, see that the invoked job is
cancelled
- [x] Manually cancel the `Internal Tests` job, see that the invoked job
is cancelled

---------

Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-17 22:14:33 +00:00
John Detter 05ecc80326 Use new runner for testsuite (#3656)
# Description of Changes

<!-- Please describe your change, mention any related tickets, and so on
here. -->

Speed improvements:

|CI Job|Before|After|Change|
|---|---|---|---|
|CI/Unreal Engine|29m|19m|34% faster|
|CI/Testsuite|21m|11m|47% faster|
|C#/Unity|20m|16m|20% faster|
|CI/Build and test wasm bindings|10m|3m|70% faster|
|CI/Smoketests (linux)|17m|12m|29% faster|

CI/Unreal Engine - switch to serial test execution
CI/Testsuite - partially switch to serial test execution

I also haven't seen an unexpected `Operation cancelled`, so I think that
problem might be behind us.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

No user facing changes

# Expected complexity level and risk

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

2 - this touches a lot of our CI. It has been solid so far but if we
start getting random CI failures this could be the cause.

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] All CI passes

(ok as of this update the internal tests are failing but that isn't
related to this PR 😅 )

# Future Work

There are 2 remaining tests that could be optimized by moving them to
faster runners:
1. (~45m) The windows smoketests (difficult because it requires
Windows). @bfops has brought up the idea of only running this test on
PRs that are in the merge queue and I think that would be the best 80/20
here. There really is not a great reason to be running this on every
commit anyway.
2. (36m) The internal tests (easier because it's on Linux)

I would also consider moving from instantiating container images to
instantiating VM snapshots. This would allow us a lot more flexibility
and we wouldn't have to have as much container config in our workflow
files. Based on guides I've seen online this is also somewhat common.
Also managing docker within docker has been kind of a nightmare so it
would be easier to run containers inside of VMs to remove a layer of
containerization there.

## Testsuite inconsistencies

We have at least 2 different jobs that are inconsistent/flaky: the
"testsuite" and the "unreal engine tests".

I'd like @JasonAtClockwork to make the unreal engine tests run
sequentially so that we have less random failures. I know this will
increase the testing time but due to this PR we should have extra
headroom there.

I've also pinged Joshua about one of the tests that I've seen sometimes
fails randomly. This is either an issue in the test or an issue in
SpacetimeDB itself, I'm not sure yet.

These inconsistencies are present both in our custom runner and in the
Github runners, so merging this PR will not make this situation any
worse than it already is.
2025-11-17 20:24:09 +00:00
Zeke Foppa 8787fbea00 CI - Fix "Check that packages are publishable" check (#3660)
# Description of Changes

Our `Check that packages are publishable` CI check was silently failing
due to a subshell error not getting propagated upward.

This PR both fixes that error-swallowing behavior, and fixes the errors
that were present.

# API and ABI breaking changes

No. CI only.

# Expected complexity level and risk

1

# Testing

- [x] Check fails if the script to find crates fails
(https://github.com/clockworklabs/SpacetimeDB/actions/runs/19349995837/job/55359458732?pr=3660)
- [x] Check is now passing

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-14 01:14:56 +00:00
Zeke Foppa a5602a3845 Fix noisy Discord notifications on PR merge (#3650)
# Description of Changes

Filter out the discord notification job itself, as well as any neutral
results.

# API and ABI breaking changes

CI only.

# Expected complexity level and risk

1

# Testing

Unsure how to test this without merging the PR

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-12 21:18:08 +00:00
Zeke Foppa 6e0a752ceb PR merge discord post includes all non-successful checks (#3594)
# Description of Changes

Now, the "PR merged" discord post will include all non-successful CI.

# API and ABI breaking changes

CI-only.

# Expected complexity level and risk

2

# Testing

Note: I tested this by commenting out / hardcoding some pieces, rather
than by actually merging PRs in some other repo.

Some test posts it generated:
<img width="528" height="266" alt="image"
src="https://github.com/user-attachments/assets/27151c5f-216a-47aa-9f3b-74d991bcbbe7"
/>
<img width="493" height="146" alt="image"
src="https://github.com/user-attachments/assets/677de1d5-8268-400c-be16-b3806382bb51"
/>

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-12 18:35:36 +00:00
Zeke Foppa 703fae2ed6 Switch Internal Tests to reuse CI job (#3625)
# Description of Changes

Switch the `Internal Tests` job to re-use the existing CI workflow
instead of a separate one.

# API and ABI breaking changes

None. CI only.

# Expected complexity level and risk

1

# Testing

- [x] Internal Tests passes on this PR

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-12 18:21:08 +00:00
Kim Altintop a36f7091d5 [teams 3/5] API authorization, CLI, smoketests (#3523)
This adds authorization to the relevant API endpoints, updates the CLI
commands and adds smoketests for the teams feature.

**Note**: Authorizing SQL (incl. subscriptions) is a bit more involved,
and submitted as a separate PR in the series.

Depends-on: https://github.com/clockworklabs/SpacetimeDB/pull/3519
2025-11-11 14:10:58 +00:00
Zeke Foppa 6bf3efc006 CI - Fix format strings (#3627)
# Description of Changes

I allowed chatgpt to mislead me about how to do these format strings.
Apparently this is the wrong syntax. I've now verified the correct
syntax:
https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#format

# API and ABI breaking changes

CI only.

# Expected complexity level and risk

1

# Testing

I honestly don't know how to check what concurrency group something is
running in..

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-11 00:12:53 +00:00
Kim Altintop cfd0d4b712 commitlog,durability: Support preallocation of disk space (#3437)
When a new commitlog segment is created, allocate disk space for it up
to the maximum segment size. Also do this when resuming writes to an
existing segment, such that segments created without preallocation will
allocate as well when the database is opened.

Preallocation is gated behind the feature "fallocate", because it is not
always desirable to preallocate, e.g. for local `standalone` users.

The feature can only be enabled on Linux targets, because allocation is
done using the Linux-specific `fallocate(2)` system call.

Unlike `ftruncate(2)` or the portable `posix_fallocate(3)`,
`fallocate(2)`
supports allocating disk space without zeroing. This is currently
required, because the commitlog format does not handle padding bytes.

If not enough space can be allocated, the commitlog refuses writes. For
commitlogs that were created without preallocation, this means that the
commitlog cannot even be opened in this situation.

The local durability impl will crash if it detects that the commitlog is
unable to allocate enough space.

This means that a database will eventually crash and be unable to start
in
an out-of-space situation.

Allocated space is not included in the reported size of the commitlog.
Instead, allocated blocks are reported separately.


# Expected complexity level and risk

3 - Disk size monitoring may need to be adjusted.

# Testing

- [x] Adds a test that demonstrates the crash behavior of
[`spacetimedb_durability::Local`]
when there is insufficient space. The test performs I/O against a loop
device.
- [x] Modified the `repo::Memory` impl so that it can run out of space.
No test currently
utilizes this, but existing tests assuming infinite space still pass.
2025-11-10 16:55:55 +00:00
Zeke Foppa 09bca44c56 CI - Make Internal Tests less brittle (#3536)
# Description of Changes

For some reason, the Internal Tests have trouble fetching the commit
sha, especially when the job is re-run. This PR switches it to using ref
names rather than commit sha, because the ref names are much more
durable than GitHub's ephemeral commits that it generates during
workflows.

# API and ABI breaking changes

None. CI only.

# Expected complexity level and risk

1

# Testing

- [x] CI still passes
- [x] Ref still gets checked out successfully on re-run.

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-07 22:44:52 +00:00
Zeke Foppa 7c4c3ddeea CI - Fix the merge queue (#3571)
# Description of Changes

The merge queue was (partly) getting borked because we were putting all
non-PR CI events into the same concurrency group, which meant they all
non-PR CI jobs would run sequentially instead of running in parallel.
This sometimes caused _painfully_ long delays in the merge queue.

This was due to my misunderstanding in
https://github.com/clockworklabs/SpacetimeDB/pull/3501#discussion_r2466570395,
where I didn't realize that `cancel-in-progress: false` would cause
everything to queue up.

Now, for non-PR events, we append the commit SHA to the concurrency
group. For merge queue events, this should be the SHA of the ephemeral
merge commit that GH creates, so it will never conflict. For push events
or manual workflow dispatch events, the SHA should be a sane way to
recognize/cancel redundant events.

# API and ABI breaking changes

None. CI-only change.

# Expected complexity level and risk

1

# Testing

- [x] PR CI passes on this PR
- [x] PR CI is still canceled on this PR if a new commit is pushed

Unfortunately it's hard to test the behavior for non-PR events without
merging and seeing if it works.

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-05 20:25:00 +00:00
Zeke Foppa 5ff6a6976c CI - Move the Package job to ubuntu-latest (#3553)
# Description of Changes

The job is now failing on `bare-metal`, so trying this.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Package job passes on
https://github.com/clockworklabs/SpacetimeDB/pull/3543 with this merged
in.

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-10-31 19:50:06 +00:00
Noa 3cc59de66c Add typescript quickstart smoketest (#3463)
# Description of Changes

Based on #3461, which fixes a bug encountered in the quickstart.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->
n/a

# Expected complexity level and risk

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->
1

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] Yes
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->
2025-10-31 16:30:11 +00:00
Zeke Foppa 2516357c8d CI - Skip Internal Tests and Unreal Tests on external PRs (#3522)
# Description of Changes

These tests fail on external PRs, but not for any real reasons - just
because GH secrets are missing. "Skipped" is more informative than
"failed".

# API and ABI breaking changes

None.

# Expected complexity level and risk

1

# Testing

None, but I just copied the logic from the unity testsuite.

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-10-28 19:28:12 +00:00
Zeke Foppa 9ad5e7038a CI - Cancel runs on new pushes (#3501)
# Description of Changes

Add `cancel-in-progress` to our GitHub workflows.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Pushing new commits to this PR causes cancels of previous CI runs

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-10-27 19:15:21 +00:00
Julien Lavocat afb8c08b98 Docusaurus migration (#3343)
## Description of Changes

- Migrate the documentation site to **Docusaurus**.
- Add a **GitHub Action workflow** that runs `pnpm build` on pull
requests targeting `master`.
This command checks for broken links and images and ensures the site
builds correctly.
- Add a **GitHub Action workflow** to publish the docs automatically
when a merge occurs on the `docs/release` branch.

**Important**: The workflows haven't been tested yet due to the fact
that they need to be merged first before being able to run. It's a
fairly basic workflow I don't expect this to block anyone but anyways I
will make another PR with the complete changes when I can actually run
it.

---

## API and ABI Breaking Changes

No breaking changes for **SpacetimeDB** users.  
Documentation contributors should experience minimal disruption —
content is still written in Markdown.

---

## Expected Complexity Level and Risk

**Complexity:** 3/5

**Reasons:**
1. Several adjustments were made to fit Docusaurus conventions:
- Replaced our custom `:::server-rust` blocks with [Docusaurus `<Tabs/>`
components](https://docusaurus.io/docs/markdown-features/tabs).
- Converted “Note” callouts using
[admonitions](https://docusaurus.io/docs/markdown-features/admonitions)
instead of Markdown blockquotes.
- Updated all images (including Unity tutorial ones, which were
previously commented out).
- Moved images from the DO bucket into the repository at
`docs/static/images`.

2. Customized Docusaurus CSS and one component to apply our theme and
color palette.

---

## Testing

Tested locally.

---

## Review Notes

This PR involves many file changes — a full code review is likely not
productive.
Instead, please focus on verifying that the **documentation content**
was migrated correctly:

- Review sections you’re familiar with to confirm accuracy.
- Ensure formatting, links, and images render as expected.

You can follow the updated **README** for instructions on running
Docusaurus locally.

---------

Signed-off-by: Julien Lavocat <JulienLavocat@users.noreply.github.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Co-authored-by: = <cloutiertyler@gmail.com>
2025-10-24 14:36:38 +00:00
Zeke Foppa f726b02c74 CI - C# quickstart test properly uses nuget (#3466)
# Description of Changes

The quickstart smoketest was not correctly fudging our NuGet
dependencies to use the local versions of the packages, so it was
pulling them from NuGet. This ended up causing issues when we tried to
modify local packages and then use them in a way that affected the
quickstart (e.g.
https://github.com/clockworklabs/SpacetimeDB/pull/3386).

We had a few issues: we weren't ensuring that the local packages were
built, we weren't using the right directory for those packages, and we
weren't adding a "package source mapping" that forced those packages to
be used from the local directory.

# API and ABI breaking changes

None. CI-only.

# Expected complexity level and risk

2

# Testing

- [x] CI passes when
https://github.com/clockworklabs/SpacetimeDB/pull/3386 is merged
together with this PR (it wasn't before).

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-10-23 19:50:18 +00:00
Zeke Foppa 0f0cb47d03 CI - Move Internal Tests to GitHub (#3436)
# Description of Changes

Move a version of the Jenkins logic into a GitHub workflow. See the
linked issue for more context.

# API and ABI breaking changes

None. CI only.

# Expected complexity level and risk

2

# Testing

- [x] Tests currently passing on this PR
- [x] Tests fail with appropriate error if made to fail, e.g. version
bump
(https://github.com/clockworklabs/SpacetimeDB/actions/runs/18666569784/job/53219039721)
- [x] If the timeout is sharply reduced, we get an appropriate timeout
message
(https://github.com/clockworklabs/SpacetimeDB/actions/runs/18693760959/job/53305759272?pr=3436)

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-10-21 19:33:17 +00:00
Zeke Foppa dac57e4a58 CI - Remove previews on discord posts for merged PRs (#3445)
# Description of Changes

The previews only work for public repos, meaning that the posts end up
looking inconsistent. I don't believe the previews add much information
anyway. _If_ there's information in there that we want, we should add it
to the post itself.

# API and ABI breaking changes

No.

# Expected complexity level and risk

1

# Testing

None. We'll see when it merges!

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-10-21 18:20:47 +00:00
Noa bb43213245 Typescript module API (#3327)
# Description of Changes

Currently based on #3361 

Implements most of the TS module API (not yet a function for type
aliases).

# Expected complexity level and risk

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] Extremely basic module stuff works
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->

---------

Signed-off-by: Noa <coolreader18@gmail.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
Co-authored-by: = <cloutiertyler@gmail.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-10-16 14:58:50 +00:00
Zeke Foppa 92cd2604ad Windows - Set linker = "lld-link" (#3406)
# Description of Changes

See the inline comments for the motivation. This was originally
introduced to our Windows CI in #3351. This PR moves it from CI to
general Windows target builds, since it seems like Windows builds are
now generally having this issue.

# API and ABI breaking changes

None

# Expected complexity level and risk

1

# Testing

- [x] Windows CI still passes

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-10-15 03:09:55 +00:00