Skip to content

[codex] Route HLS CLI import through moq-hls#1939

Open
kixelated wants to merge 3 commits into
mainfrom
codex/hls-cli-moq-hls
Open

[codex] Route HLS CLI import through moq-hls#1939
kixelated wants to merge 3 commits into
mainfrom
codex/hls-cli-moq-hls

Conversation

@kixelated

@kixelated kixelated commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • restore moq-cli publish hls --playlist ... as a thin wrapper around moq-hls::import
  • add moq-cli hls import and moq-cli hls export so the old HLS binary's import/export functionality lives under moq-cli
  • remove the standalone moq-hls binary target and trim binary-only optional dependencies from the moq-hls library crate
  • remove the stale moq-mux HLS importer source and docs references that made HLS look owned by moq-mux
  • update demo/docs references to use the consolidated moq-cli HLS surface

Why

HLS now lives in the moq-hls library crate, but moq-cli should be the user-facing binary for common protocol/container workflows. This keeps the HLS implementation reusable while avoiding a separate installed binary for HLS.

Validation

  • direnv exec . just fix
  • direnv exec . cargo check -p moq-cli
  • direnv exec . cargo check -p moq-hls --no-default-features
  • direnv exec . cargo run -q --bin moq-cli -- publish --help
  • direnv exec . cargo run -q --bin moq-cli -- publish hls --help
  • direnv exec . cargo run -q --bin moq-cli -- hls --help
  • direnv exec . cargo run -q --bin moq-cli -- hls import --help
  • direnv exec . cargo run -q --bin moq-cli -- hls export --help
  • git diff --check

(Written by Claude)

