Skip to content

feat: expose moq-relay as library#1121

Merged
kixelated merged 3 commits intomoq-dev:mainfrom
Frando:feat/relay-lib
Mar 26, 2026
Merged

feat: expose moq-relay as library#1121
kixelated merged 3 commits intomoq-dev:mainfrom
Frando:feat/relay-lib

Conversation

@Frando
Copy link
Copy Markdown
Contributor

@Frando Frando commented Mar 16, 2026

Allows to embed a moq-relay into other binaries. Exposes all things needed to run this embedded in another app.

Doc comments for public items written by Claude, I did a review and couldn't spot anything wrong, but maybe you want to review them yourself once more.

@Frando Frando marked this pull request as draft March 16, 2026 23:15
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 16, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b77f31df-e155-480c-8728-f0b884076e73

📥 Commits

Reviewing files that changed from the base of the PR and between 24f76ab and c271b8c.

📒 Files selected for processing (5)
  • justfile
  • rs/moq-relay/src/auth.rs
  • rs/moq-relay/src/cluster.rs
  • rs/moq-relay/src/config.rs
  • rs/moq-relay/src/web.rs

Walkthrough

This PR refactors rs/moq-relay into an embeddable crate by adding src/lib.rs that declares submodules, re-exports public items, and introduces pub const DEFAULT_MAX_STREAMS: u64 = 10_000. main.rs now imports the crate via use moq_relay::*;. Public items across auth.rs, cluster.rs, config.rs, connection.rs, and web.rs gained Rustdoc comments and several structs were marked #[non_exhaustive]. A Cargo feature noq = ["moq-native/noq"] was added. justfile recipes had --quiet removed from several cargo commands.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: exposing moq-relay as an embeddable library by creating lib.rs and reorganizing modules.
Description check ✅ Passed The description is related to the changeset, explaining that it allows embedding moq-relay into other binaries and that doc comments were added.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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 and usage tips.

@Frando Frando marked this pull request as ready for review March 26, 2026 10:26
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@rs/moq-relay/src/web.rs`:
- Line 81: The public Rustdoc comment "Run a HTTP server using Axum" has a
grammar issue; update the doc comment above the HTTP server entrypoint (the
Rustdoc for the function that starts the server in web.rs) to use correct
wording such as "Runs an HTTP server using Axum" or "Run an HTTP server using
Axum" (use "an HTTP server") so the public-facing documentation is grammatically
correct.
🪄 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: 54bf9888-6e4b-4ff4-ae10-9e908f4d794c

📥 Commits

Reviewing files that changed from the base of the PR and between 4ddd4b0 and 24f76ab.

📒 Files selected for processing (8)
  • rs/moq-relay/Cargo.toml
  • rs/moq-relay/src/auth.rs
  • rs/moq-relay/src/cluster.rs
  • rs/moq-relay/src/config.rs
  • rs/moq-relay/src/connection.rs
  • rs/moq-relay/src/lib.rs
  • rs/moq-relay/src/main.rs
  • rs/moq-relay/src/web.rs

Comment thread rs/moq-relay/src/web.rs
}

// Run a HTTP server using Axum
/// Run a HTTP server using Axum
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.

⚠️ Potential issue | 🟡 Minor

Fix grammar in public Rustdoc.

Line 81 should use “an HTTP server” (or “Runs an HTTP server”) for correct public-facing docs.

Suggested wording tweak
-/// Run a HTTP server using Axum
+/// Runs an HTTP server using Axum.
📝 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
/// Run a HTTP server using Axum
/// Runs an HTTP server using Axum.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rs/moq-relay/src/web.rs` at line 81, The public Rustdoc comment "Run a HTTP
server using Axum" has a grammar issue; update the doc comment above the HTTP
server entrypoint (the Rustdoc for the function that starts the server in
web.rs) to use correct wording such as "Runs an HTTP server using Axum" or "Run
an HTTP server using Axum" (use "an HTTP server") so the public-facing
documentation is grammatically correct.

… cargo commands

Mark all public config structs in moq-relay as non_exhaustive so new
fields can be added without a semver-breaking change. Remove --quiet
from cargo commands in the justfile for better CI debuggability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kixelated kixelated enabled auto-merge (squash) March 26, 2026 21:44
@kixelated kixelated disabled auto-merge March 26, 2026 21:45
@kixelated kixelated merged commit 7722ef4 into moq-dev:main Mar 26, 2026
1 of 2 checks passed
This was referenced Mar 26, 2026
kixelated added a commit that referenced this pull request Mar 27, 2026
Co-authored-by: Luke Curley <kixelated@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
phoewass pushed a commit to phoewass/moq that referenced this pull request Apr 3, 2026
Co-authored-by: Luke Curley <kixelated@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants