Skip to content

fix(ci): lint media tests with default features - #7817

Merged
kixelated merged 4 commits into
mainfrom
quest/m0/ci/default-feature-test-lint
Nov 4, 2026
Merged

kixelated merged 4 commits into
mainfrom
quest/m0/ci/default-feature-test-lint

Conversation

@kixelated

@kixelated kixelated commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

cargo clippy --locked -p moq-audio --tests -- -D warnings fails on main because retains and fail compile under test, while their only callers require capture. The gate enables capture, so it misses the default-feature failure. moq-dev/moq#7786 adds test-target coverage but keeps those feature picks.

Approach

  • Gate the two methods on capture alone. Audited the comparable audio/video cfgs, including test-first and multiline forms; the remaining test allowances have callers in those configurations.
  • Add just rs media-defaults: clippy over audio/video --tests with their default features, isolated from dependents that could enable capture. The gate's lint phase runs it once when either media crate is selected. Unrelated selections skip it; the device-feature test build stays unchanged.
  • Extend the selector tests and update the gate comments. Remove the completed quest and its link.

Compile cost

Measured inside the Nix shell through quest gate, with the normal shared compiler cache and dependencies available. Source-edit probes added a temporary comment, rather than relying on a timestamp-only rebuild.

Default-media lint Wall User + system CPU
Unchanged 0.51 s 0.49 s
Audio/video source edits 2.23 s 3.73 s
Core dependency source edit (moq-net) 12.09 s 13.19 s

These are cached local edit-loop measurements, not an uncached CI benchmark. The extra work is a scoped metadata-only compile; it does not link or rerun tests, or add a second workspace test build. That measured cost is small enough to include directly rather than adding a source-pattern lint or broadening the feature matrix.

Impact

  • Public API and wire: none.
  • CI: selected media changes and their dependencies now fail on default-feature test warnings, even when capture makes the main test build pass.

Alternatives

  • A syntax lint cannot reliably decide whether a cfg-gated method has callers; a rule forbidding any(feature, test) would reject valid existing test coverage.
  • Removing capture from the main build would lose the device tests. A second complete feature matrix or test build adds unnecessary work.
  • Chose the existing lint phase for the isolated compile, after its dependency metadata is available, instead of compiling either media crate's dependents with it.

Validation

  • Reproduced the exact default-feature clippy failure on the base; the same command passes with the fix.
  • Temporarily restored the original cfgs: just rs media-defaults rejects them with the two dead-code errors; restoring the fix passes.
  • python3 sh/rs/select.test.py: all 25 tests pass. quest check --base origin/main passes.
  • Final just ci: exits 1 solely for the two reproduced environment failures below. All other selected modules pass, including 11,641 Rust tests (133 skipped), Rust lint/docs, selector/tooling tests, JavaScript tests, Python, C/C++, Kotlin, Go, and Dart. No full strict-gate pass is claimed.
  • Pre-existing host failures, reproduced without changing the harness:
    • Runner image: nix develop --command quest gate nix flake check --print-build-logs in a detached base checkout at 00a3c57dca fails on the identical k6j6qw86x77lz6dnl2wqbxi86cjy31yw-github-runner.drv, with unshare: write failed /proc/self/uid_map: Operation not permitted.
    • CARLA launcher: nix develop --command quest gate bash .tmp/base/demo/carla/sim/python.test.sh, running unchanged base scripts with this session's environment, fails with the same expected |/gcc/lib:/existing versus Nix snapshot paths. Running from the detached checkout without that checkout's snapshot passes. This is the existing BASH_ENV environment override, also recorded in moq-dev/moq#7802 and moq-dev/moq#7798.

Review

Claude Code, Claude Opus 5.5 (claude-opus-5-5), medium effort, local quest review round 2: no findings on head 7e247bebf5 against origin/main at 4506e3fdc5.

Round 1's compile-cost finding was refuted with the measurement logs, the final full-gate timings, and the actual test callers of the remaining cfg allowances. The reviewer accepted that evidence in round 2. The source head is unchanged between rounds.

Follow-ups

  • Restore developer-host Nix builder user-namespace mappings before claiming a strict flake pass; no gate or host-policy workaround is included.
  • The existing Codex environment snapshot quest owns the launcher environment override. No new follow-up quest is needed for it.

(Written by GPT-6.1 Sol)

@kixelated kixelated changed the title moq-audio's default-feature test build is clippy-clean and gated fix(audio): gate default-feature test lints Nov 4, 2026
kixelated and others added 3 commits November 3, 2026 21:28
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>
@kixelated kixelated changed the title fix(audio): gate default-feature test lints fix(ci): lint media tests with default features Nov 4, 2026
@kixelated
kixelated marked this pull request as ready for review November 4, 2026 05:46

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed head 7e247be. I found no actionable issue in the cfg corrections or the isolated default-feature media lint. The gate selects the lint when either media crate is affected, while its existing device-feature test build remains intact.

Verification: GitHub-only static review of the changed methods, selector, recipe and tests. I did not run clippy, the selector tests, or the full gate; the PR records its host-specific validation failures.

(Written by review (OpenAI))

@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The audio producer methods retains and fail are now gated only by the capture feature. A new Rust recipe runs Clippy on default-feature audio and video test targets. The Rust lint selector invokes that recipe for selected audio or video crates. Tests verify recipe selection across crate, lockfile, and execution-mode cases. Related comments and planning documentation were updated or removed.

Merge Risk: Minimal · up to 7e247

The change adds default-feature media lint coverage while preserving the existing device-feature build. No actionable merge-blocking risk remains after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "fix(ci): lint media tests with default features" matches the main change. The PR gates retains and fail on capture only and adds a just rs media-defaults recipe that runs Clippy on …
Description check Passed The description states the problem (the default-feature cargo clippy failure on main involving retains and fail), the approach (feature gating, the new just rs media-defaults recipe, and sel…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(ci): lint media tests with default features" matches the main change. The PR gates retains and fail on capture only and adds a just rs media-defaults recipe that runs Clippy on moq-audio and moq-video tests with default features, wired into the CI lint phase. The title is concise and specific, and a teammate scanning history would understand the primary change.

Full details: Description check

Explanation

The description states the problem (the default-feature cargo clippy failure on main involving retains and fail), the approach (feature gating, the new just rs media-defaults recipe, and selector and comment updates), validation steps, and follow-ups. It is directly related to the changeset.

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 4 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Simplify code
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0cf1c37a-c26a-4fda-aff5-ce854e7face4
Commits

Reviewing files that changed from the base of the PR and between 00a3c57 and 7e247be.

Files selected for processing: 8
  • justfile
  • quest/m0/ci/README.md
  • quest/m0/ci/default-feature-test-lint.md
  • rs/justfile
  • rs/moq-audio/src/encode/producer.rs
  • sh/dispatch.sh
  • sh/rs/select.sh
  • sh/rs/select.test.py
Files with no reviewable changes: 1
  • quest/m0/ci/default-feature-test-lint.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Dead-code cfg fix — Producer::retains and fail now gate on capture alone, matching their only callers in encode/capture.rs; the remaining cfg(any(feature = "capture", test)) items in moq-audio/moq-video were checked and do have test callers.
  • Isolated default-media lint — new just rs media-defaults runs clippy over moq-audio and moq-video --tests with default features, invoked once by select.sh lint when either crate is selected. Explicit -p flags keep selected dependents' capture feature from unifying back in; the device-feature test build is unchanged.
  • Docs and tests — gate comments updated, selector tests extended to cover the trigger, one-shot, non-media, and test-action cases; the completed quest file and its README link are removed with no dangling references.

I independently ran the exact clippy configuration after working around this environment's known libspa/PipeWire gap; it passes with the new cfgs. The selector SelectTest cases pass (the remaining fixture failures here are the known sudo prlimit and missing-just environment issues). No public API or wire impact.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit 882820e Nov 4, 2026
10 of 11 checks passed
@kixelated
kixelated deleted the quest/m0/ci/default-feature-test-lint branch November 4, 2026 07:24
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