Skip to content

Fix CI: Build (npm + lockfile) and Rust CI (rustfmt + clippy on stable 1.96)#160

Open
PierreFouquet wants to merge 2 commits into
babblevoice:mainfrom
PierreFouquet:fix-ci-build-npm-lockfile-and-rust-clippy
Open

Fix CI: Build (npm + lockfile) and Rust CI (rustfmt + clippy on stable 1.96)#160
PierreFouquet wants to merge 2 commits into
babblevoice:mainfrom
PierreFouquet:fix-ci-build-npm-lockfile-and-rust-clippy

Conversation

@PierreFouquet

@PierreFouquet PierreFouquet commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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 turns main green.

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 ci failed with exit 127 — the app stage installed nodejs but not npm.
  • With npm present, npm ci then failed EUSAGE — the stage copied only index.js package.json, omitting the committed package-lock.json.

Fix: add npm to the app-stage apk add, and copy package-lock.json.
Verified: docker build --target app completes end-to-end (npm ci: "added 1 package, audited 2 packages").

Commit 2 — Rust CI (rustfmt + clippy)

CI's dtolnay/rust-toolchain@stable now resolves to rustc 1.96.0. On main, 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).

  • rustfmt: cargo fmt --all (one single-line fn body in codec.rs under 1.96).
  • clippy: auto-fixed the mechanical lints; hand-fixed unnecessary_unwrap, manual_unwrap_or_default, manual_checked_ops, type_complexity, suspicious_open_options, field_reassign_with_default (tests), and enum_variant_names (Event::TelephoneEventTelephone).
  • large_enum_variant on the internal Mode enum is #[allow]'d with a rationale rather than boxed — Local is 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:

  • The DTMF decoder logic (dtmf.rs DtmfReceiver) is byte-for-byte unchanged (only a test-local type alias) — the real-world provider tuning is intact.
  • Event::TelephoneEventTelephone is internal only; the JS event string "telephone-event" is a separate literal.
  • suspicious_open_options adds .truncate(false), which is the prior default — append semantics preserved.
  • The stun.rs 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 -- --check
  • cargo clippy --all-targets --locked -- -D warnings
  • cargo test --lib --locked (77 passed)
  • docker build --target app

🤖 Generated with Claude Code

Pierre Fouquet and others added 2 commits June 9, 2026 15:29
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>
@PierreFouquet PierreFouquet marked this pull request as ready for review June 9, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant