Preserve account filter on activity page#854
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 optional ChangesActivity Page Account Filtering
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 |
laughlife
left a comment
There was a problem hiding this comment.
Bounty #838 current-head review for PR #854.
Reviewed head 529f09ed85160ebf9fdfd10d36259cf95a553e1e as a non-author.
Changes requested: the PR currently fails the hosted quality check and the failure is reproducible locally.
Blocker found:
activity_context()now injectsapi_activity_urlinto the context, buttests/test_activity_routes.py::test_activity_context_preserves_empty_feed_shapestill asserts the exact empty-feed dictionary shape without that new key.- As a result, the full suite fails even though the PR's focused
tests/test_activity.pyvalidation passes.
Evidence checked:
- Inspected
app/activity.py,app/serializers.py,app/templates/activity.html, andtests/test_activity.py. - Checked the hosted Quality/readiness/docs/image failure for run
26938575898; it fails with the same extraapi_activity_urlkey intest_activity_context_preserves_empty_feed_shape. - Confirmed PR #854 currently has no prior human review on this head and GitHub reports
mergeStateStatus=UNSTABLE.
Validation I ran on current head:
uv run --extra dev pytest tests/test_activity.py -q-> 7 passed, 1 existing Starlette/httpx warning.uv run --extra dev pytest tests/test_activity_routes.py::test_activity_context_preserves_empty_feed_shape -q-> failed with the extraapi_activity_urlkey.uv run --extra dev ruff check app/activity.py app/serializers.py tests/test_activity.py-> passed.uv run --extra dev ruff format --check app/activity.py app/serializers.py tests/test_activity.py-> 3 files already formatted.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean tree2021d4aa25c8b20d5d5e9370472dec43dcb471bc.
No private data, secrets, wallet material, payout execution, treasury mutation, ledger mutation, bridge, exchange, cash-out, MRWK price behavior, or issue mutation was used.
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 64c92ba1-dce1-4a61-a16e-e591402aa2cd
📒 Files selected for processing (4)
app/activity.pyapp/serializers.pyapp/templates/activity.htmltests/test_activity.py
aglichandrap
left a comment
There was a problem hiding this comment.
Review evidence (head SHA: 03e0804282b4):
- ✅ Scope: Adds
account=github:<login>query param support to/activityHTML page. Matches existing API behavior. - ✅ Code quality: Clean helper functions
_activity_api_urland_activity_page_url. Properurlencodeusage. - ✅ Input validation:
reject_control_char_query_paramandreject_repeated_query_paramapplied to newaccountparam — consistent with existingqparam handling. - ✅ Tests: 43 new lines in
test_activity.pycovering account filter behavior.test_activity_routes.pyupdated. - ✅ serializers.py: Variable rename
account→contributor_accountavoids shadowing the function parameter — good cleanup. - ✅ Mergeable: state=clean, mergeable=True.
- ✅ Files touched: 5 files, +83/-10 — well-scoped.
No blockers found. Approve.
SYZBZ
left a comment
There was a problem hiding this comment.
Bounty #838 current-head review for PR #854.
Reviewed head 03e0804282b46260ae48fc00bce941202bf37646 as a non-author.
Approve. I re-validated the follow-up that fixed the earlier empty-context blocker and confirmed the HTML activity page now preserves the same account-scoped behavior as /api/v1/activity, while the serializer rename keeps global activity context from inheriting a contributor account.
Files inspected:
app/activity.pyapp/serializers.pyapp/templates/activity.htmltests/test_activity.pytests/test_activity_routes.py
Evidence checked:
/activitynow validates repeated and control-characteraccountparams the same way as the API route.- The page preserves the normalized
accountin the hidden form field, clear links, andView JSON activityURL, including combinedq + accountcases. activity_context()now exposesapi_activity_urlandclear_activity_url, and the empty-feed route-shape regression was updated for those new keys.activity_to_dict()renames the contributor loop variable, so top-levelaccountremains the requested filter instead of a shadowed contributor value.
Validation I ran on current head:
C:\Users\user\OneDrive - MRMAD\Desktop\github_mission\mergework\.venv\Scripts\python.exe -m pytest tests/test_activity.py tests/test_activity_routes.py -q-> 8 passed, 1 existing Starlette/httpx warningC:\Users\user\OneDrive - MRMAD\Desktop\github_mission\mergework\.venv\Scripts\python.exe -m ruff check app/activity.py app/serializers.py tests/test_activity.py tests/test_activity_routes.py-> passedC:\Users\user\OneDrive - MRMAD\Desktop\github_mission\mergework\.venv\Scripts\python.exe -m ruff format --check app/activity.py app/serializers.py tests/test_activity.py tests/test_activity_routes.py-> 4 files already formattedC:\Users\user\OneDrive - MRMAD\Desktop\github_mission\mergework\.venv\Scripts\python.exe -m mypy app/activity.py app/serializers.py-> successC:\Users\user\OneDrive - MRMAD\Desktop\github_mission\mergework\.venv\Scripts\python.exe scripts/docs_smoke.py-> docs smoke okgit diff --check origin/main...HEAD-> cleangit merge-tree --write-tree origin/main HEAD-> clean tree34cba62428c07920604e9c9423fa6ea47411e22e
GitHub state checked before approval: mergeStateStatus=CLEAN; hosted Quality, readiness, docs, and image checks and CodeRabbit are successful on this head.
No private data, secrets, wallet material, payout execution, treasury mutation, ledger mutation, bridge, exchange, cash-out, MRWK price behavior, or issue mutation was used.
Summary
Bounty #799
Refs #798
Source report: #798 (comment)
The activity API now honors
account=github:<login>, but the HTML activity page still ignored that query string and rendered the global activity page. This PR makes the page preserve the same account-scoped view and fixes a serializer variable shadowing bug that could leak a last contributor account into global activity context once the template started readingaccount.Changes
accounton/activitywith the same repeated/control-character checks as the API route.qandaccountare preserved together.activity_to_dict()so global activity responses do not gain a synthetic top-levelaccount.account, account-scoped HTML, and combinedq + accountlinks.Validation
Scope
No payout execution, treasury mutation, wallet mutation, transfer signing, admin-token behavior, bridge/exchange/cash-out behavior, MRWK price behavior, or private data handling is changed.
Summary by CodeRabbit
New Features
Bug Fixes
Tests