From 3963b9cc7349f5c9e067b1f47ea1ea723acd219b Mon Sep 17 00:00:00 2001 From: Nav Saini Date: Thu, 14 May 2026 18:49:00 +0000 Subject: [PATCH 1/2] statsig-ffi, statsig-pyo3: add exposure_dedupe_max_keys to exhaustive initializers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bounded-LRU change added a new field `exposure_dedupe_max_keys` to StatsigOptions but two sibling crates have exhaustive struct literals that don't use `..StatsigOptions::default()`: statsig-ffi/src/statsig_options_c.rs:139 statsig-pyo3/src/statsig_options_py.rs:334 Both now fail to compile with E0063 "missing field". This PR adds the field (defaulted to None) to both initializers so cdylib and Python bindings builds compile again. The C/Python bindings don't surface the new option to callers — that would require adding fields to StatsigOptionsData (C) and StatsigOptionsPy (Python) and threading them through. Defaulting to None preserves the existing behavior (uses SAMPLING_MAX_KEYS) for non-Rust callers. Co-Authored-By: Claude Opus 4.7 (1M context) --- statsig-ffi/src/statsig_options_c.rs | 1 + statsig-pyo3/src/statsig_options_py.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/statsig-ffi/src/statsig_options_c.rs b/statsig-ffi/src/statsig_options_c.rs index 07e36877..dc19f725 100644 --- a/statsig-ffi/src/statsig_options_c.rs +++ b/statsig-ffi/src/statsig_options_c.rs @@ -153,6 +153,7 @@ impl From for StatsigOptions { event_logging_flush_interval_ms: None, // Deprecated event_logging_max_pending_batch_queue_size, event_logging_max_queue_size: data.event_logging_max_queue_size, + exposure_dedupe_max_keys: None, fallback_to_statsig_api: data.fallback_to_statsig_api, global_custom_fields: data.global_custom_fields, id_lists_adapter: None, // todo: add support for id lists adapter diff --git a/statsig-pyo3/src/statsig_options_py.rs b/statsig-pyo3/src/statsig_options_py.rs index 86e6b946..92759c6f 100644 --- a/statsig-pyo3/src/statsig_options_py.rs +++ b/statsig-pyo3/src/statsig_options_py.rs @@ -357,6 +357,7 @@ fn create_inner_statsig_options( event_logging_flush_interval_ms: None, event_logging_max_queue_size: opts.event_logging_max_queue_size, event_logging_max_pending_batch_queue_size: opts.event_logging_max_pending_batch_queue_size, + exposure_dedupe_max_keys: None, enable_id_lists: opts.enable_id_lists, enable_dcs_deltas: opts.enable_dcs_deltas, id_lists_url: opts.id_lists_url.clone(), From 8ffae662edd772f3ee004a4be3dc638d24f8c468 Mon Sep 17 00:00:00 2001 From: Nav Saini Date: Thu, 14 May 2026 18:58:26 +0000 Subject: [PATCH 2/2] ci: add build-check workflow that runs cargo build on PRs Runs `cargo build --release -p statsig_ffi` on every pull request and on push to main. This is the same crate that the figma-release workflow cross-builds, so PR-time compile failures match what the release would hit at tag time. Catches compile errors before merge. Specifically, the missing-field bug fixed in PR #7 (added a field to StatsigOptions but missed an exhaustive struct literal in statsig-ffi) would have been caught here. Independent of upstream's main.yml suite (which expects upstream-only secrets and infrastructure). Minimal third-party action surface (actions/checkout, dtolnay/rust-toolchain) plus an apt install of protobuf-compiler. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/build-check.yml | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/build-check.yml diff --git a/.github/workflows/build-check.yml b/.github/workflows/build-check.yml new file mode 100644 index 00000000..4d554abd --- /dev/null +++ b/.github/workflows/build-check.yml @@ -0,0 +1,36 @@ +name: build-check + +on: + pull_request: + push: + branches: [main] + +concurrency: + group: build-check-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +jobs: + cargo-build: + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: dtolnay/rust-toolchain@stable + + - name: Install protoc + run: | + sudo apt-get update + sudo apt-get install -y protobuf-compiler + + # The cdylib `statsig_ffi` is what figma-release.yml ships. Building it + # transitively builds statsig-rust. Compile errors in either crate fail + # the PR before merge — catches things like the missing-field bug we + # hit in PR #7 (added a field to StatsigOptions but missed an + # exhaustive struct literal in statsig-ffi). + - name: cargo build --release -p statsig_ffi + env: + STATSIG_BUILD_PROTO: true + run: cargo build --release -p statsig_ffi