Skip to content

Ungate procedures from the unstable feature#5164

Open
cloutiertyler wants to merge 3 commits into
masterfrom
ungate-procedures
Open

Ungate procedures from the unstable feature#5164
cloutiertyler wants to merge 3 commits into
masterfrom
ungate-procedures

Conversation

@cloutiertyler
Copy link
Copy Markdown
Contributor

@cloutiertyler cloutiertyler commented Jun 1, 2026

Description of Changes

Graduate procedures (and the outgoing HTTP client used from procedures) out of the unstable feature gate / SPACETIMEDB_UNSTABLE_FEATURES across all module libraries. The procedure macro, ProcedureContext, with_tx/try_with_tx, scheduled procedures, and ctx.http are now available without opting into unstable.

Still gated (unchanged): HTTP handlers/webhooks, views, RLS / client_visibility_filter, and immediate-scheduling (volatile_nonatomic_schedule_immediate).

Per library:

  • bindings-sys: ungate the procedure host-call module + raw ABI imports (procedure_start/commit/abort_mut_tx, procedure_http_request) and call_no_ret. Scheduling ABI stays gated.
  • bindings (Rust): ungate the procedure macro, ProcedureContext, TxContext/with_tx/try_with_tx, db_read_only/get_read_only, the procedure traits, register_procedure, __call_procedure__, and procedure RNG. The http module (previously gated as a unit) now has fine-grained gating so the outgoing HttpClient is exposed while HandlerContext/Router/handler macros stay gated.
  • bindings-csharp: drop [Experimental("STDB_UNSTABLE")] from ProcedureContext.WithTx/TryWithTx (runtime + codegen) and the generated ProcedureTxContext; FFI snapshots regenerated. Handler context members + RLS attribute stay gated.
  • bindings-cpp: ungate the procedure ABI (abi.h/FFI.h), tx_execution.h, the outgoing HTTP client (http.h/http_convert.h), and procedure_context.h. handler_context.h/router.h/http_handler_macros.h still #error without SPACETIMEDB_UNSTABLE_FEATURES.
  • docs: remove the procedures beta notices (HTTP handlers stay marked beta for a later release); regenerate static/llms.md.
  • sdk-test-procedure: no longer needs features = ["unstable"].

API and ABI breaking changes

Not breaking. This is purely additive to the stable surface: procedures become available without the unstable feature, while modules that already opt into unstable are unaffected. The wasm host-ABI imports were already implemented host-side and merely gated module-side, so there is no ABI version change. (No breaking-change label needed.)

Expected complexity level and risk

3/5. The diff itself is mostly removing #[cfg]/#ifdef/[Experimental] guards, but the gate bundled procedures + outgoing HTTP + handlers + the ABI crate together, so the work was in separating procedures from the features that stay gated. Areas reviewers may want to scrutinize:

  • The Rust http module went from "gated as a whole" to fine-grained per-item gating; the outgoing HttpClient is exposed while handler types/macros stay behind unstable.
  • The unstable cut reaches the ABI crate (bindings-sys), which is the only way procedures can compile without the feature.
  • C++ separation of the outgoing HTTP client from HTTP handlers across several headers.

Testing

  • Rust: cargo check -p spacetimedb passes in default, --features unstable, and --no-default-features --features unstable.
  • Rust end-to-end: sdk-test-procedure (uses procedures, with_tx/try_with_tx, ctx.http.get, new_uuid_v7, scheduled procedures) builds without unstable.
  • C#: Codegen + Runtime build; Codegen.Tests pass (6/6) after FFI snapshot regen.
  • C++: host syntax-check confirms procedures + ctx.http.send() compile without the flag, full headers compile with it, and handler_context.h still #errors without it. (Not built for the real wasm/emscripten target locally — relying on CI.)
  • cargo ci lint components reproduced locally: rustfmt, clippy (-D warnings, default + unstable), csharpier, and cargo doc --deny warnings.
  • Reviewer: confirm the wasm bindings + C#/C++ test suites pass in CI (especially the C++ wasm build, which couldn't run locally).

Procedures (and the outgoing HTTP client used from procedures) are no
longer gated behind the `unstable` feature / `SPACETIMEDB_UNSTABLE_FEATURES`
across the module libraries. HTTP handlers/webhooks, views, RLS, and
immediate-scheduling remain gated.

- bindings-sys: ungate the `procedure` host-call module + raw ABI
  (start/commit/abort_mut_tx, procedure_http_request) and `call_no_ret`.
- bindings (Rust): ungate the `procedure` macro, ProcedureContext,
  TxContext/with_tx/try_with_tx, db_read_only/get_read_only, procedure
  traits, register_procedure, __call_procedure__, procedure RNG, and the
  outgoing HttpClient. Add fine-grained gating inside http.rs so the
  HttpClient is exposed while HandlerContext/Router/handler macros stay
  gated.
- bindings-csharp: drop [Experimental("STDB_UNSTABLE")] from
  ProcedureContext WithTx/TryWithTx (runtime + generated) and the
  generated ProcedureTxContext; regenerate FFI snapshots.
- bindings-cpp: ungate the procedure ABI, tx_execution, the outgoing
  HTTP client (http.h/http_convert.h), and procedure_context.h; handlers
  keep requiring SPACETIMEDB_UNSTABLE_FEATURES.
- docs: remove the procedures beta notices (HTTP handlers stay beta);
  regenerate static/llms.md.
- sdk-test-procedure: no longer needs features = ["unstable"].
@cloutiertyler cloutiertyler requested a review from gefjon June 1, 2026 23:48
- rustfmt: reorder the split `use` statements in http.rs/rng.rs/rt.rs.
- cargo doc: fix a pre-existing broken intra-doc link in HttpClient::send
  (`http::request::Builder::extension`), newly surfaced now that the
  outgoing HTTP client is documented in the default (non-unstable) build.
- clippy: gate the request_from_wire/response_into_wire test module behind
  `unstable`, since those functions are now gated.
The procedure module is now documented in the default (non-unstable)
`cargo doc` build, surfacing three unresolved [`Errno`] intra-doc links.
Qualify them as [`crate::Errno`] so they resolve from within the submodule.
Copy link
Copy Markdown
Contributor

@gefjon gefjon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to get someone else's eyes on the C# and C++ changes, but then again, we might not, 'cause these changes are pretty straightforward. From what I saw, those parts seemed reasonable. The Rust and docs changes are good. I'm ignoring llms.md, as it seems to be unrelated.

@cloutiertyler cloutiertyler enabled auto-merge June 2, 2026 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants