Skip to content

ci(release): publish Rust crates from release tags - #329

Merged
nachiketb-nvidia merged 3 commits into
mainfrom
nachiketb/ci-publish-rust-crates
Aug 7, 2026
Merged

ci(release): publish Rust crates from release tags#329
nachiketb-nvidia merged 3 commits into
mainfrom
nachiketb/ci-publish-rust-crates

Conversation

@nachiketb-nvidia

@nachiketb-nvidia nachiketb-nvidia commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What

Publish the five public Rust packages from the same stable release tag used for nemo-switchyard:

  • switchyard-protocol
  • switchyard-libsy
  • switchyard-translation
  • switchyard-llm-client
  • switchyard-server

Update the standalone server documentation to install the published binary with cargo install --locked switchyard-server.

Why

The Rust libraries and server are versioned with the Python package but are not currently released by CI. Publishing from one vMAJOR.MINOR.PATCH tag keeps the Python and Rust artifacts aligned and makes the standalone server directly installable from crates.io.

How

  • Validate that the tag, Python package version, and Rust workspace version match.
  • Wait for the complete Python/Rust release checks and distribution builds before uploading anything.
  • Publish crates in dependency order, waiting for each registry dependency to become visible before continuing.
  • Gate PyPI publication and GitHub Release creation on successful publication of switchyard-server.
  • Mark the new LLM client and server packages as crates.io publications and add the missing registry version to the server's libsy path dependency.

How tested

  • Parsed .github/workflows/publish.yml as YAML.
  • cargo metadata --locked --no-deps --format-version 1
  • cargo publish --dry-run --locked --package switchyard-protocol
  • uv run pytest tests/readme/test_readme.py tests/getting_started/test_getting_started.py -v
  • make publish from docs/ (strict MkDocs build).
  • Artifact-only release matrix: release checks, source distribution, and all six wheel targets passed. Publishing jobs remained disabled for the manual run.
  • git diff --check
  • Full publication from a stable release tag.

No crates or Python distributions were uploaded during validation.

What to review

  • Crate dependency ordering and crates.io index waits.
  • The shared version/tag gate.
  • The CARGO_REGISTRY_TOKEN boundary: it is exposed only to cargo publish steps.

Release setup

The repository already has a CARGO_REGISTRY_TOKEN Actions secret. Its crates.io token must be authorized to update switchyard-protocol and switchyard-translation and to create the three new crate names.

A release tag must point to a commit containing this workflow; tagging an older commit will execute the older workflow and will not publish these crates.

Summary by CodeRabbit

  • New Features

    • Added published Rust packages for the protocol, foundation libraries, LLM client, and server.
    • The server can now be installed and run directly with Cargo.
  • Documentation

    • Updated setup, CLI, and routing guides to use the installed switchyard-server command.
    • Documented Rust package release validation, publishing order, and recovery guidance.

Signed-off-by: nachiketb <nachiketb@nvidia.com>
@nachiketb-nvidia
nachiketb-nvidia requested a review from a team as a code owner August 7, 2026 17:20
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://NVIDIA-NeMo.github.io/Switchyard/pr-preview/pr-329/

Built to branch gh-pages at 2026-08-07 17:49 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The release workflow now validates matching Python and Rust versions, publishes five Rust crates in dependency order, and makes PyPI publication depend on the Rust server. Documentation now directs users to install and run the published switchyard-server binary.

Changes

Rust release and installation

Layer / File(s) Summary
Package metadata and release version contract
crates/libsy-llm-client/Cargo.toml, crates/switchyard-server/Cargo.toml, docs/internal/release_workflow.md
Rust packages now include crates.io metadata. The server requires libsy version 0.2.0. Release documentation requires matching Python, Rust, and tag versions.
Ordered crates.io publication
.github/workflows/publish.yml, docs/internal/release_workflow.md
The workflow validates release versions and publishes protocol, foundation, client, and server crates in dependency order. PyPI publication waits for the Rust server publication.
Published server installation guidance
README.md, crates/switchyard-server/README.md, docs/cli_reference.md, docs/getting_started.md, docs/routing_algorithms/*
Instructions now install switchyard-server with Cargo and invoke the installed binary instead of a repository-built binary.

Estimated code review effort: 4 (Complex) | ~45 minutes

Poem

A rabbit checks the tags at night,
Crates march onward, linked and right.
Cargo brings the server near,
PATH commands replace the gear.
“Hop!” says Bun, “the release is clear!”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: publishing Rust crates from release tags through CI.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/getting_started.md`:
- Around line 110-119: Update the four routing-algorithm documentation links
that still target `#build-the-server` to use `#install-the-server`, and revise their
surrounding wording from “building” to “installing.” Keep the Install the server
section in docs/getting_started.md as the canonical destination.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 87d69a8c-3a14-4a62-b522-41751596b862

📥 Commits

Reviewing files that changed from the base of the PR and between 74b8990 and 5075d7c.

📒 Files selected for processing (12)
  • .github/workflows/publish.yml
  • README.md
  • crates/libsy-llm-client/Cargo.toml
  • crates/switchyard-server/Cargo.toml
  • crates/switchyard-server/README.md
  • docs/cli_reference.md
  • docs/getting_started.md
  • docs/internal/release_workflow.md
  • docs/routing_algorithms/escalation_router_routing.md
  • docs/routing_algorithms/llm_classifier_routing.md
  • docs/routing_algorithms/overview.md
  • docs/routing_algorithms/random_routing.md

Comment thread docs/getting_started.md
Signed-off-by: nachiketb <nachiketb@nvidia.com>
Signed-off-by: nachiketb <nachiketb@nvidia.com>
Comment thread crates/switchyard-server/Cargo.toml
@nachiketb-nvidia
nachiketb-nvidia merged commit 5111678 into main Aug 7, 2026
21 checks passed
@nachiketb-nvidia
nachiketb-nvidia deleted the nachiketb/ci-publish-rust-crates branch August 7, 2026 19:50
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