Skip to content

chore: derive_more in tempdb#6494

Merged
hanabi1224 merged 2 commits intomainfrom
derive-more-temp-db
Jan 28, 2026
Merged

chore: derive_more in tempdb#6494
hanabi1224 merged 2 commits intomainfrom
derive-more-temp-db

Conversation

@LesnyRumcajs
Copy link
Copy Markdown
Member

@LesnyRumcajs LesnyRumcajs commented Jan 28, 2026

Summary of changes

Changes introduced in this pull request:

  • not sure why the db field was optional in that struct, but making it non-optional simplifies the code a bit.

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Outside contributions

  • I have read and agree to the CONTRIBUTING document.
  • I have read and agree to the AI Policy document. I understand that failure to comply with the guidelines will lead to rejection of the pull request.

Summary by CodeRabbit

  • Tests

    • Refactored tests to use public APIs, improving code maintainability.
  • Refactor

    • Updated internal test utilities structure for better encapsulation.

✏️ Tip: You can customize this high-level summary in your review settings.

@LesnyRumcajs LesnyRumcajs requested a review from a team as a code owner January 28, 2026 15:25
@LesnyRumcajs LesnyRumcajs requested review from akaladarshi and hanabi1224 and removed request for a team January 28, 2026 15:25
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 28, 2026

Walkthrough

Tests refactored to use public subscriber API methods instead of accessing internal database fields directly. A test utility struct was simplified by replacing optional field storage with derive macros for automatic trait implementations.

Changes

Cohort / File(s) Summary
Test utility struct refactoring
src/db/tests/db_utils/parity.rs
Changed TempParityDB.db field from Option<ParityDb> to ParityDb (non-optional). Added derive_more::AsRef and derive_more::Deref derives; removed manual Deref and AsRef impl blocks.
Test code API migration
src/db/parity_db.rs
Updated test code to use public subscribe_write_ops(), unsubscribe_write_ops(), and write_ops_broadcast_tx accessor methods instead of direct access to internal db.db fields.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • hanabi1224
  • akaladarshi
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: introducing derive_more macros to the TempParityDB struct, which is the primary refactoring in this PR.
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 docstrings

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

@LesnyRumcajs LesnyRumcajs added this pull request to the merge queue Jan 28, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 28, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.73%. Comparing base (323e119) to head (b19e90e).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
src/db/parity_db.rs 67.81% <100.00%> (-1.94%) ⬇️

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 323e119...b19e90e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hanabi1224 hanabi1224 added this pull request to the merge queue Jan 28, 2026
Merged via the queue into main with commit dabd08d Jan 28, 2026
34 of 35 checks passed
@hanabi1224 hanabi1224 deleted the derive-more-temp-db branch January 28, 2026 19:03
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