build(deps): drop an unused dependency and narrow unused features - #961
build(deps): drop an unused dependency and narrow unused features#961membphis wants to merge 2 commits into
Conversation
Hygiene pass backed by a zero-usage search across src/ and tests/ of every crate: - aisix-a2a: remove the unused direct http dependency (its tests use axum's re-export; the crate itself never names http::) - tower-http: keep only set-header out of [trace, cors, limit, compression-gzip, set-header] - the other four have no call sites; body limiting is axum DefaultBodyLimit plus the crate's own enforce_request_body_limit - axum: drop macros (no debug_handler / derive(FromRef) users); the axum-macros proc-macro leaves the tree - uuid: drop serde (no Uuid crosses a serde boundary) - tracing-subscriber: drop json (no JSON formatter is constructible and no config knob selects one); tracing-serde leaves the tree axum's tracing feature is kept on purpose (it gates axum-internal rejection logging and exposes no API), now recorded in a comment.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ature The comment claimed removing the entry would drop rejection logging; with default features on, the entry documents intent rather than being what enables it (audit finding on #961).
|
Note on the stack: CI does not trigger while the base is |
|
Closing as not needed, per maintainer decision. For the record, the full reasoning — this is a value judgment, not a correctness problem: Why it is safe (what closing does NOT mean). The independent audit on this PR came back 0 HIGH / 0 MEDIUM: all five zero-usage claims were verified across src, tests, doc-tests, cfg-gated code and the lockfile, and the one LOW (the axum Why it is not worth carrying anyway.
What survives this closure. The durable output was the audit itself, and that is recorded (here and in the internal dependency-hygiene report): the unused-feature inventory with evidence, the deliberately-kept list (axum |
What
Dependency-hygiene pass over the workspace manifests: removes the one unused direct dependency and narrows four feature lists to what the code actually uses. No behavior change; every cut is backed by a zero-usage search across
src/andtests/of all crates.Changes and evidence
httpdependencyhttp::references in the crate; its tests useaxum::http(axum's re-export, not the direct dep). Onlycargo machetefinding in the workspace, manually verified (no cfg-gated / feature-gated / test-only use)["trace", "cors", "limit", "compression-gzip", "set-header"]→["set-header"]TraceLayer/CorsLayer/RequestBodyLimitLayer/CompressionLayerhave zero hits; body limiting isaxum::extract::DefaultBodyLimitplus the crate's ownenforce_request_body_limit(aisix-proxy/src/lib.rs); the only tower-http item in use isSetResponseHeaderLayer(server header)async-compressionitself stays — reqwest'sgzipfeature (deliberately kept: Accept-Encoding negotiation) enables tower-http's decompression sidemacros#[debug_handler], noderive(FromRef);FromRefappears only as a trait bound, which the feature does not gateaxum-macrosproc-macro crateserdeUuid-typed field crosses a serde boundary; every call site converts immediately (to_string()/simple()/as_u128())json.json()formatter is constructed and there is no log-format config knob, so the JSON formatter is unreachable at runtimetracing-serdeDeliberately kept (audited, not cut)
tracing— has no API surface; it gates axum's internal logging of extractor rejections. It is also an axum default feature (default features stay on), so the explicit entry is documentation of intent rather than what enables it; the manifest comment records both facts so a future sweep does not re-flag it.toml/json— statically zero-hit, butconfig::File::frominfers the format from the file extension, so existingconfig.toml/config.jsondeployments depend on them. Removing them would be a breaking operator-facing change.full— onlyio-stdandprocessare unused, and both are thin internal tokio modules whose removal compiles out no third-party crate; narrowing buys nothing measurable.gzip(Accept-Encoding negotiation),multipart(audio),stream/jsonall in use;rustls-tls-native-rootsis load-bearing (Upstream TLS trust: no config surface for a private CA, and no verification override #860);http2is enabled by object_store's reqwest dependency either way.Verification
cargo check --workspace --all-targets --all-features— cleancargo test --workspace --all-features— 0 failedcargo clippy --workspace --all-targets --all-features— no warnings;cargo fmt --checkcleancargo run -p aisix-core --bin dump-schema— zero schema diffStacked on #960: both PRs touch the workspace manifest and lockfile; this one retargets to
mainautomatically when #960 merges.