Show pending payouts on account views#730
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 (4)
📝 WalkthroughWalkthroughAdds pending treasury payout data to account APIs and the account page. Implements serializers that query and summarize pending ChangesPending Payout Feature
Possibly related issues
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 |
Difficult-Burger
left a comment
There was a problem hiding this comment.
Found one blocking UI regression in the pending payouts account section.
app/templates/account.html:98 renders the bounty/issue separator as ·:
{% if payout.bounty_url and pending_issue_url %} · {% endif %}The existing accepted-work section in the same template uses the normal separator (·) at the equivalent bounty/issue join. With the current PR head, any pending payout row that has both bounty_url and a safe public issue_url will show mojibake in the public account page. This is easy to miss because the new route test only checks for the presence of the proposal link and amounts, not the rendered separator text.
Verification run locally from PR head b3955232d585166e6fae6ca352e2a719a2f5b4a5 in an isolated checkout with the dollar-hunt-mergework conda env:
sed -n '80,140p' app/templates/account.html-> confirmed·in the new pending-payout sectionLC_ALL=C rg -n "Â|·|pending_issue_url|pending_submission_url" app/templates/account.html-> line 98 has·; line 148 has the existing correct·PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest tests/test_account_routes.py -q-> 6 passedpython -m ruff check app/accounts.py app/serializers.py tests/test_account_routes.py-> All checks passed
Please replace the mojibake separator with the same separator style used by the existing accepted-work row, or use plain ASCII if preferred. The underlying account/pending-payout data path otherwise looks coherent from this pass.
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 02918334-db07-4fa4-8613-d9688705b971
📒 Files selected for processing (4)
app/accounts.pyapp/serializers.pyapp/templates/account.htmltests/test_account_routes.py
|
Thanks for the review. I pushed
Verification after the update:
|
xyjk0511
left a comment
There was a problem hiding this comment.
Reviewed PR #730 at current head 3b34e9281bf1cbca97d288061f6854496dffd93a.
No blocker found in the updated pending-payout account view/API change.
What I checked:
- The prior mojibake blocker from head
b3955232is fixed on the current head: the pending-payout bounty/issue separator now renders as ASCII-safe·instead of·. - The existing accepted-work separator was also normalized to
·, so the template now uses the same safe separator style in both pending and proof-backed sections. - Pending payout rows are kept separate from proof-backed paid work: account balance and accepted-work summary still come only from ledger/proof rows, while pending proposals are exposed under separate
pending_summaryandpending_payoutsfields. pending_payouts_for_account()filters pendingpay_bountyproposals for the target account and then re-validates the parsed payload account before returning rows.- The query prefilter matches the repository's canonical compact JSON format from
canonical_json(). - Public links still flow through
safe_public_url()in the template before rendering bounty, issue, or submission links. - Regression tests now cover the pending-vs-paid separation, the rendered no-mojibake condition, and the safe fallback path when pending payout lookup fails.
Validation I ran locally:
uv run --python 3.12 --with pytest pytest tests/test_account_routes.py -q-> 7 passed, 1 warning.uv run --python 3.12 --with pytest pytest tests/test_account_routes.py tests/test_api_mcp.py tests/test_serializers.py -k "account or accepted" -q-> 17 passed, 80 deselected, 1 warning.uvx ruff check app/accounts.py app/serializers.py tests/test_account_routes.py-> passed.uvx ruff format --check app/accounts.py app/serializers.py tests/test_account_routes.py-> 3 files already formatted..\.venv\Scripts\python.exe scripts\docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.gh pr checks 730 --repo ramimbo/mergework-> Quality/readiness/docs/image checks passed; CodeRabbit was still pending at review time.
No private data, credentials, wallet material, production mutation, price/exchange/bridge/off-ramp claims, or fabricated payout claims used.
JONASXZB
left a comment
There was a problem hiding this comment.
Reviewed current head 3b34e9281bf1cbca97d288061f6854496dffd93a as a non-author.
No blocker found in the pending-payout account view/API changes. Evidence checked:
- inspected
account_api_context,account_accepted_work_context, andaccount_page_contextto confirm pending payout rows are reported separately from proof-backed accepted work and balances; - inspected
pending_payouts_for_accountand the payload filter, including the final exactpayload.get("to_account") == accountguard after the SQL contains prefilter; - confirmed pending summary totals use only pending proposal rows and that accepted work/proof fields remain driven by ledger/proof data;
- checked the account template section and verified the earlier mojibake separator is replaced with
·in both pending and accepted rows; - ran
python -m pytest tests/test_account_routes.py tests/test_api_mcp.py tests/test_serializers.py -k 'account or accepted' -q-> 17 passed, 80 deselected, 1 warning; - ran
python -m ruff check app/accounts.py app/serializers.py tests/test_account_routes.py,python -m ruff format --check ...,python -m mypy app, andgit diff --check origin/main...HEAD; - checked a merge-tree against current
origin/main; no conflict markers or both-modified conflict diagnostics were present.
Hosted commit status for this head is green (CodeRabbit: success / Review skipped).
Bounty #647
Source issue: #671
Summary
pay_bountyproposals./api/v1/accounts/{account}with a separatepending_payoutssummary./api/v1/accounts/{account}/accepted-workwith separatepending_summaryandpending_payoutsrows.accepted_work, balance, latest proof, and ledger fields unchanged until treasury execution creates a proof.Verification
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m pytest tests\test_account_routes.py -q-> 6 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m pytest tests\test_api_mcp.py -k "account" -q-> 7 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m pytest tests\test_serializers.py -k "account or accepted" -q-> 2 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m pytest tests\test_account_routes.py tests\test_api_mcp.py tests\test_serializers.py -k "account or accepted" -q-> 16 passed.\.venv\Scripts\python.exe -m ruff check app\accounts.py app\serializers.py tests\test_account_routes.py-> All checks passed.\.venv\Scripts\python.exe -m ruff format --check app\accounts.py app\serializers.py tests\test_account_routes.py-> 3 files already formattedgit diff --check-> passedDuplicate Check
Scope
No balance, proof, ledger, wallet transfer, treasury execution, payout rule, exchange, bridge, cash-out, price, private data, credential, or production mutation behavior changed.
Summary by CodeRabbit
New Features
Bug Fixes
Tests