Fix CI: Build (npm + lockfile) and Rust CI (rustfmt + clippy on stable 1.96)#160
Open
PierreFouquet wants to merge 2 commits into
Open
Conversation
The Docker `app` stage installed `nodejs` but not `npm`, then ran `npm ci` — failing with exit 127 (command not found). With npm added it then failed `npm ci` (EUSAGE) because the stage copied only `index.js package.json`, omitting the committed `package-lock.json`. Both were latent: before the libilbc submodule checkout fix (already merged) the build never reached the app stage. A local `docker build --target app` now completes end-to-end (npm ci: "added 1 package, audited 2 packages"). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CI's dtolnay/rust-toolchain@stable now resolves to rustc 1.96.0, whose rustfmt expands one single-line fn body in codec.rs and whose clippy (the crate sets `#![deny(clippy::all)]`) reports 29 findings. On main rustfmt fails first, masking the clippy step — so a fmt-only fix would still leave Rust CI red. - rustfmt: cargo fmt --all. - clippy (mechanical, auto-applied): io_other_error, manual_is_multiple_of, useless_vec, needless_borrow, bool_comparison, collapsible_if, collapsible_match, manual_pattern_char_comparison, unnecessary_cast. - clippy (hand-fixed): unnecessary_unwrap, manual_unwrap_or_default, manual_checked_ops, type_complexity, suspicious_open_options (.truncate(false) preserves the append behavior), field_reassign_with_default (tests), enum_variant_names (Event::TelephoneEvent -> Telephone; JS event string "telephone-event" is a separate literal, unchanged). - large_enum_variant on the internal `Mode` enum is #[allow]'d with a rationale: `Local` is the common variant, so boxing it to satisfy the lint would add a hot-path indirection. All changes are behavior-preserving; the DTMF decoder logic is byte-for- byte unchanged. Verified in a container on rustc 1.96.0 with libilbc + libspandsp: cargo fmt --all --check, clippy --all-targets --locked -- -D warnings, and cargo test --lib --locked (77 passed) all green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Fixes the remaining CI failures on
main. Both Build and Rust CI have been red; this PR addresses the failures that surfaced after the already-merged libilbc submodule-checkout fix. Combined into one PR because the failures were interlocked — each was masking the next, so only fixing both turnsmaingreen.Both checks pass on this branch: Build (incl. emulated linux/arm64) and Rust CI.
Commit 1 — Build (Dockerfile app stage)
Two latent bugs, never reached before because the build died earlier:
npm cifailed with exit 127 — theappstage installednodejsbut notnpm.npm cithen failed EUSAGE — the stage copied onlyindex.js package.json, omitting the committedpackage-lock.json.Fix: add
npmto the app-stageapk add, and copypackage-lock.json.Verified:
docker build --target appcompletes end-to-end (npm ci: "added 1 package, audited 2 packages").Commit 2 — Rust CI (rustfmt + clippy)
CI's
dtolnay/rust-toolchain@stablenow resolves to rustc 1.96.0. Onmain, rustfmt fails first, masking clippy — so a fmt-only fix would still leave Rust CI red at clippy (the crate sets#![deny(clippy::all)], 29 findings).cargo fmt --all(one single-line fn body in codec.rs under 1.96).unnecessary_unwrap,manual_unwrap_or_default,manual_checked_ops,type_complexity,suspicious_open_options,field_reassign_with_default(tests), andenum_variant_names(Event::TelephoneEvent→Telephone).large_enum_varianton the internalModeenum is#[allow]'d with a rationale rather than boxed —Localis the hot/common variant, so boxing it would add a per-tick heap indirection.Behavioral safety
All changes are behavior-preserving. Every hunk was audited; notably:
dtmf.rsDtmfReceiver) is byte-for-byte unchanged (only a test-local type alias) — the real-world provider tuning is intact.Event::TelephoneEvent→Telephoneis internal only; the JS event string"telephone-event"is a separate literal.suspicious_open_optionsadds.truncate(false), which is the prior default — append semantics preserved.if→match-guard conversion was traced by hand: the_ => {}arm is a no-op, so control flow is identical.Validation
On the real CI toolchain (rustc 1.96.0, with
libilbc+libspandsp):cargo fmt --all -- --checkcargo clippy --all-targets --locked -- -D warningscargo test --lib --locked(77 passed)docker build --target app🤖 Generated with Claude Code