ci(publishing): fix publishing commands#11
Conversation
Signed-off-by: Will Killian <wkillian@nvidia.com>
WalkthroughFixes CI publishing commands for Rust, PyPI, and npm by constraining Rust workspace publication scope, updating PyPI action reference, and correcting npm package path. Adds README documentation for FFI, Node.js, and WebAssembly binding crates. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 9/10 reviews remaining, refill in 6 minutes. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/ci.yaml:
- Around line 134-141: Centralize the repeated cargo publish package list by
extracting "cargo publish -p nemo-flow -p nemo-flow-adaptive -p nemo-flow-ffi
--no-verify" into a single reusable value (e.g., a workflow/env variable like
PACKAGES or a single run step) and reference that value from both the trusted
and token publishing steps (the step currently labelled "Publish to crates.io
with registry token" and its counterpart). Update the steps to call the shared
variable (e.g., use ${{ env.PACKAGES }} or a single publish job) and keep the
CARGO_REGISTRY_TOKEN usage unchanged for the token path so the command list
cannot drift between the two branches.
In `@crates/node/README.md`:
- Around line 11-13: Replace the plain text occurrence of napi-rs with inline
code formatting; locate the sentence containing "napi-rs to expose NeMo Flow
runtime scopes..." and change the package name token napi-rs to inline code
(e.g., `napi-rs`) so the README follows the guideline that package names are
shown in monospace.
In `@crates/wasm/README.md`:
- Around line 10-11: The sentence mentioning wasm-bindgen should format the
dependency/tool name as inline code; update the README text that currently reads
"wasm-bindgen" to use inline code formatting for the token `wasm-bindgen` so it
appears monospace and consistent with other code/command mentions in the docs.
🪄 Autofix (Beta)
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: ASSERTIVE
Plan: Enterprise
Run ID: 7fe36b2d-0982-4840-9d66-63363805b99c
📒 Files selected for processing (4)
.github/workflows/ci.yamlcrates/ffi/README.mdcrates/node/README.mdcrates/wasm/README.md
📜 Review details
🧰 Additional context used
📓 Path-based instructions (21)
**/*.{rs,py,js,ts,tsx,go,md,sh,toml,yaml,yml,json,lock,txt}
📄 CodeRabbit inference engine (AGENTS.md)
Keep SPDX headers on source, docs, scripts, and configuration files. The project uses Apache-2.0 license.
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
**/*.{html,md}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
Include SPDX license header in all HTML and Markdown files using comment syntax
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
**/{README.md,*.md,docs/**/*.md,examples/**/*,scripts/**/*}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
**/{README.md,*.md,docs/**/*.md,examples/**/*,scripts/**/*}: Prefer the documented public API, not internal shortcuts
Keep package names, repo references, and build commands current
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
**/{README.md,*.md,docs/**/*.md,examples/**/*}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Keep stable user-facing wrappers at scripts/ root in docs and examples; only point at namespaced helper paths when documenting internal maintenance work
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
**/{examples/**/*,docs/**/*.md,README.md,*.md}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Example commands still match current package names and paths
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
**/README.md
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Relevant package or crate README.md files updated when examples or binding guidance changed
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
**/{RELEASING.md,docs/**/*.md,README.md}
📄 CodeRabbit inference engine (.agents/skills/contribute-docs/SKILL.md)
Release-policy docs still point to GitHub Releases as the only release-history source of truth
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
**/*.{rs,py,js,ts,tsx,jsx,json,yaml,yml,toml,md}
📄 CodeRabbit inference engine (.agents/skills/prepare-pr/SKILL.md)
Changed files must be formatted with the language-native formatter
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
{docs/**,examples/**,**/*.md,**/*.rst}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update documentation and examples to reflect new repository, package, module, or symbol names used in code samples and references
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
**/*.md
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
**/*.md: Review documentation, examples, and docs-heavy changes for NVIDIA technical writing style, terminology, and repo accuracy
Flag stale commands, package names, APIs, bindings, repo paths, or support claims in documentation before stylistic issues
Commands, package names, file paths, or APIs must be correct and not stale in documentation
Examples and procedures must be accurate as written and likely to succeed
User-facing naming must be consistent with current repo terminology
Code, commands, paths, and filenames must be formatted as inline code (monospace) in documentation
Headings in technical documentation must use title case
Code blocks and lists must be introduced with complete lead-in sentences in documentation
Use descriptive anchor text in links, not bare URLs or weak labels such as 'here'
Prefer active voice, present tense, short sentences, and plain English in documentation
Procedures must use imperative voice, be parallel in structure, and split into smaller tasks when too long
Use 'after' instead of 'once' for temporal references in documentation when clarity is important
Use 'can' instead of 'may' when the meaning is possibility rather than permission in documentation
Use consistent terminology throughout documentation for the same concept
Avoid ambiguous numeric dates and ordinal dates in documentation body text
Do not force trademark symbols in learning-oriented documentation unless explicitly required by the source document
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
{README.md,docs/index.md,**/README.md,python/*/README.md,crates/*/README.md}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
{README.md,docs/index.md,**/README.md,python/*/README.md,crates/*/README.md}: Keep docs aligned with current NeMo Flow behavior, repo layout, and entry points (README.md, docs/index.md, package READMEs, binding-level source READMEs)
Public behavior changes must be reflected in corresponding entry-point docs (README.md, docs/index.md, package/crate READMEs)
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
**/*.{md,py,ts,tsx,js,jsx,rs,java,cpp,c,h,sh}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/SKILL.md)
NVIDIA must be capitalized correctly in all documentation
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
**/*.{md,rst,html,txt}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-brand-terminology.md)
**/*.{md,rst,html,txt}: Always spellNVIDIAin all caps. Do not useNvidia,nvidia,nVidia,nVIDIA, orNV.
Usean NVIDIAbefore a noun because the name starts with an 'en' sound.
Do not add a registered trademark symbol afterNVIDIAwhen referring to the company.
Use trademark symbols with product names only when the document type or legal guidance requires them.
Verify official capitalization, spacing, and hyphenation for product names.
Precede NVIDIA product names withNVIDIAon first mention when it is natural and accurate.
Do not rewrite product names for grammar or title-case rules.
Preserve third-party product names according to the owner's spelling.
Include the company name and full model qualifier on first use when it helps identify the model.
Preserve the official capitalization and punctuation of model names.
Use shorter family names only after the full name is established.
Spell out a term on first use and put the acronym in parentheses unless the acronym is widely understood by the intended audience.
Use the acronym on later mentions after it has been defined.
For long documents, reintroduce the full term if readers might lose context.
Form plurals of acronyms withs, not an apostrophe, such asGPUs.
In headings, common acronyms can remain abbreviated. Spell out the term in the first or second sentence of the body.
Common terms such asCPU,GPU,PC,API, andUIusually do not need to be spelled out for developer audiences.
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
**/*.{md,rst,html}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-brand-terminology.md)
Link the first mention of a product name when the destination helps the reader.
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
**/*.{md,rst,txt}
📄 CodeRabbit inference engine (.agents/skills/review-doc-style/assets/nvidia-style-guide.md)
**/*.{md,rst,txt}: SpellNVIDIAin all caps. Do not useNvidia,nvidia, orNV.
Format commands, code elements, expressions, package names, file names, and paths as inline code.
Use descriptive link text. Avoid raw URLs and weak anchors such as 'here' or 'read more.'
Use title case consistently for technical documentation headings.
Introduce code blocks, lists, tables, and images with complete sentences.
Write procedures as imperative steps. Keep steps parallel and split long procedures into smaller tasks.
Prefer active voice, present tense, short sentences, contractions, and plain English.
Usecanfor possibility and reservemayfor permission.
Useafterfor temporal relationships instead ofonce.
Preferrefer tooverseewhen the wording points readers to another resource.
Avoid culture-specific idioms, unnecessary Latinisms, jokes, and marketing exaggeration in technical documentation.
Spell out months in body text, avoid ordinal dates, and use clear time zones.
Spell out whole numbers from zero through nine unless they are technical values, parameters, versions, or UI values.
Use numerals for 10 or greater and include commas in thousands.
Do not add trademark symbols to learning-oriented documentation unless the source, platform, or legal guidance explicitly requires them.
Do not add trademark symbols to NeMo Flow learning documentation by default.
Do not rewrite API names, package names, command flags, or code literals for style reasons.
**/*.{md,rst,txt}: Use title case consistently in technical documentation headings
Avoid quotation marks, ampersands, and exclamation marks in headings
Keep product, event, research, and whitepaper names in their official title case
Use title case for table headers in technical documentation
Format code elements, commands, parameters, and package names in monospace
Format directories, file names, and paths in monospace with backticks
Use angle brackets inside monospace for variables in paths, such as `/h...
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
crates/ffi/**
📄 CodeRabbit inference engine (.agents/skills/test-ffi-surface/SKILL.md)
crates/ffi/**: Rebuild the FFI crate in release mode to ensure the shared library and header stay in sync
Runjust test-rustto validate FFI changes
Files:
crates/ffi/README.md
crates/{python,ffi,node,wasm}/**/*
⚙️ CodeRabbit configuration file
crates/{python,ffi,node,wasm}/**/*: Treat binding changes as public API changes. Check for parity with the other language bindings, FFI ownership/lifetime safety,
callback error propagation, stable type conversion, and consistent async/stream semantics.
Flag changes that update one binding without corresponding tests or documentation for the same surface elsewhere.
Files:
crates/ffi/README.mdcrates/wasm/README.mdcrates/node/README.md
.github/workflows/*.{yml,yaml}
📄 CodeRabbit inference engine (.agents/skills/maintain-ci/SKILL.md)
.github/workflows/*.{yml,yaml}: Putpermissions:on each job that needs token access in GitHub Actions workflows
Avoid workflow-level permissions unless the repository intentionally centralizes them and the inheritance tradeoff is documented
Keep third-party actions pinned to full commit SHAs and preserve the readable version comment after the SHA
Prefer action-native or ecosystem-native caching over genericactions/cachein GitHub Actions workflows
Use lockfiles or dependency manifests to drive cache invalidation in GitHub Actions workflows
Keep deploy and publish permissions isolated to the jobs that need them in GitHub Actions workflows
Read both caller and callee when a workflow usesworkflow_callin GitHub Actions
Put release-tag validation in the earliest practical caller job when the pipeline has tag-based publish behavior
contents: readis the default minimum for checkout-based build, test, docs, and packaging jobs in GitHub Actions workflows
pull-requests: readis required for PR metadata lookup jobs in GitHub Actions workflows
pages: writeandid-token: writeshould be limited to Pages deployment jobs and any caller that invokes them through a reusable workflow
For reusable workflows, the caller must grant every permission the called jobs require. The callee cannot elevate beyond what the caller provides
Preferastral-sh/setup-uvcache support withcache-dependency-globanchored touv.lockin GitHub Actions workflows
PreferSwatinem/rust-cachewith explicitshared-keyandworkspacesinstead of ad hoc target-directory caching in GitHub Actions workflows
Avoid caching generated outputs that can hide stale behavior unless the repo already relies on them deliberately in GitHub Actions workflows
Files:
.github/workflows/ci.yaml
{.github/workflows/*.{yml,yaml},.gitlab-ci.yml}
📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)
Ensure CI workflow references match the same package names as local workflows
Files:
.github/workflows/ci.yaml
{.github/**,*.patch,**/*.sh,**/Makefile,**/*.yml,**/*.yaml}
📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)
Update patch files and CI scripts to reference the new names in coordinated rename operations
Files:
.github/workflows/ci.yaml
{.github/**,.gitlab-ci.yml,.pre-commit-config.yaml,justfile,scripts/**}
⚙️ CodeRabbit configuration file
{.github/**,.gitlab-ci.yml,.pre-commit-config.yaml,justfile,scripts/**}: Review automation changes for reproducibility, pinned versions where appropriate, secret handling, and consistency with the documented validation matrix.
Pay attention to commands that need generated native artifacts, FFI libraries, or platform-specific environment variables.
Files:
.github/workflows/ci.yaml
🔇 Additional comments (2)
.github/workflows/ci.yaml (1)
162-162: Good fixes on publishing reliability and path correctness.Pinned PyPI action SHA at Line 162 and explicit npm publish path at Line 214 both look correct and improve reproducibility.
Also applies to: 214-214
crates/ffi/README.md (1)
1-21: README content and structure look good.SPDX header, binding-surface description, and project doc pointers are clear and consistent with the crate scope.
bbednarski9
left a comment
There was a problem hiding this comment.
rubber stamp to unblock
|
/merge |
> [!WARNING] > **BREAKING CHANGE:** **[Rust source compatibility]** This PR adds `FlowError::Upstream` and new fields to the public `AtofEndpointConfig`, `AtofEndpointSectionConfig`, and `EmitMarkEventParams` types. Downstream exhaustive `FlowError` matches must handle the new variant, and direct struct literals must initialize the new fields or migrate to the provided constructor/builder APIs. Builder-based mark emission and default Relay configurations remain compatible. #### Overview This adds Relay's first-party integration with the [Switchyard](https://github.com/NVIDIA-NeMo/Switchyard) Decision API. The plugin routes buffered and streaming LLM requests through an external Switchyard service, executes the selected Relay-owned backend, and records causal model-routing optimization evidence. Switchyard owns provider-protocol translation through its `switchyard-translation` Rust library. Relay consumes that library only when the native Switchyard plugin is enabled; default Relay builds do not include either the plugin or the translation dependency. - [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license. - [x] I searched existing issues and open pull requests, and this does not duplicate existing work. #### Details ##### Plugin and execution behavior - Add the standalone `nemo-relay-switchyard` first-party plugin. - Normalize stable Relay identity and build `switchyard.routing_request.v1` requests. - Validate selected routes and optional counterfactual baselines against exact Relay-owned backend bindings. - Support enforce and observe-only modes, six request-materialization modes, bounded retry-aware dispatch, protocol-specific trusted fallbacks, and no retry after the first upstream stream item. - Record one model-routing optimization contribution only after the selected route commits. Failed decisions, failed provider attempts, and fallback dispatches do not claim routing savings. - Preserve Switchyard routing metadata, including snapshot freshness, decision source, event count, and turn depth. - Continue using Relay's existing ATOF exporter and lifecycle; the plugin does not install local routers, feature accumulators, or a duplicate event subscriber. ##### Translation ownership and optional dependency Request, buffered-response, and SSE translation across OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages use Switchyard's public `switchyard-translation` library instead of a Relay-local translation engine. The dependency is pinned to the immutable topic-branch commit [`8f9db9a6a47f848cdff1d262276ba25a8ae9cbc8`](NVIDIA-NeMo/Switchyard@8f9db9a), which includes the Decision API series, StageRouter baseline/freshness behavior, and [Switchyard #46](NVIDIA-NeMo/Switchyard#46). The Relay CLI exposes this through `--features switchyard`: - Without that feature, `nemo-relay-cli` contains neither `nemo-relay-switchyard` nor `switchyard-translation`. - With that feature, the plugin and its pinned Switchyard translation library are compiled and registered. - Relay continues to own target bindings, credentials, dispatch, retries, fallbacks, lifecycle, and observability. - Relay retains narrow fail-open policy checks for provider extensions that cannot be translated without data loss. ##### Runtime requirements The current experimental deployment requires a separately running Switchyard service from the pinned topic commit. The plugin does not start or supervise that service. Switchyard availability is not a Relay startup requirement. It is a request-time dependency: connection failures, timeouts, malformed decisions, selected-route drift, unsupported extensions, and missing required identity fail open to the configured same-protocol default. ATOF-backed profiles additionally require Relay's ATOF HTTP exporter to target Switchyard's `/v1/atof/events` endpoint with preserved field names and environment-referenced authentication. The public examples document this service boundary, verify the exact Switchyard revision before startup, and intentionally remain manual compatibility workflows rather than production orchestration. ##### Optimization accounting and observability This PR builds on the plugin-neutral accounting contract merged in [NeMo Relay #389](#389). Applied routing contributions carry the selected and baseline model transition, decision identity, backend and tier, attempt, rollout mode, reason, and router metadata. Observe-only decisions remain visible as non-applied evidence. Relay core combines routing and other plugin contributions at LLM close while retaining explicit token evidence for downstream repricing. Existing requested, decision, retry, fallback, and error routing marks remain available alongside the canonical optimization contribution. The generic ATIF change that attributes `step.model_name` to the effective response model is intentionally separated into [NeMo Relay #399](#399). This PR still ensures translated provider responses carry the actual selected model; #399 independently controls how ATIF presents it. ##### Testing summary - `cargo fmt --all -- --check` - `cargo clippy -p nemo-relay-switchyard --all-targets -- -D warnings` - `cargo clippy -p nemo-relay-cli --features switchyard --all-targets -- -D warnings` - `cargo check -p nemo-relay-cli` — proves the default CLI builds without Switchyard. - `cargo check -p nemo-relay-cli --features switchyard` — proves the opt-in dependency path. - `cargo test -p nemo-relay-switchyard` — 31 passed. - `cargo test -p nemo-relay-cli gateway::tests` — 33 passed without the feature. - `cargo test -p nemo-relay-cli --features switchyard gateway::tests` — 33 passed with the feature. - `cargo test -p nemo-relay-cli --features switchyard --test switchyard_process_e2e` — buffered, streaming, retry, and fail-open process boundary passed after the split. - `examples/switchyard/run-real-e2e.sh` against the exact pinned Switchyard service — passed with the expected StageRouter route sequence `provider/weak`, `provider/strong`, `provider/strong`. - The pinned Switchyard translation crate separately passes 61 request, response, streaming, extension, and round-trip tests under Rust 1.93. ##### Previous feedback addressed - Split the implementation at repository ownership boundaries. - Replaced Relay's custom translation engine with the Switchyard-owned reusable library. - Kept the dependency compile-time optional for users who do not enable the Relay-native Switchyard plugin. - Removed in-process Random, LLM, and Cascade routers, Relay-side feature accumulation, duplicate Switchyard subscriptions, and the global fallback target. - Replaced literal credentials with environment-referenced headers and activation-time validation. - Hardened internal dispatch headers and structured upstream-failure metadata. - Standardized routing terminology on StageRouter. - Standardized model-routing evidence on Relay's shared optimization contract instead of adding a second post-call savings mark. - Moved generic ATIF effective-model attribution into focused PR #399. - Moved Fern documentation into focused experimental docs PR #400 so this functional PR remains code-focused. - Kept public examples free of internal-only providers, credentials, Visor source references, and private infrastructure assumptions. #### Where should the reviewer start? 1. `crates/switchyard/src/component.rs` — Decision API lifecycle, exact target and baseline validation, retries, fallback, and terminal route commitment. 2. `crates/switchyard/src/translation.rs` and `stream_translation.rs` — thin policy adapters over the Switchyard-owned translation library. 3. `crates/cli/Cargo.toml` and the `cfg(feature = "switchyard")` registration paths — compile-time optionality. 4. `crates/cli/src/gateway.rs` — reserved dispatch headers and structured retry-aware upstream failures. 5. `crates/cli/tests/switchyard_process_e2e.rs` — process-boundary buffered, streaming, and fail-open coverage. 6. `examples/switchyard/README.md` and `run-real-e2e.sh` — pinned experimental service workflow. #### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) - Relates to [NVIDIA/NeMo-Relay #389](#389). - Relates to [NVIDIA/NeMo-Relay #399](#399). - Relates to [NVIDIA/NeMo-Relay #400](#400). - Relates to [NVIDIA-NeMo/Switchyard #46](NVIDIA-NeMo/Switchyard#46). - Paired with the Switchyard Decision API topic series: - [NVIDIA-NeMo/Switchyard #8](NVIDIA-NeMo/Switchyard#8) - [NVIDIA-NeMo/Switchyard #9](NVIDIA-NeMo/Switchyard#9) - [NVIDIA-NeMo/Switchyard #11](NVIDIA-NeMo/Switchyard#11) - [NVIDIA-NeMo/Switchyard #35](NVIDIA-NeMo/Switchyard#35) Authors: - Bryan Bednarski (https://github.com/bbednarski9) Approvers: - Will Killian (https://github.com/willkill07) - Maryam Najafian (https://github.com/mnajafian-nv) - https://github.com/Salonijain27 URL: #369
Overview
Add README.md to all crates
Bump python publishing action
Explicitly use relative directory for NPM
I confirm this contribution is my own work, or I have the right to submit it under this project's license.
I searched existing issues and open pull requests, and this does not duplicate existing work.
Where should the reviewer start?
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)
Summary by CodeRabbit
Documentation
Chores