Skip to content

feat(relay)!: cluster peers lose the egress field - #9387

Merged
kixelated merged 6 commits into
mainfrom
quest/m2/relay-peer-egress
Nov 23, 2026
Merged

kixelated merged 6 commits into
mainfrom
quest/m2/relay-peer-egress

Conversation

@kixelated

@kixelated kixelated commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Closes the quest quest/m2/relay-peer-egress.md.

Problem

A moq-relay cluster peer (cluster.connect, --cluster-connect, or an cluster.api.url response) accepted an egress field. Since moq-dev/moq#8023 its only behavior was an error unless it equalled cost, "until asymmetric routing lands", and nothing plans asymmetric routing. The maintainer decided on 2026-11-21 to remove it before 0.22 ships main's version.

Approach

  • Remove egress from cluster::Peer, its object deserializer, serializer, and Debug, along with the egress-vs-cost check in DialTarget::from_peer.
  • Drop it from the docs: Peer, Config::connect, api::Config::url, and doc/bin/relay/config.md.
  • Replace the two egress tests with one that checks a peer object still setting egress is refused. Tests that used with_egress to build an invalid or round-trip peer now use other inputs.
  • Delete the quest and remove its links from quest/m2/README.md and quest/m1/lite07-routing/README.md.

Impact

  • Breaking (Rust API): moq_relay::cluster::Peer::egress() and Peer::with_egress() are removed. Migration: drop the calls. A symmetric value never changed anything.
  • Breaking (config / peer API): a peer object with egress is now refused as an unknown field, both at startup and in an api.url response. When the API response is invalid, the relay keeps its last good list. Migration: delete egress from peer objects. Any value that was accepted before equalled cost, so routing does not change.
  • Wire: none.

Alternatives

  • Keep egress as a reserved field that is accepted and ignored. The maintainer rejected this when planning the quest.

Validation

  • cargo test -p moq-relay --lib -- peer cluster_connect zero_cost malformed_object: 35 passed, including the new peer_egress_field_is_refused.
  • just check (whole-branch selection) passed.
  • Ran the built binary target/debug/moq-relay <config> on a config with connect = [{ url = "https://b.example/", cost = 2, egress = 2 }]. It exits 1 with unknown field 'egress', expected one of 'url', 'cost', 'token', 'upstream' in 'cluster.connect'. The same peer without egress gets past config parsing and stops later only because the test config has no TLS cert.
  • After merging main (a conflict in quest/m2/README.md, where main had also dropped the finished origin-proxy-config link): cargo clippy -p moq-relay --all-targets -D warnings passes and cargo nextest run -p moq-relay --lib passes 336/336.

Choices for review

  • Removed the egress-only case from zero_cost_peer_errors rather than rewriting it, since egress = 0 is now an unknown-field error that a parse test already covers.
  • malformed_object_peer_list_preserves_current_dial now uses a different invalid object, one that sets object cost while its URL also carries ?cost=. It still checks that an invalid list keeps the last good dials.

Follow-ups

None.

Models

Size: XS
Implementer: Claude Code, claude-opus-5-5, unknown effort (arm B)
Implementer: Claude Code, claude-opus-5-5, unknown effort (iterate, M)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: 5027133, named in full once no reviewer reports a finding

  • Base: origin/main at 1fd8509

  • Risk: high, It removes the `egress` config/API key and the public `cluster::Peer::egress` and `with_egress` items from moq-relay, so any cluster config or Rust caller still setting `egress` now fails as an unknown field, and a revert restores it cleanly, but a config that has already been deployed or released would break on upgrade.

  • Classified: high by Claude Code, claude-haiku-5-5, low effort, session c58e4101-a13f-4c0c-9004-c25271d4caf6

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a205e4-17f4-7c33-a6b1-2ee762eb2f92, round 1

  • Score: 9/10, The removal consistently updates API, configuration, serialization, validation, tests, and documentation with no actionable defects found, though builds and tests were not run as instructed.

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

  • Reviewer: Claude Code, claude-sonnet-5-5, medium effort, second

  • Session: eec010e4-f165-4845-bd6b-5734a0985003, round 1

  • Score: 8/10, The removal of `egress` is clean and nothing stale references it, but the refusal is weakly tested and the breaking-change migration note was lost.

  • Rounds: 1; first round 3 (low 3); findings 3 (low 3): fixed 0, refuted 0, open 3

  • Findings, open until the next round settles them:

    • Low, rs/moq-relay/src/cluster.rs:4145: Test does not pin that `egress` is refused as an unknown field
    • Low, quest/m2/README.md:16: Migration note for removed `egress` lost with the deleted quest file
    • Low, rs/moq-relay/src/cluster.rs:296: Mixed-policy error text narrowed and reworded

Head 5027133 settles the second reviewer's round 1, all refuted with no change:

  • cluster.rs:4145, refuted: expect_err fails the test if egress were ignored, and the TOML and api.url paths deserialize the same Peer (the built-binary run under Validation shows the TOML path refusing it).
  • quest/m2/README.md:16, refuted: the migration note lives in this PR's Impact section, under a ! title, where the release cut reads it.
  • cluster.rs:296, refuted: a wording change of an error no code matches; errors are never matched on.

