chore: remove unused dependencies across the workspace - #623
Conversation
|
Warning Review limit reached
More reviews will be available in 6 minutes and 12 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Free Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (16)
📝 WalkthroughWalkthroughRemoves unused and replaced Cargo dependencies across the root workspace manifest and all 15 crate manifests. Dropped crates include the full HTTP/TLS stack ( ChangesWorkspace Dependency Cleanup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Note 🎁 Summarized by CodeRabbit FreeYour organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above. Comment |
cargo-machete plus per-crate source verification surfaced dependencies declared but never referenced. Removed and verified green with `cargo check --workspace --all-targets`: - Unused per-crate deps in 15 crates. aisix-obs hand-rolls its OTLP/HTTP export so the opentelemetry-* SDK crates were dead; the provider crates share an error type so their per-crate thiserror/tracing entries were unused; aisix-proxy reaches http types via axum::http so its direct http/hyper deps were redundant. - 20 [workspace.dependencies] entries left without any consumer (4 never used, including a vestigial tiktoken-rs scaffold dep; 16 orphaned by the per-crate removals). No behavior change; every removed crate was unreferenced. Prunes ~395 lines including a large Cargo.lock reduction.
b0ba662 to
19469d7
Compare
What
Removes dependencies that are declared but never referenced, found with
cargo-macheteand confirmed by per-crate source verification.[workspace.dependencies]declarations left without any consumer: 4 that were never used (including a vestigialtiktoken-rsscaffold dep carried since PR PR #1: Scaffold Cargo workspace, UI skeleton, and CI pipeline #1), plus 16 orphaned once the per-crate consumers were removed.Net: +4 / −395 lines, including a large
Cargo.lockreduction (the now-unreachable transitive crates are pruned too).Why these were genuinely unused (not macro/derive false positives)
Every
cargo-machetehit was checked against the crate's source before removal:aisix-obshand-rolls its OTLP/HTTP export (reqwest + serde_json), so theopentelemetry,opentelemetry_sdk,opentelemetry-otlp,opentelemetry-semantic-conventionsandtracing-opentelemetrycrates were never linked — only mentioned in a doc comment.openai,azure-openai,vertex,bedrock) share an error type and don't log directly, so their per-cratethiserror/tracingentries were unused.aisix-proxyreacheshttptypes throughaxum::http, so its directhttpandhyperdeps were redundant.aisix-ratelimit/aisix-cachedeclaredserdebut never derive/use it (they useserde_jsonon types owned elsewhere);aisix-cache's directaisix-corepath-dep is reached viaaisix-gateway.insta/rstest/serde_yaml(core) andrstest(ratelimit) are not referenced by any test.aws-smithy-typesinaisix-guardrailswasoptionalbehind thebedrockfeature; the bedrock path only usesaws_smithy_runtime_api/aws_smithy_async, so the dep and itsdep:feature entry were both dropped.Verification
cargo check --workspace --all-targets— green (covers all test targets, so the dev-dep removals are exercised; default features include thebedrockguardrail, so theaws-smithy-typesremoval is compiled).Summary by CodeRabbit
Chores
Refactor