Repository navigation
chore: bump to 21.11.0 with pub API tests, standards compliance, and two bug fixes - #40
Merged
Merged
Conversation
…two bug fixes
Brings the workspace to full rust-standards compliance and closes the pub API
test gaps across every crate.
Tests (493 -> 693, 0 failures)
- http-constant: 0 -> 21, asserting the X / X_BYTES / X_U8 consistency that
the ~9000 constants depend on, plus header/mime/delimiter invariants
- http-compress: 1 -> 17, real encode/decode round-trips for all algorithms
- http-request: 12 -> 104, http-type: 304, hyperlane-cli: 12 -> 49
- plugin/websocket: 1 -> 37, covering BroadcastType and WebSocket's pub surface
Bug fixes
- http-compress: brotli::encode used GzEncoder, so a Content-Encoding: br
response shipped gzip bytes that the brotli decoder rejected. Now uses
brotli::CompressorWriter; the three algorithms round-trip correctly.
- plugin/websocket: impl BroadcastTypeTrait for &u64 was missing entirely
(with a truncated doc comment), so BroadcastType<&u64> never compiled.
Confirmed pre-existing via git show HEAD.
- hyperlane-core: ServerConfig::{nodelay,ttl} and CookieBuilder::{max_age,
secure,http_only} are Option<Copy> fields whose derived getters unwrap and
panic on None. Annotated with #[get(type(copy))].
Standards compliance (audit_rust_standards.py: 35/45 -> 47/47, exit 0)
- 123 let bindings, 482 doc comments, 246 hardcoded strings -> const.rs
- 105 qualified std:: paths in sub-files hoisted into each crate's lib.rs
- impl Trait parameters -> explicit generics; self.field accessors added
- 10 new const.rs files carry the extracted string literals
Version
- 21.10.0 -> 21.11.0 via crate bump --minor + crate sync; only the root
Cargo.toml [workspace.package] version and the 9 [workspace.dependencies]
path-dep pins change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the workspace to full rust-standards compliance (47/47, exit 0) and closes the pub API test gaps in every crate. Bumps 21.10.0 → 21.11.0.
Note on release gating:
publishandreleasein.github/workflows/rust.ymlare gated onpushtomaster, so this PR runssetup / Push / check / tests / clippy / buildbut will not publish to crates.io. Publishing happens on merge.Tests — 493 → 693, 0 failures
The
http-constanttests assert theX/X_BYTES/X_U8consistency that its ~9000 constants depend on, plus header/mime/delimiter invariants. Writing them surfaced five wrong assumptions that the code corrected:BRis"\n"not"\r";LEFT_BRACKETis"{"(square brackets are a separate constant set); log levels are lowercase exceptTRACE;DEFAULT_HOST_IPV4_ADDRis0.0.0.0; and low-security limits areusize::MAX, so the ordering runs opposite to first intuition.Bug fixes
http-compress—Content-Encoding: brshipped gzip bytes.brotli::encodewas a copy-paste of gzip usingGzEncoder(its own doc comment said "Compresses the given data using Gzip compression") whilebrotli::decodeused a real brotliDecompressor. Sincetype/src/response/impl.rs:651encodes server bodies andrequest/src/response/impl.rs:192decodes them, a br response could not be decoded by any client. Now usesbrotli::CompressorWriter; all three algorithms round-trip.plugin/websocket—BroadcastType<&u64>never compiled.impl BroadcastTypeTrait for &u64 {}was missing entirely, with a truncated doc comment (/// Allows references to \u64` to be used as) left behind. All 35 sibling&Timpls exist. Confirmed pre-existing viagit show HEAD`, not introduced here.Option<Copy>.ServerConfig::{nodelay,ttl}andCookieBuilder::{max_age,secure,http_only}derived getters that unwrap and panic onNone. The codebase consistently usestry_get_*, but the panicking variant stayed publicly reachable. Annotated with#[get(type(copy))].Standards compliance — 35/45 → 47/47
letbindings, 482 non-compliant doc comments, 246 hardcoded strings →const.rs(10 new files carry the literals)std::paths in sub-files hoisted into each crate'slib.rsimpl Traitparameters → explicit generics +whereclausesself.fieldaccess → accessor methodslib.rsdoc block and import orderingTwo caveats on this, both deliberate and revertible:
Server::route<S>becameroute<S, P>becauseimpl Traitis banned in parameters. This invalidates turbofish call sites (server.route::<Index>("/")→route::<Index, &str>("/")); 41 in-repo call sites were updated. It also contradicts the 5-line example in the skill's own docs. Reverting 3 signatures is a much smaller change if the ergonomic form is preferred over §9.2 compliance.std::string::Stringinsidequote!bodies (macros/src/request/fn.rs:348,381) was rewritten to the preludeStringto satisfy check 47. These macros have no in-workspace consumer, so the 693 tests do not exercise the change; it is only identical in crates that do not shadowString.Known follow-ups (not addressed here)
RequestConfigispubinconfig/struct.rsbut re-exportedpub(crate), so downstream code hitsE0433andHttpRequest::{config,set_config,get_config}are unusable by name.HttpResponse::from_bytesrejoins multi-line bodies with\ninstead of\r\n, sobytes()does not round-trip the wire.execute_templatecallsensure_directorybefore validating the missing-subtype argument, so an invalid call still creates./application/model/.Option<String>fields (type/src/cookie/struct.rs,type/src/panic/struct.rs) generate the same panicking-getter shape as the bug fixed above. Check 46 is scoped toOption<Copy>, so it does not flag them, and#[get(type(copy))]does not apply to non-Copy.🤖 Generated with Claude Code