Skip to content

fix: harden SDK CI and preserve MCP wildcard fields#204

Merged
userFRM merged 3 commits into
mainfrom
fix/sdk-ci-and-mcp-hardening
Apr 9, 2026
Merged

fix: harden SDK CI and preserve MCP wildcard fields#204
userFRM merged 3 commits into
mainfrom
fix/sdk-ci-and-mcp-hardening

Conversation

@userFRM
Copy link
Copy Markdown
Owner

@userFRM userFRM commented Apr 9, 2026

Summary

  • harden GitHub Actions coverage for Rust tools and supported SDK surfaces
  • switch the Python SDK packaging flow to abi3 wheels with real PR-time wheel/sdist validation
  • preserve wildcard option contract identifiers in MCP bulk responses so multi-strike option queries are usable

Details

  • replace the deprecated Node-based arduino/setup-protoc action with a local composite protoc installer
  • upgrade core GitHub Actions versions and add concurrency, timeouts, and stricter release behavior
  • validate Python wheel builds on Linux/macOS/Windows during PRs and run source-distribution install smoke checks
  • fix Python package metadata drift by sourcing the version from Cargo and filling in missing Cargo package metadata
  • tighten Go and C++ SDK build configuration and docs to match the supported CI matrix
  • include expiration, strike, and human-readable right fields in MCP output for wildcard option tick rows while omitting them for single-contract rows

Validation

  • cargo fmt --all
  • cargo test -p thetadatadx --locked
  • cargo clippy -p thetadatadx --locked -- -D warnings
  • cargo test --manifest-path tools/mcp/Cargo.toml --locked
  • cargo clippy --manifest-path tools/mcp/Cargo.toml --locked -- -D warnings
  • cargo test --manifest-path tools/server/Cargo.toml --locked
  • cargo clippy --manifest-path tools/server/Cargo.toml --locked -- -D warnings
  • cargo test --manifest-path tools/cli/Cargo.toml --locked
  • cargo clippy --manifest-path tools/cli/Cargo.toml --locked -- -D warnings
  • cargo check --manifest-path sdks/python/Cargo.toml --locked
  • Python wheel build/install/import smoke via maturin
  • Python sdist build/install/import smoke via maturin
  • cargo build --release -p thetadatadx-ffi --locked
  • go test ./... in sdks/go
  • cmake -S sdks/cpp -B build/cpp && cmake --build build/cpp --config Release --target thetadatadx_cpp

Notes

  • Go on Windows is still not in the official CI matrix because the Rust-to-CGo import-library path there still needs a dedicated solution.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens CI coverage across the Rust core and SDK surfaces, updates the Python packaging flow to build/validate abi3 wheels and sdists during PRs, and adjusts MCP tick serialization to preserve wildcard option contract identifiers for bulk responses.

Changes:

  • MCP: emit expiration, strike, and human-readable right for wildcard/bulk option tick rows while omitting them for single-contract rows.
  • Python SDK/CI: switch to abi3 (py39+) packaging with PR-time wheel + sdist build/install/import smoke checks; align metadata by sourcing version dynamically and adding missing Cargo package metadata.
  • Go/C++/CI/docs: tighten platform-specific build/link settings and update CI workflows (protoc installation, timeouts, concurrency, stricter release behavior).

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tools/mcp/src/main.rs Adds helpers + tests to include wildcard option contract identifiers in serialized tick rows.
sdks/README.md Documents the SDK validation matrix and updates build commands (Python/C++).
sdks/python/README.md Documents abi3 wheels and pins the recommended maturin version range.
sdks/python/pyproject.toml Switches Python version to dynamic (maturin/Cargo-sourced) and pins maturin in build-system.
sdks/python/Cargo.toml Adds missing Cargo package metadata and switches PyO3 to abi3-py39.
sdks/go/thetadx.go Uses platform-specific CGO LDFLAGS for Linux/macOS/Windows.
sdks/go/README.md Clarifies Go SDK platform support and Windows artifact expectations.
sdks/cpp/README.md Updates CMake build instructions and example run path.
sdks/cpp/include/thetadx.h Makes 64-byte alignment portable across MSVC vs GCC/Clang.
sdks/cpp/CMakeLists.txt Uses an imported target for platform-correct FFI linking (incl. Windows import libs).
.github/workflows/python.yml Adds PR-time wheel/sdist validation across OSes + abi3 smoke checks on multiple Python versions.
.github/workflows/docs.yml Updates GitHub Actions versions for docs build/deploy.
.github/workflows/ci.yml Adds concurrency/timeouts, replaces setup-protoc with a composite action, expands SDK binding checks, and tightens publish behavior.
.github/actions/install-protoc/action.yml New composite action to install protoc on Linux/macOS/Windows runners.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/python.yml Outdated
- uses: Swatinem/rust-cache@v2
- uses: ./.github/actions/install-protoc
- shell: bash
run: python -m pip install --upgrade pip maturin
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

The workflow installs the latest maturin (pip install --upgrade ... maturin), but the repo pins maturin>=1.9.4,<2.0 in sdks/python/pyproject.toml. Installing an unbounded version makes CI non-reproducible and can break unexpectedly when maturin 2.x releases; consider installing with the same version range here (and in the other jobs in this workflow).

Suggested change
run: python -m pip install --upgrade pip maturin
run: python -m pip install --upgrade pip "maturin>=1.9.4,<2.0"

Copilot uses AI. Check for mistakes.
Comment on lines +88 to +92
- uses: ./.github/actions/install-protoc
- shell: bash
run: python -m pip install --upgrade pip maturin
- shell: bash
run: python -m maturin build --release -m sdks/python/Cargo.toml -o dist/ --interpreter python
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

Same issue as the build job: this installs unpinned maturin, which can drift from the maturin>=1.9.4,<2.0 constraint in sdks/python/pyproject.toml. Pin the installed maturin version range here to keep the ABI3 smoke checks reproducible.

Copilot uses AI. Check for mistakes.
Comment on lines +108 to +113
- uses: Swatinem/rust-cache@v2
- uses: ./.github/actions/install-protoc
- shell: bash
run: python -m pip install --upgrade pip maturin
- shell: bash
run: python -m maturin sdist -m sdks/python/Cargo.toml -o dist/
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

The sdist job installs the latest maturin, but sdks/python/pyproject.toml constrains maturin>=1.9.4,<2.0. Pinning the installed version range here helps avoid future CI breakages when new maturin majors are released.

Copilot uses AI. Check for mistakes.
Comment thread sdks/README.md Outdated
# From source (requires Rust toolchain)
# From source (requires Rust toolchain and maturin 1.9.4+)
cd sdks/python
pip install maturin
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

This section says building from source requires maturin 1.9.4+, but the command shown is pip install maturin (unbounded). To avoid users accidentally picking up an incompatible maturin major (e.g., 2.x), align the command with the pinned range used elsewhere (e.g., maturin>=1.9.4,<2.0).

Suggested change
pip install maturin
pip install "maturin>=1.9.4,<2.0"

Copilot uses AI. Check for mistakes.
shell: bash
run: |
set -euo pipefail
brew update
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

Running brew update during CI tends to add significant time and is a common source of transient failures on GitHub-hosted macOS runners. Consider removing brew update (or replacing it with a less disruptive approach) and just installing protobuf to make protoc setup faster and more reliable.

Suggested change
brew update

Copilot uses AI. Check for mistakes.
@userFRM userFRM merged commit 9eb26e9 into main Apr 9, 2026
20 checks passed
@userFRM userFRM deleted the fix/sdk-ci-and-mcp-hardening branch April 9, 2026 15:02
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