Skip to content

Make telemetry packet helpers DRY#295

Open
EffortlessSteven wants to merge 1 commit into
mainfrom
codex/refactor-code-to-be-more-dry
Open

Make telemetry packet helpers DRY#295
EffortlessSteven wants to merge 1 commit into
mainfrom
codex/refactor-code-to-be-more-dry

Conversation

@EffortlessSteven
Copy link
Copy Markdown
Member

Motivation

  • Reduce duplication of byte-offset magic and test fixture byte construction for telemetry adapters by centralising packet layout and helpers.
  • Make test fixtures and replay tools reuse the same encoding logic to avoid divergent byte-order/offset bugs.
  • Fix a couple of Clippy warnings (reverse-sorting) discovered while validating changes.

Description

  • Add named byte-offset constants and encode_telemetry_frame + small write helpers to crates/flight-aerofly/src/lib.rs and update the binary parser to use the offsets instead of numeric literals.
  • Add named byte-offset constants and encode_packet + write_f64_le to crates/flight-opentrack/src/lib.rs and update the parser to use the offsets.
  • Update Aerofly/OpenTrack tests to call encode_telemetry_frame / encode_packet from the library instead of duplicating byte writes in test helpers (crates/flight-aerofly/tests/*, crates/flight-opentrack/tests/*).
  • Replace two manual sort_by(|a,b| b.timestamp.cmp(&a.timestamp)) calls with sort_by_key(|b| Reverse(b.timestamp)) in crates/flight-writers/src/curve_conflict.rs and crates/flight-writers/src/rollback.rs to satisfy Clippy suggestions.

Testing

  • Ran git diff --check (no leftover check errors) — passed.
  • Ran cargo test -p flight-aerofly -p flight-opentrack and the unit/depth/integration tests for both crates passed (all tests green).
  • Ran cargo clippy -p flight-aerofly -p flight-opentrack -- -D warnings and Clippy passed for the touched crates.
  • Note: cargo fmt --all -- --check was attempted but the workspace contains unrelated formatting diffs outside this change set, so a workspace-wide strict format check could not be used here.

Codex Task

@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 17, 2026

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 57 minutes and 1 second before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d67d4590-e904-4cac-b823-27088b4b156c

📥 Commits

Reviewing files that changed from the base of the PR and between 7d026c3 and 8591da1.

📒 Files selected for processing (7)
  • crates/flight-aerofly/src/lib.rs
  • crates/flight-aerofly/tests/depth_tests.rs
  • crates/flight-aerofly/tests/integration_tests.rs
  • crates/flight-opentrack/src/lib.rs
  • crates/flight-opentrack/tests/depth_tests.rs
  • crates/flight-writers/src/curve_conflict.rs
  • crates/flight-writers/src/rollback.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/refactor-code-to-be-more-dry

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant