feat(sdk): gate experimental APIs behind feature by chris-olszewski · Pull Request #1395 · temporalio/sdk-rust · GitHub
Skip to content

feat(sdk): gate experimental APIs behind feature - #1395

Merged
chris-olszewski merged 4 commits into
mainfrom
olszewski/feat_experimental_feature2
Sep 1, 2026
Merged

chris-olszewski merged 4 commits into
mainfrom
olszewski/feat_experimental_feature2

Conversation

@chris-olszewski

@chris-olszewski chris-olszewski commented Jul 11, 2026 •

Copy link
Copy Markdown
Member

What was changed

  • Gate any API and required code marked as "experimental" behind a new experimental feature gate.
  • Build docs with new feature enabled so APIs are discoverable
  • Enable doc_cfg for docsrs so APIs that are gated behind a feature will get the little "feature" badge
  • For fields that are on Bon builders we need to a little song and dance around making the bon setters crate public, and then conditionally compiling public methods that call these setters.

Why?

Make it explicit at a language level what APIs are experimental compared to just a comment. Will allow us to do breaking changes on these APIs with a clear consciousness.

Checklist

  1. Closes N/A

  2. How was this tested:
    Existing test suite, ensured we still check that crates compile without feature enabled in CI

  3. Any docs updates needed?
    Worth a mention on the Rust docs site since this is a different approach than other SDKs.

Comment thread crates/client/src/options_structs.rs Outdated
@chris-olszewski
chris-olszewski marked this pull request as ready for review July 11, 2026 00:49
@chris-olszewski
chris-olszewski requested a review from a team as a code owner July 11, 2026 00:49
@Sushisource

Copy link
Copy Markdown
Member

@chris-olszewski
chris-olszewski force-pushed the olszewski/feat_experimental_feature2 branch from 06abe46 to 9b2d1fb Compare September 1, 2026 16:53
@chris-olszewski
chris-olszewski marked this pull request as draft September 1, 2026 16:56
@chris-olszewski
chris-olszewski force-pushed the olszewski/feat_experimental_feature2 branch from ed353c2 to 5547bd7 Compare September 1, 2026 19:10
@chris-olszewski
chris-olszewski marked this pull request as ready for review September 1, 2026 19:16
script: |
core.exportVariable('RUSTFLAGS', '-Csymbol-mangling-version=v0');
- run: cargo test -- --include-ignored --nocapture
- run: cargo test --features experimental -- --include-ignored --nocapture

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Eventually, I want to also run tests w/o experimental just to have extra coverage on that codepath, but want to get CI in a better space before adding another full run blindly. Will be more important if we ever have a behavior addition with experimental instead of just these additive changes.

Comment on lines +65 to +66
#[cfg_attr(not(feature = "experimental"), allow(unreachable_pub))]
mod worker_lifecycle {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be pub or re-exported?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Gets lost in the diff, but we publicly reexport members it if experimental is enabled. If disabled we just pub(crate) export the members.

Comment thread crates/sdk/src/lib.rs
Comment on lines +345 to +346

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh man this is annoying. Maybe we can make a PR there to be able to un-do this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll look into that

@chris-olszewski
chris-olszewski merged commit 37d747d into main Sep 1, 2026
23 checks passed
@chris-olszewski
chris-olszewski deleted the olszewski/feat_experimental_feature2 branch September 1, 2026 20:37
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