Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/publish-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,22 @@ name: Publish to crates.io
# token. Once Trusted Publishing is configured per crate and the secret is
# removed, publishes run entirely over OIDC with no stored credentials.

# No `push: tags` trigger — crates.io publish is manual-only. The release
# workflow (binaries + GitHub release) is tag-triggered; this one is not, so
# a patch tag can't accidentally publish before you've dry-run-verified.
# Tag-triggered (`v*`) for releases, mirroring buffa's publish-crates
# workflow. The `workflow_dispatch` path remains for re-runs and dry-run
# verification. On a tag push `inputs.dry_run` is undefined → falsy → no
# `--dry-run` flag, so a tag push is always a real publish.
#
# Supply-chain guards: the "release tags" repository ruleset restricts
# `refs/tags/v*` creation/update/deletion to repository admins and
# requires signed tags, so a non-admin cannot push a tag that triggers
# this. The `crates-io` GitHub Environment additionally restricts which
# refs may run inside it (`v*` tags and `main`), so a feature branch
# cannot dispatch a publish either. There is no human-approval gate on
# the publish step itself once a release tag exists; if that is wanted,
# add a required-reviewer to the `crates-io` environment.
on:
push:
tags: ['v*']
workflow_dispatch:
inputs:
dry_run:
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,36 @@ increment the patch version.

## [Unreleased]

## [0.4.1] - 2026-05-07

### Fixed

- **`connectrpc-build`: generated `mod.rs` `#[allow(...)]` now suppresses
`unused_qualifications` and `impl_trait_redundant_captures`.** The 0.4.0
trait method RPIT carries a `use<'a, Self>` precise-capturing clause that
is required for edition-2021 consumers but redundant under edition 2024,
and buffa 0.5 codegen references sibling types through the canonical
`__buffa::view::*` path even when a shorter natural-path re-export exists
(the re-export can be shadowed by a same-named proto type). Both lints
fired against the generated code in workspaces that opt them in (or build
with `-D warnings`). The two extra entries in the `#[allow(...)]`
block scope the suppression to the `pub mod <pkg>` tree and don't touch
hand-written code.

Also documenting one related lint with no codegen-side workaround:
`refining_impl_trait_internal` (`warn` by default since rust 1.86,
rust-lang/rust#121718) fires on every handler `impl`, because the
generated trait declares `ServiceResult<impl Encodable<Out> + ...>`
while the handler returns `ServiceResult<Out>`. The refinement is
intentional — it is what lets handlers return either an owned
message, a borrowed view, or a `MaybeBorrowed<M, V>` — and is benign
for handler impls, which are not part of the service's public API.
There is no place in the generated module tree where `#[allow(...)]`
could reach the handler impl. Consumers who deny warnings should set
`refining_impl_trait_internal = "allow"` in `[lints.rust]` (or
workspace lints) or `#[allow(refining_impl_trait)]` on each handler
`impl` block.

## [0.4.0] - 2026-05-06

This release tracks buffa 0.5.0. **Consumers with checked-in
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ The core crate compiles for `wasm32-unknown-unknown`. Generated clients are gene

```toml
[dependencies]
connectrpc = { version = "0.2", default-features = false, features = ["gzip"] }
connectrpc = { version = "0.4", default-features = false, features = ["gzip"] }
```

### Minimal build (no compression)
Expand Down
2 changes: 1 addition & 1 deletion connectrpc-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "connectrpc-build"
version = "0.4.0"
version = "0.4.1"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
Expand Down
12 changes: 12 additions & 0 deletions connectrpc-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,21 @@ fn generate_include_file(entries: &[(String, String)], relative: bool) -> String
}
for (name, child) in &node.children {
let ident = buffa_codegen::idents::escape_mod_ident(name);
// `unused_qualifications`: buffa-codegen always references
// sibling types through the canonical `__buffa::view::*` path
// even when a shorter natural-path re-export exists, because
// the re-export can be shadowed by a proto type with the same
// name. The qualification is intentional, not "unused".
//
// `impl_trait_redundant_captures`: the `use<'a, Self>` precise-
// capturing clause on trait method RPITs is required for
// edition-2021 consumers (which capture only `'static` by
// default) but redundant under edition 2024. Codegen targets
// both editions and cannot know the consumer's at write time.
writeln!(
out,
"{indent}#[allow(dead_code, non_camel_case_types, unused_imports, \
unused_qualifications, impl_trait_redundant_captures, \
clippy::derivable_impls, clippy::match_single_binding)]"
)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion connectrpc-codegen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "connectrpc-codegen"
version = "0.4.0"
version = "0.4.1"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion connectrpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "connectrpc"
version = "0.4.0"
version = "0.4.1"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions examples/bazel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ publish = false
path = "stub.rs"

[dependencies]
buffa = { version = "0.5.0", features = ["json"] }
connectrpc = { version = "0.4.0", default-features = false, features = ["server", "client"] }
buffa = { version = "0.5.1", features = ["json"] }
connectrpc = { version = "0.4.1", default-features = false, features = ["server", "client"] }
futures = "0.3"
http-body = "1"
serde = { version = "1", features = ["derive"] }
Expand Down
Loading