Reuse account page summary context#888
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR refactors account context computation by extracting core logic into a reusable helper, then updates ChangesAccount Context Extraction and Reuse
Possibly related PRs
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
mauricemohr88-debug
left a comment
There was a problem hiding this comment.
Reviewed current head 635115ec07ccf21463c91c2426449a79955f6ac3.
Approved. I inspected app/accounts.py and tests/test_account_routes.py and verified this is a focused account-context reuse refactor:
_account_api_context_for_normalized_account()extracts the prioraccount_api_context()body for already-normalized account ids;- public
account_api_context()still normalizes the incoming account before delegating, preserving external behavior; account_page_context()now reuses the helper output foraccepted_summary,pending_summary, andpending_payouts, while still building accepted work and ledger transaction rows separately;- the new regression test monkeypatches the safe summary/pending helpers and confirms the page context reuses the helper-derived values exactly once while preserving account normalization;
- no ledger mutation, wallet registration, transfer signing, payout/proof execution, treasury/proposal mutation, admin-token API, bridge, exchange, cash-out, MRWK price, private-data, credential, or secret-handling behavior is changed.
Validation on this exact head:
uv run --python 3.12 --extra dev python -m pytest tests/test_account_routes.py tests/test_account_validation.py -q-> 52 passed, 1 existing Starlette/httpx warning.uv run --python 3.12 --extra dev ruff check app/accounts.py tests/test_account_routes.py tests/test_account_validation.py-> passed.uv run --python 3.12 --extra dev ruff format --check app/accounts.py tests/test_account_routes.py tests/test_account_validation.py-> 3 files already formatted.uv run --python 3.12 --extra dev mypy app/accounts.py-> success.uv run --python 3.12 --extra dev python scripts/docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean tree4af20c2477f9b25e51a0780c138a38dd3e15a3b7.
GitHub state checked before approval: mergeStateStatus=CLEAN; hosted Quality, readiness, docs, and image checks and CodeRabbit statuses are successful on this head. I found no prior human review and no existing #838 claim for PR #888 / this head before posting this review.
Refs #846
Summary
Duplicate check
accepted_summary,pending_summary, andaccounts.pyoverlap.Validation
uv run --python 3.12 --extra dev python -m pytest tests/test_account_routes.py tests/test_account_validation.py -q-> 52 passed, 1 existing Starlette/httpx warning.uv run --python 3.12 --extra dev ruff check .-> passed.uv run --python 3.12 --extra dev ruff format --check .-> 111 files already formatted.uv run --python 3.12 --extra dev mypy app-> success across 42 source files.uv run --python 3.12 --extra dev python scripts/docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean tree4af20c2477f9b25e51a0780c138a38dd3e15a3b7.Scope
Account page/API context maintainability only. No ledger mutation, wallet registration, transfer signing, payout/proof execution, treasury/proposal mutation, admin-token API, exchange, bridge, cash-out, MRWK price behavior, private data, or secrets behavior changed.
Summary by CodeRabbit
Refactor
Tests