ci: add build-check workflow (cargo build on PRs)#8
Closed
nsaini-figma wants to merge 2 commits into
Closed
Conversation
… initializers 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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
.github/workflows/build-check.yml. On every pull request and push to main, runscargo build --release -p statsig_ffi(the same crate the release workflow cross-builds). PRs that break compilation are caught before merge.Why
PR #4 added a new field to
StatsigOptionsbut missed an exhaustive struct literal instatsig-ffi/src/statsig_options_c.rs. The fork has no PR-time compile gate, so the failure only surfaced when the release workflow tried to cross-build the cdylib after merge. PR #7 fixes the field. This PR adds the gate so the next time something similar slips through, it's caught at PR review instead of release time.What changed
.github/workflows/build-check.yml. One job. Steps: checkout with submodules, install Rust stable, apt-install protobuf-compiler,cargo build --release -p statsig_ffi.What is intentionally NOT in this workflow
cargo test). The fork doesn't have the API keys most integration tests need.crossand is faster (~1m20s locally).Test plan
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com