Fix remaining stdlib issues#847
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis release updates stdlib behavior for float formatting, weighted selection, JSON parsing, TLS config builders, and HTTP response header serialization. It also adds TLS documentation, revises the stdlib charter, and bumps the release version and changelog. Changesformat_float precision clamping
weighted_choice reachability fix
JSON UTF-8 validation and surrogate error handling
TLS checked config builders and documentation
HTTP response header sanitization
stdlib module charter update
Release version bump and changelog
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant TlsConfig
participant TLSRuntime as raven_tls FFI
Caller->>TlsConfig: add_ca_file_checked(path)
TlsConfig->>TLSRuntime: raven_tls_config_add_ca_file(id, path)
TLSRuntime-->>TlsConfig: ok / 0
TlsConfig->>TLSRuntime: raven_tls_last_error()
alt ok == 0 or error non-empty
TLSRuntime-->>TlsConfig: error message
TlsConfig-->>Caller: Err(tls_error)
else success
TlsConfig-->>Caller: Ok(self)
end
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
examples/v2/stdlib_fmt.rv (1)
1-7: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winHeader comment's expected output list wasn't updated for the new prints.
Lines 22-24 add two new
huge.length() > 0,huge.length() < 400) that will emittrue/true, but the "Prints:" comment block above still only lists the original five lines. Minor doc drift for a file meant to document expected output.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@examples/v2/stdlib_fmt.rv` around lines 1 - 7, The header comment in std_fmt example is out of sync with the actual output from the main example block. Update the “Prints:” list to include the two additional boolean outputs emitted by the new huge.length() checks, keeping the comment aligned with the print calls in the example.stdlib/std/fmt.rv (1)
256-258: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDoc wording drifts from
format_float's actual (non-clamped) behavior.This docstring now says "up to
decimalsdigits", butdocs/v2/guide/stdlib/fmt.md(Line 208) still says "rendered with exactlydecimalsdigits after the decimal point". For the common case (no clamping), the function still pads to exactlydecimalsdigits — "up to" only applies once clamping kicks in for extreme inputs. Align the wording between the two docs so users aren't confused about the normal guarantee vs. the clamped edge case.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@stdlib/std/fmt.rv` around lines 256 - 258, Align the `format_float` documentation in `fmt.rv` with the user guide wording by clarifying the normal behavior versus the clamped edge case. Update the docstring on `format_float` so it still reflects that, for ordinary inputs, `format_float` renders exactly `decimals` digits after the decimal point, while only the extreme-precision case is limited by clamping; keep the wording consistent with the corresponding `format_float` section in the guide.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@examples/v2/stdlib_fmt.rv`:
- Around line 1-7: The header comment in std_fmt example is out of sync with the
actual output from the main example block. Update the “Prints:” list to include
the two additional boolean outputs emitted by the new huge.length() checks,
keeping the comment aligned with the print calls in the example.
In `@stdlib/std/fmt.rv`:
- Around line 256-258: Align the `format_float` documentation in `fmt.rv` with
the user guide wording by clarifying the normal behavior versus the clamped edge
case. Update the docstring on `format_float` so it still reflects that, for
ordinary inputs, `format_float` renders exactly `decimals` digits after the
decimal point, while only the extreme-precision case is limited by clamping;
keep the wording consistent with the corresponding `format_float` section in the
guide.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ffde438d-cf12-4ee1-8884-b2e4e45bf2de
⛔ Files ignored due to path filters (4)
Cargo.lockis excluded by!**/*.lockexamples/v2/random_weighted_choice.rv.outis excluded by!**/*.outexamples/v2/stdlib_fmt.rv.outis excluded by!**/*.outexamples/v2/tls_config_errors.rv.outis excluded by!**/*.out
📒 Files selected for processing (22)
CHANGELOG.mdCargo.tomldocs/v2/guide/standard-library.mddocs/v2/guide/stdlib/fmt.mddocs/v2/guide/stdlib/json.mddocs/v2/guide/stdlib/random.mddocs/v2/guide/stdlib/tls.mddocs/v2/specs/std-json.mddocs/v2/specs/std-tls.mddocs/v2/specs/stdlib-modules.mdexamples/v2/http_server_header_validation.rvexamples/v2/random_weighted_choice.rvexamples/v2/stdlib_fmt.rvexamples/v2/tls_config_errors.rvexamples/v2/use_json.rvmkdocs.ymlstdlib/std/fmt.rvstdlib/std/http.rvstdlib/std/json.rvstdlib/std/random.rvstdlib/std/tls.rvtests/codegen_smoke.rs
Fixes #837.
Fixes #839.
Fixes #840.
Fixes #841.
Fixes #842.
Fixes #843.
Fixes #844.
Fixes #845.
Also records the already-merged base32 padding fix from #838 in the changelog and patch version series.
Summary
std/fmt.format_floatprecision before float scaling overflowsRng.weighted_choiceentries reachable for huge positive weightsstd/tlsin the guide/nav2.19.10Validation
cargo buildcargo test --test codegen_smoke -- --nocapturecargo test --test golden v2_examples_match_golden_baselines -- --nocapturecargo test --test fmt_golden -- --nocapturemkdocs build --strict --site-dir C:\tmp\raven-docs-check\sitecargo fmt --checkcargo clippy --workspace --all-targetscargo test --workspace --verboseSummary by CodeRabbit
New Features
Bug Fixes
\uXXXX.weighted_choiceto avoid overflow/eligibility issues with extreme weights.format_floatnow clamps large precision requests to prevent non-terminating formatting.Tests