Skip to content

chore: bump to 21.11.0 with pub API tests, standards compliance, and two bug fixes - #40

Merged
eastspire merged 1 commit into
masterfrom
chore/bump-21.11.0
Oct 6, 2026
Merged

eastspire merged 1 commit into
masterfrom
chore/bump-21.11.0

Conversation

@eastspire

Copy link
Copy Markdown
Member

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: publish and release in .github/workflows/rust.yml are gated on push to master, so this PR runs setup / Push / check / tests / clippy / build but will not publish to crates.io. Publishing happens on merge.

Tests — 493 → 693, 0 failures

Crate Before After
http-constant 0 21
http-compress 1 17
http-request 12 104
hyperlane-cli 12 49
plugin/websocket 1 37
http-type 304 304
hyperlane-core 61 61
hyperlane-macros 100 doctests 100

The http-constant tests assert the X / X_BYTES / X_U8 consistency that its ~9000 constants depend on, plus header/mime/delimiter invariants. Writing them surfaced five wrong assumptions that the code corrected: BR is "\n" not "\r"; LEFT_BRACKET is "{" (square brackets are a separate constant set); log levels are lowercase except TRACE; DEFAULT_HOST_IPV4_ADDR is 0.0.0.0; and low-security limits are usize::MAX, so the ordering runs opposite to first intuition.

Bug fixes

  • http-compress — Content-Encoding: br shipped gzip bytes. brotli::encode was a copy-paste of gzip using GzEncoder (its own doc comment said "Compresses the given data using Gzip compression") while brotli::decode used a real brotli Decompressor. Since type/src/response/impl.rs:651 encodes server bodies and request/src/response/impl.rs:192 decodes them, a br response could not be decoded by any client. Now uses brotli::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.
  • Panicking getters on Option<Copy>. ServerConfig::{nodelay,ttl} and CookieBuilder::{max_age,secure,http_only} derived getters that unwrap and panic on None. The codebase consistently uses try_get_*, but the panicking variant stayed publicly reachable. Annotated with #[get(type(copy))].

Standards compliance — 35/45 → 47/47

  • 123 untyped let bindings, 482 non-compliant doc comments, 246 hardcoded strings → const.rs (10 new files carry the literals)
  • 105 qualified std:: paths in sub-files hoisted into each crate's lib.rs
  • impl Trait parameters → explicit generics + where clauses
  • direct self.field access → accessor methods
  • websocket lib.rs doc block and import ordering

Two caveats on this, both deliberate and revertible:

  1. §9.2 broke a public API. Server::route<S> became route<S, P> because impl Trait is 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.
  2. std::string::String inside quote! bodies (macros/src/request/fn.rs:348,381) was rewritten to the prelude String to 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 shadow String.

Known follow-ups (not addressed here)

  • RequestConfig is pub in config/struct.rs but re-exported pub(crate), so downstream code hits E0433 and HttpRequest::{config,set_config,get_config} are unusable by name.
  • HttpResponse::from_bytes rejoins multi-line bodies with \n instead of \r\n, so bytes() does not round-trip the wire.
  • execute_template calls ensure_directory before validating the missing-subtype argument, so an invalid call still creates ./application/model/.
  • Seven 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 to Option<Copy>, so it does not flag them, and #[get(type(copy))] does not apply to non-Copy.

🤖 Generated with Claude Code

…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.
@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Oct 6, 2026
@eastspire
eastspire merged commit be4f66c into master Oct 6, 2026
8 checks passed
@eastspire
eastspire deleted the chore/bump-21.11.0 branch October 6, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant