build: unblock cargo update + stremio-watched-bitfield base64 0.13 → 0.22#974
build: unblock cargo update + stremio-watched-bitfield base64 0.13 → 0.22#974anikettuli wants to merge 2 commits intoStremio:developmentfrom
Conversation
12 tests in the deep-link module previously asserted byte-for-byte equality of a player URL whose first path segment is a zlib-compressed, base64'd, percent-encoded JSON Stream payload. That made the tests fragile to any flate2 / miniz_oxide output change - different versions emit semantically equivalent but byte-different compressed output, which broke CI on every routine 'cargo update' without any real regression. Replace the byte-equality check with a shared helper that decodes the encoded segment back to a Stream and compares semantically; the URL prefix and the suffix path components are still checked literally, so the frozen URL grammar remains under test. Affected files: - src/unit_tests/deep_links/helpers.rs (new): assert_player_url helper. - src/unit_tests/deep_links/mod.rs: register the helpers module. - src/unit_tests/deep_links/stream_deep_links.rs: 10 assertions. - src/unit_tests/deep_links/meta_item_deep_links.rs: 1 assertion. - src/unit_tests/deep_links/video_deep_links.rs: 1 assertion. Verified locally (Rust 1.85.1 stable-x86_64-pc-windows-gnu): cargo test -p stremio-core --lib -> 202 passed, 0 failed cargo test -p stremio-core --lib deep_links -> 41 passed cargo clippy --all --no-deps -D warnings -> clean cargo fmt --check -> clean
Two bundled maintenance wins unlocked by the previous commit's round-trip deep-link assertions (which no longer break when miniz_oxide changes its compressed-output bytes). 1. cargo update - pulls in the latest compatible patch versions across the workspace (derive_more, itertools, regex, serde, tokio, tracing, url, and many transitive deps). Two deps are pinned back to their last MSRV-1.85-compatible versions: - serde_with / serde_with_macros at 3.12.0 (3.18 requires 1.88) - darling at 0.20.11 (0.23 requires 1.88) These pins can be removed once the workspace MSRV rises past 1.88. 2. stremio-watched-bitfield: base64 0.13.0 (Aug 2021) -> 0.22. This was the last crate in the workspace still on a base64 major from 3+ years ago. The free-function API (decode / encode) was removed in 0.21; migrate to base64::engine::general_purpose::STANDARD via the Engine trait. No runtime behavior change. Wire-format encoding/decoding is identical (STANDARD alphabet matches 0.13's default). All 7 watched-bitfield tests round-trip correctly against the new API. Verified locally (Rust 1.85.1 stable-x86_64-pc-windows-gnu): cargo test -p stremio-core --lib -> 202 passed, 0 failed cargo test -p stremio-watched-bitfield -> 7 passed, 0 failed cargo clippy --all --no-deps -D warnings -> clean cargo fmt --check -> clean
stremio-core-web prebuildPrebuild artifact published by the Paste one of these into Release "@stremio/stremio-core-web": "https://stremio.github.io/stremio-core/stremio-core-web/claude/unblock-cargo-update/stremio-stremio-core-web-0.56.3.tgz"Dev "@stremio/stremio-core-web": "https://stremio.github.io/stremio-core/stremio-core-web/claude/unblock-cargo-update/dev/stremio-stremio-core-web-0.56.3.tgz" |
There was a problem hiding this comment.
Pull request overview
This PR stabilizes deep-link unit tests to be resilient to upstream compression output changes, enabling routine cargo update without spurious failures, and upgrades stremio-watched-bitfield to base64 0.22 (removing the last base64 0.x major in the workspace).
Changes:
- Replace brittle deep-link URL byte-for-byte assertions with semantic round-trip assertions by decoding the
Streampayload. - Upgrade
stremio-watched-bitfieldfrombase64 = "0.13.0"tobase64 = "0.22"and migrate to theEngineAPI. - Refresh
Cargo.lockwith updated dependency resolutions (including MSRV-compatible pins as described).
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
stremio-watched-bitfield/src/bitfield8.rs |
Migrates base64 encode/decode usage to Engine (STANDARD) API. |
stremio-watched-bitfield/Cargo.toml |
Bumps base64 dependency from 0.13.0 to 0.22. |
src/unit_tests/deep_links/helpers.rs |
Adds helper to parse player URLs and assert decoded Stream + suffix. |
src/unit_tests/deep_links/mod.rs |
Registers the new helpers module for deep-link tests. |
src/unit_tests/deep_links/stream_deep_links.rs |
Updates tests to use assert_player_url instead of full string equality. |
src/unit_tests/deep_links/video_deep_links.rs |
Updates player URL assertion to round-trip decode and suffix check. |
src/unit_tests/deep_links/meta_item_deep_links.rs |
Updates player URL assertion similarly for MetaItem deep links. |
Cargo.lock |
Applies the dependency updates from cargo update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
this prs adds no value again, no bug fix no feature addition |
|
the test fix isn't code churn for its own sake as it specifically makes future cargo update runs not break CI on miniz_oxide bumps, and the base64 0.13 dep is 3+ years out of date. |
Summary
Two commits that together unblock routine
cargo updatefrom the workspace without spurious CI breakage, and retire the last remaining base64 major 0.x in the workspace:test:Round-trip deep-link URL assertions instead of byte-comparing. Fixes 12 tests that asserted exact byte equality of a zlib-compressed player URL — which broke on everyminiz_oxide/flate2output change despite no semantic regression.build:Runcargo updateto pull in latest compatible patches, and migratestremio-watched-bitfieldfrombase64 = "0.13.0"(Aug 2021) to0.22.Why this change
Brittle tests
12 tests in
src/unit_tests/deep_links/(acrossstream_deep_links.rs,meta_item_deep_links.rs,video_deep_links.rs) asserted that aStreamDeepLinks::playerURL string equals a specific byte sequence. The first path segment of that URL is azlib-compressed → base64 → percent-encodedJSON payload produced byStream::encode.Different versions of
miniz_oxide(flate2's compression backend) emit the same decompressed bytes through different compressed byte sequences. So:Stream.assert_eq!(sdl.player, "stremio:///player/eAEB...")fails.This made every routine
cargo updatebreak 12 tests. The fix: compare the decoded stream semantically, and keep the URL-grammar suffix under literal assertion.Unblocked
cargo updateWith the brittle tests fixed, we run
cargo updateand pick up ~2 years of accumulated upstream patches:regex,serde,tokio,tracing,url,derive_more,itertools, etc. — 50+ deps updated.serde_with/serde_with_macrosat3.12.0(3.18 needs 1.88)darlingat0.20.11(0.23 needs 1.88)These pins come off the moment the workspace MSRV rises past 1.88.
stremio-watched-bitfieldbase64 upgradestremio-watched-bitfieldwas still onbase64 = "0.13.0"(August 2021). The free-functiondecode(s)/encode(s)API was removed inbase64 0.21in favor of theEnginetrait. Migrating:Wire-format is identical —
STANDARDmatches0.13's default alphabet, so serializedBitField8strings round-trip byte-for-byte between old and new versions. All 7 existing watched-bitfield tests confirm this.Effect
cargo updatenow lands cleanly without any spurious test failures. Dependency drift becomes a no-drama operation.Public contract
Zero changes to:
Msg/Action/EventvariantsBitField8wire format (verified by existing round-trip tests)Test plan
Verified locally (Rust 1.85.1
stable-x86_64-pc-windows-gnu):cargo test -p stremio-core --lib— 202 passed, 0 failedcargo test -p stremio-core --lib unit_tests::deep_links— 41 passedcargo test -p stremio-watched-bitfield— 7 passed, 0 failedcargo clippy --all --no-deps -- -D warnings— cleancargo fmt --check— cleanDependency on other PRs
serde_with/darlingreference MSRV 1.85 which is already on stable; if MSRV ever bumps past 1.88, those pins come off in a one-line follow-up.