@kixelated kixelated marked this pull request as ready for review June 29, 2026 00:06

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The PR adds moq-hls as a workspace dependency, updates moq-cli with HLS import and export command handling, and removes the standalone moq-hls binary target. It also updates the demo HLS recipe and revises documentation and references to reflect the split between moq-mux formats and HLS handling.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main change: routing HLS CLI import through moq-hls.
Description check ✅ Passed The description is clearly related and accurately summarizes the HLS CLI, docs, and dependency changes.
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.
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/hls-cli-moq-hls

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@rs/moq-cli/src/publish.rs`:
- Around line 9-13: The top-level help text for the `publish` and `serve`
commands is still describing stdin-only input, which conflicts with the new
`Hls`/`playlist` path in `publish.rs`. Update the command descriptions in
`main.rs` where the CLI help is defined so they mention both stdin and the HLS
playlist input path, and make sure the `publish`/`serve` wording matches the new
`Hls { playlist }` option exposed by `moq-cli`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d52af98a-9ffa-42fd-8e6e-ec21463a0ba5

📥 Commits

Reviewing files that changed from the base of the PR and between 404ec17 and 92f3bf7.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (18)
  • .taplo.toml
  • Cargo.toml
  • demo/pub/justfile
  • doc/bin/cli.md
  • doc/index.md
  • doc/lib/index.md
  • doc/lib/rs/crate/hang.md
  • doc/lib/rs/crate/index.md
  • doc/lib/rs/crate/moq-mux.md
  • doc/lib/rs/index.md
  • js/CLAUDE.md
  • js/watch/README.md
  • rs/CLAUDE.md
  • rs/hang/README.md
  • rs/moq-cli/Cargo.toml
  • rs/moq-cli/src/publish.rs
  • rs/moq-mux/README.md
  • rs/moq-mux/src/container/hls/import.rs
💤 Files with no reviewable changes (1)
  • rs/moq-mux/src/container/hls/import.rs

Comment thread rs/moq-cli/src/publish.rs
Comment on lines +9 to +13
/// HLS playlist import.
Hls {
/// Remote HLS playlist URL (http/https) or local file path.
#[arg(long)]
playlist: String,

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update the top-level publish/serve help text.

This adds a non-stdin input path, but rs/moq-cli/src/main.rs:33-84 still describes both commands as reading from stdin. That makes --help misleading for hls --playlist ....

🤖 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 `@rs/moq-cli/src/publish.rs` around lines 9 - 13, The top-level help text for
the `publish` and `serve` commands is still describing stdin-only input, which
conflicts with the new `Hls`/`playlist` path in `publish.rs`. Update the command
descriptions in `main.rs` where the CLI help is defined so they mention both
stdin and the HLS playlist input path, and make sure the `publish`/`serve`
wording matches the new `Hls { playlist }` option exposed by `moq-cli`.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
doc/bin/cli.md (1)

142-145: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Note that hls does not read stdin.

This section says publish formats read from stdin unless noted, but publish hls --playlist ... never consumes stdin. Add the same kind of exception note you already use for capture so the list matches the actual behavior in rs/moq-cli/src/publish.rs:125-148.

Suggested change
-- `hls --playlist <url-or-path>` - HLS playlist ingest
+- `hls --playlist <url-or-path>` - HLS playlist ingest (does not read stdin)
🤖 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 `@doc/bin/cli.md` around lines 142 - 145, Update the publish formats list so it
explicitly notes that hls does not read stdin, matching the actual behavior in
publish.rs. Add the same style of exception note used for capture to the hls
entry in cli.md, and keep the wording consistent with the existing format
descriptions so readers can see which publish modes consume stdin and which do
not.
🧹 Nitpick comments (1)
rs/moq-cli/src/main.rs (1)

131-132: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Keep HlsCommand private.

This enum is only consumed inside rs/moq-cli/src/main.rs, so pub needlessly expands the binary crate's API surface. Making it private also avoids exposing a newly undocumented public symbol. As per coding guidelines, "Document every exported public API symbol" and "Before exposing a new public type ... prefer smaller, more future-proof API shapes."

Suggested change
- pub enum HlsCommand {
+ enum HlsCommand {
🤖 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 `@rs/moq-cli/src/main.rs` around lines 131 - 132, The HlsCommand enum is
unnecessarily public and should be kept private since it is only used within
main.rs. Remove the pub visibility from HlsCommand so the binary crate does not
expose an undocumented API surface, and keep the change localized to the
HlsCommand declaration and its internal uses in main.

Source: Coding guidelines

🤖 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.

Inline comments:
In `@rs/moq-cli/src/main.rs`:
- Around line 136-137: The HLS listener binding currently relies on the raw
SocketAddr default, which can behave IPv6-only on Windows when set to [::]:8089.
Update the listener setup in main.rs to use the dual-stack helper from
moq_native::bind::tcp instead of direct TcpListener::bind for the HLS endpoint,
so the existing listen option in the CLI continues to work for both IPv4 and
IPv6.

In `@rs/moq-hls/Cargo.toml`:
- Around line 22-24: The dependency declaration for anyhow in this workspace
crate is hard-coded instead of using the shared workspace pin. Update the
Cargo.toml entry for anyhow under the [dependencies] section to reference the
workspace dependency source of truth with { workspace = true } rather than
specifying its own version/features, and keep the change aligned with the
crate’s existing dependency usage.

---

Outside diff comments:
In `@doc/bin/cli.md`:
- Around line 142-145: Update the publish formats list so it explicitly notes
that hls does not read stdin, matching the actual behavior in publish.rs. Add
the same style of exception note used for capture to the hls entry in cli.md,
and keep the wording consistent with the existing format descriptions so readers
can see which publish modes consume stdin and which do not.

---

Nitpick comments:
In `@rs/moq-cli/src/main.rs`:
- Around line 131-132: The HlsCommand enum is unnecessarily public and should be
kept private since it is only used within main.rs. Remove the pub visibility
from HlsCommand so the binary crate does not expose an undocumented API surface,
and keep the change localized to the HlsCommand declaration and its internal
uses in main.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 41191904-0054-46d5-91ca-77678819d77e

📥 Commits

Reviewing files that changed from the base of the PR and between 92f3bf7 and 005b177.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • doc/bin/cli.md
  • rs/moq-cli/Cargo.toml
  • rs/moq-cli/src/main.rs
  • rs/moq-hls/Cargo.toml
  • rs/moq-hls/bin/moq-hls.rs
  • rs/moq-rtmp/README.md
  • rs/moq-rtmp/bin/moq-rtmp.rs
  • rs/moq-rtmp/src/lib.rs
  • rs/moq-srt/README.md
  • rs/moq-srt/bin/moq-srt.rs
  • rs/moq-srt/src/lib.rs
💤 Files with no reviewable changes (1)
  • rs/moq-hls/bin/moq-hls.rs
✅ Files skipped from review due to trivial changes (6)
  • rs/moq-srt/src/lib.rs
  • rs/moq-cli/Cargo.toml
  • rs/moq-srt/bin/moq-srt.rs
  • rs/moq-rtmp/src/lib.rs
  • rs/moq-rtmp/bin/moq-rtmp.rs
  • rs/moq-srt/README.md

Comment thread rs/moq-cli/src/main.rs
Comment on lines +136 to +137
#[arg(long, env = "MOQ_HLS_LISTEN", default_value = "[::]:8089")]
listen: SocketAddr,

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Bind the HLS listener with the dual-stack helper.
std::net::TcpListener::bind on [::]:8089 is IPv6-only on Windows, so the default HLS endpoint won’t accept IPv4 there. Use moq_native::bind::tcp here as well.

🤖 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 `@rs/moq-cli/src/main.rs` around lines 136 - 137, The HLS listener binding
currently relies on the raw SocketAddr default, which can behave IPv6-only on
Windows when set to [::]:8089. Update the listener setup in main.rs to use the
dual-stack helper from moq_native::bind::tcp instead of direct TcpListener::bind
for the HLS endpoint, so the existing listen option in the CLI continues to work
for both IPv4 and IPv6.

Comment thread rs/moq-hls/Cargo.toml
Comment on lines 22 to 24
[dependencies]
# Always required (import + export library).
anyhow = { version = "1", features = ["backtrace"] }

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.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Use the workspace pin for anyhow.

Line 24 hard-codes anyhow in a workspace crate, which bypasses the repo-wide dependency source of truth. This should be consumed via { workspace = true } instead.

Suggested change
-anyhow = { version = "1", features = ["backtrace"] }
+anyhow = { workspace = true, features = ["backtrace"] }

As per coding guidelines, "Workspace crates must add shared dependencies and version/path pins under [workspace.dependencies], and new crates should reference them with { workspace = true } instead of declaring their own versions."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[dependencies]
# Always required (import + export library).
anyhow = { version = "1", features = ["backtrace"] }
[dependencies]
# Always required (import + export library).
anyhow = { workspace = true, features = ["backtrace"] }
🤖 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 `@rs/moq-hls/Cargo.toml` around lines 22 - 24, The dependency declaration for
anyhow in this workspace crate is hard-coded instead of using the shared
workspace pin. Update the Cargo.toml entry for anyhow under the [dependencies]
section to reference the workspace dependency source of truth with { workspace =
true } rather than specifying its own version/features, and keep the change
aligned with the crate’s existing dependency usage.

Source: Coding guidelines

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