fix(zen): allow dead_code on generated flow proto types (clippy) (#3425) #3497

Merged
mfreeman451 merged 1 commit from fix/zen-proto-clippy-allow into staging 2026-06-01 13:24:37 +00:00
Owner

What

cargo clippy --manifest-path rust/consumers/zen/Cargo.toml --all-targets -- -D warnings fails on serviceradar-zen:

error: struct `FlowAttribution` is never constructed
error: struct `AttributedFlowMessage` is never constructed
note: `-D dead-code` implied by `-D warnings`

These are generated from proto/flow/flow.proto (the netprobe flow-attribution path). zen compiles the flow proto but doesn't construct those types yet, so -D dead-code trips.

Fix

Apply the same #[allow(dead_code)] + #[allow(clippy::large_enum_variant)] type_attributes to the flow-proto generation that the main proto block in build.rs already uses — keeping the two generation blocks consistent.

Validation

cargo clippy --manifest-path rust/consumers/zen/Cargo.toml --all-targets -- -D warnings:

  • before: 2 dead-code errors (fails)
  • after: clean (passes, 22s)

🤖 Generated with Claude Code

## What `cargo clippy --manifest-path rust/consumers/zen/Cargo.toml --all-targets -- -D warnings` fails on `serviceradar-zen`: ``` error: struct `FlowAttribution` is never constructed error: struct `AttributedFlowMessage` is never constructed note: `-D dead-code` implied by `-D warnings` ``` These are generated from `proto/flow/flow.proto` (the netprobe flow-attribution path). zen compiles the flow proto but doesn't construct those types yet, so `-D dead-code` trips. ## Fix Apply the same `#[allow(dead_code)]` + `#[allow(clippy::large_enum_variant)]` `type_attribute`s to the **flow-proto** generation that the **main** proto block in `build.rs` already uses — keeping the two generation blocks consistent. ## Validation `cargo clippy --manifest-path rust/consumers/zen/Cargo.toml --all-targets -- -D warnings`: - **before:** 2 dead-code errors (fails) - **after:** clean (passes, 22s) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(zen): allow dead_code on generated flow proto types (clippy) (#3425)
Some checks failed
Rust Tests / test-rust (rust/rdp-adapter, cargo) (push) Successful in 1m32s
lint / lint (push) Successful in 1m34s
Secret Scan / gitleaks (pull_request) Successful in 36s
Rust Tests / test-rust (rust/trapd, cargo) (push) Successful in 2m9s
Rust Tests / test-rust (rust/log-collector, cargo) (push) Successful in 2m28s
Rust Tests / test-rust (rust/rperf-client, cargo) (push) Successful in 2m28s
Rust Tests / test-rust (rust/consumers/zen, cargo) (push) Successful in 2m52s
lint / lint (pull_request) Successful in 3m1s
Rust Tests / test-rust (rust/rdp-connector-probe, cargo) (push) Successful in 4m3s
Rust Tests / test-rust (//rust/netprobe:netprobe, //build/platforms:linux_aarch64_musl, rust/netprobe, bazel-static) (push) Successful in 4m22s
Rust Tests / test-rust (//rust/netprobe:netprobe, //build/platforms:linux_x86_64_musl, rust/netprobe, bazel-static) (push) Successful in 4m30s
Rust Tests / test-rust (//rust/rperf-server:rperf, rust/rperf-server, bazel) (push) Successful in 4m42s
Rust Tests / test-rust (//rust/netprobe:netprobe_test, rust/netprobe, bazel-test) (push) Failing after 5m38s
Rust Tests / test-rust (rust/srql, cargo) (push) Successful in 5m44s
CI / build (pull_request) Failing after 14m58s
8bf02dd26c
`cargo clippy -- -D warnings` fails on serviceradar-zen:

    error: struct `FlowAttribution` is never constructed
    error: struct `AttributedFlowMessage` is never constructed

These are generated from proto/flow/flow.proto (the netprobe flow-attribution
path); zen compiles the flow proto but does not construct those types yet, so
`-D dead-code` (implied by `-D warnings`) trips. Apply the same
`#[allow(dead_code)]` + `#[allow(clippy::large_enum_variant)]` type-attributes to
the flow-proto generation that the main proto block already uses.

Verified: `cargo clippy --manifest-path rust/consumers/zen/Cargo.toml --all-targets
-- -D warnings` fails before, passes after.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mfreeman451 deleted branch fix/zen-proto-clippy-allow 2026-06-01 13:24:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
carverauto/serviceradar!3497
No description provided.