kixelated and others added 3 commits November 22, 2026 00:24
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Cluster peers in moq-relay lose the egress field feat(relay)!: cluster peers lose the egress field Nov 22, 2026
@kixelated
kixelated marked this pull request as ready for review November 22, 2026 08:46
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 45 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

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: e8c35b20-fbcf-4181-95e2-4970331e7447
Commits

Reviewing files that changed from the base of the PR and between 1fd8509 and 5027133.

Files selected for processing: 6

  • doc/bin/relay/config.md
  • quest/m1/lite07-routing/README.md
  • quest/m2/README.md
  • quest/m2/relay-peer-egress.md
  • rs/moq-relay/src/cluster.rs
  • rs/moq-relay/src/cluster/api.rs
  • 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

@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 critical issues — one minor test suggestion inline.

Approach: sound. It deletes a field whose only remaining behavior was an error, and it relies on PeerObject already rejecting unknown fields. That way a stale config fails loudly and isn't silently ignored.

Reviewed changes

The review covered the whole PR: the code, tests, docs, and quest bookkeeping for dropping egress from cluster peers.

  • Peer API: egress(), with_egress(), and the stored field are removed. The deserializer, serializer, Debug, and the expecting message are updated to match.
  • DialTarget::from_peer: the egress-vs-cost and egress-zero checks are gone, and the error messages now mention only cost.
  • Docs: the Peer, Config::connect, and api::Config::url doc comments and doc/bin/relay/config.md no longer list egress. No other references to the peer field remain in the repo. The egress wording in the drafts describes the wire cost parameter, so those lines are unaffected.
  • Tests: the two egress tests become one unknown-field refusal test. The malformed-list test now uses a peer that sets cost both in the object and in the URL's ?cost=.
  • Quests: the finished relay-peer-egress quest and its links are removed.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread rs/moq-relay/src/cluster.rs Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pullfrog[bot]
pullfrog Bot previously approved these changes Nov 22, 2026

@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

Reviewed the one commit added since the prior pullfrog review.

  • Test assertion: peer_egress_field_is_refused now asserts the parse error names egress, which addresses the earlier suggestion.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

…gress

# Conflicts:
#	rs/moq-relay/src/cluster.rs
pullfrog[bot]
pullfrog Bot previously approved these changes Nov 22, 2026

@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

The only commit since the last Pullfrog review merges origin/main.

  • Merge of main into DialTarget::from_peer: main changed how tokens are handled. The token is now stored as DialTarget.token instead of being appended to the URL as ?jwt=, and an inline ?jwt= is always stripped. The merge keeps the egress removal intact, and no peer.egress references remain.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 22, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 22, 2026
@moq-bot

moq-bot Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

quest land watch: the merge queue removed this pull request at 7382fa3 because it conflicts with main (merge_conflict).

The land fixer works on it in the background, and the watcher re-enqueues it at the back of the queue once it is fixed or judged flaky, or hands it back here with what it needs.

(written by quest land watch)

@moq-bot

moq-bot Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Codex land fixer: fixer crashed (exit 1); run /quest-iterate. Recommendation: run /quest-iterate before picking it again.

The merge queue removed https://github.com/moq-dev/moq/pull/9387 at 7382fa32849d2c581f94104cf2560df9f5f12e12: it conflicts with main at 1cdc73b3a5e2411ad7686e1ece983b1c14e57364, even with the quest merge driver.

Auto-merging doc/bin/relay/config.md
Auto-merging quest/m1/lite07-routing/README.md
Auto-merging quest/m2/README.md
CONFLICT (content): Merge conflict in quest/m2/README.md
Auto-merging rs/moq-relay/src/cluster.rs
Automatic merge failed; fix conflicts and then commit the result.

== The pull request's own checks on 7382fa32849d2c581f94104cf2560df9f5f12e12 ==
Its own CI ran these on the pull request, not in the merge queue. They are a signal only, and gate nothing.
skipped optional Dependabot / Request landing (https://github.com/moq-dev/moq/actions/runs/45044623865/job/137276450986)
skipped required Queue / Queue (https://github.com/moq-dev/moq/actions/runs/45044625723/job/137276411660)
success optional Quest / Quest (https://github.com/moq-dev/moq/actions/runs/45044621520/job/137276398356)
skipped optional Queue / Report Queue (https://github.com/moq-dev/moq/actions/runs/45044625723/job/137276412171)
neutral optional CodeRabbit (https://coderabbit.ai?utm_source=cr_app&utm_medium=github)
success optional pullfrog (https://github.com/moq-dev/moq/actions/runs/45044631809)

The fixer's output ended with:

quest land check: [Errno 32] Broken pipe

(written by Codex)

# Conflicts:
#	quest/m2/README.md

@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

The only commit since the last Pullfrog review merges origin/main.

  • Merge of main into the quest READMEs: the conflict resolution in quest/m2/README.md and quest/m1/lite07-routing/README.md drops the links to the finished origin-proxy-config and relay-peer-egress quests and keeps the prose grammatical. The egress removal in rs/moq-relay is unchanged.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 6bba5f8 Nov 23, 2026
8 checks passed
@kixelated
kixelated deleted the quest/m2/relay-peer-egress branch November 23, 2026 05:42
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