Skip to content

Refactor ADR tool helpers#535

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

Refactor ADR tool helpers#535
EffortlessSteven wants to merge 1 commit into
mainfrom
codex/refactor-code-to-be-more-dry-1kvw9m

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Motivation

  • Reduce duplication between the ADR-related binaries by extracting shared helpers for ADR parsing/discovery and console output.
  • Make the ADR tools more DRY and easier to maintain by centralizing filename/title parsing and date validation logic.
  • Prevent future divergence of common behavior between validate-adr and generate-docs-index by providing a single shared implementation.

Description

  • Added a small openracing_tools library surface (crates/tools/src/lib.rs) that exposes adr and console modules.
  • Implemented adr helpers in crates/tools/src/adr.rs covering ADR filename/title parsing, ADR discovery (find_adr_files), and ISO date checking (is_iso_date).
  • Implemented console helpers in crates/tools/src/console.rs for consistent stdout/stderr line output.
  • Updated crates/tools/src/bin/generate_docs_index.rs and crates/tools/src/bin/validate_adr.rs to import and reuse the shared helpers and removed the duplicated implementations from those binaries.
  • Left an unrelated pre-existing change to fuzz/Cargo.lock untouched.

Testing

  • Ran formatting with python scripts/cargo_fmt_workspace.py, which completed successfully.
  • Ran unit tests with cargo test -p openracing-tools, and all tests for the tools crate passed.
  • Ran lints with cargo clippy -p openracing-tools --all-targets --all-features -- -D warnings, and the check completed with no warnings.

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

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown

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 55 seconds 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: 28fb3950-1cba-495f-a6f0-f6433d01c6fc

📥 Commits

Reviewing files that changed from the base of the PR and between f5a48ad and 065b763.

📒 Files selected for processing (5)
  • crates/tools/src/adr.rs
  • crates/tools/src/bin/generate_docs_index.rs
  • crates/tools/src/bin/validate_adr.rs
  • crates/tools/src/console.rs
  • crates/tools/src/lib.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/refactor-code-to-be-more-dry-1kvw9m

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.

@factory-droid

factory-droid Bot commented May 17, 2026

Copy link
Copy Markdown

Droid finished @EffortlessSteven's task —— View job


Review complete.

LGTM — validated the candidate set (no inline comments) and found no high-confidence correctness or security issues in this refactor to shared ADR/console helpers.

@github-actions

Copy link
Copy Markdown

Compatibility Layer Usage Report

Current usage count: 193
Baseline usage count: 193
ℹ️ Usage unchanged

📈 Usage Trend (Last 30 Days)

  • Peak usage: 193
  • Current trend: insufficient_data (0%)
  • Projected removal: unknown

Usage Details

  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/compat_impl.rs:69 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/hid/linux.rs:1253 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/hid/linux.rs:1282 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/hid/mod.rs:230 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/protocol.rs:290 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/protocol.rs:742 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/engine/src/protocol.rs:749 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/schemas/src/service_example.rs:189 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/schemas/src/service_example.rs:218 - temp_c
  • /home/runner/work/OpenRacing/OpenRacing/crates/schemas/src/integration_test.rs:79 - temp_c

... and 183 more occurrences

Migration Guide

To migrate these usages, replace:

  • .temp_c().temperature_c
  • .faults().fault_flags
  • .wheel_angle_mdeg().wheel_angle_deg
  • .wheel_speed_mrad_s().wheel_speed_rad_s

See Migration Patterns for detailed examples.

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