Limit activity query length#858
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 (1)
📝 WalkthroughWalkthroughA 500-character maximum length limit is added to the ChangesActivity query length validation
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d5a75f9d-918d-443f-b2bd-6c5f29f7d2bd
📒 Files selected for processing (2)
app/activity.pytests/test_activity.py
NiXouuuu
left a comment
There was a problem hiding this comment.
Approved current head b11cc9e6af4bd301ce8efd5020bb226afb23747e after validating the focused public activity query length cap.
Source report checked: #798 (comment)
Production evidence before fix:
GET https://api.mrwk.online/api/v1/activity?q=<10000 a characters>-> HTTP 200, response size 10188 bytes.
Files inspected:
app/activity.pytests/test_activity.py
Review notes:
ACTIVITY_QUERY_MAX_LENGTH = 500is enforced insideactivity_context(), which is shared by/api/v1/activityand/activity.- Existing control-character and repeated-query-parameter validation remains unchanged.
- The new regression coverage checks oversized
qrejection for both the JSON API and HTML page.
Validation on current head:
uv run --extra dev pytest tests/test_activity.py tests/test_activity_routes.py -q-> 8 passed, 1 existing Starlette/httpx warning.uv run --extra dev ruff check app/activity.py tests/test_activity.py tests/test_activity_routes.py-> passed.uv run --extra dev ruff format --check app/activity.py tests/test_activity.py tests/test_activity_routes.py-> 3 files already formatted.uv run --extra dev mypy app/activity.py-> success.uv run --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 treee6fc1d0efb5d75ca010137dca3d2ae3817ad3382.
GitHub state before review: mergeable=MERGEABLE, hosted Quality, readiness, docs, and image checks SUCCESS, CodeRabbit PENDING, and no current-head human reviews existed. scripts/review_bounty_candidates.py --repo ramimbo/mergework --reviewer NiXouuuu --format text reports PR #858 as candidate_for_fresh_review.
Scope: public activity query validation only. No admin-token APIs, labels/comments from app code, payout execution, treasury mutation, ledger mutation, wallet material, private data, secrets, bridge, exchange, cash-out, or MRWK price behavior was used or changed.
laughlife
left a comment
There was a problem hiding this comment.
Approved current head cfbad488b30da1c469f306bc2409a2f43fc53412 after validating the follow-up boundary coverage for the public activity query length cap.
Source report checked: #798 (comment)
Production evidence before fix:
GET https://api.mrwk.online/api/v1/activity?q=<10000 a characters>-> HTTP 200, response size 10188 bytes.
Files inspected:
app/activity.pytests/test_activity.py
Review notes:
ACTIVITY_QUERY_MAX_LENGTH = 500is enforced in sharedactivity_context(), so the cap applies to both/api/v1/activityand/activity.- Existing control-character and repeated-query-parameter validation remains unchanged.
- The latest commit addresses the stale CodeRabbit boundary concern by proving exactly 500 characters is still accepted and 501 characters is rejected.
- The change stays scoped to public activity query validation and does not alter account normalization, result serialization, MCP behavior, ledger mutation, bounty creation, payout execution, treasury mutation, wallet behavior, private data, secrets, bridge/exchange/cash-out behavior, or MRWK price behavior.
Validation on current head:
uv run --extra dev pytest tests/test_activity.py tests/test_activity_routes.py -q-> 8 passed, 1 existing Starlette/httpx warning.uv run --extra dev ruff check app/activity.py tests/test_activity.py tests/test_activity_routes.py-> passed.uv run --extra dev ruff format --check app/activity.py tests/test_activity.py tests/test_activity_routes.py-> 3 files already formatted.uv run --extra dev mypy app/activity.py-> success.uv run --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 treea90470f5e30e49fc311b33bfa5c8539f1cb67c93.
GitHub state before review: mergeStateStatus=CLEAN, mergeable=MERGEABLE; hosted Quality, readiness, docs, and image checks and CodeRabbit are successful on this head. The only prior human review was on stale head b11cc9e6af4bd301ce8efd5020bb226afb23747e, and scripts/review_bounty_candidates.py --repo ramimbo/mergework --reviewer laughlife --format text reports PR #858 as candidate_for_fresh_review because the latest useful human review is stale.
alan747271363-art
left a comment
There was a problem hiding this comment.
Reviewed current head cfbad488b30da1c469f306bc2409a2f43fc53412 against current origin/main d7e9b530fffec7bd774da7708597648096a37393.
Scope inspected:
app/activity.pytests/test_activity.py- supporting route coverage in
tests/test_activity_routes.py
The branch-local fix is still focused: ACTIVITY_QUERY_MAX_LENGTH = 500 is enforced in the shared activity context used by both /api/v1/activity and /activity, boundary coverage confirms 500 characters is accepted and 501 is rejected, and the change does not alter account normalization, result serialization, MCP behavior, ledger mutation, bounty creation, payout execution, treasury mutation, wallet behavior, private data, or secrets handling.
Validation on this exact head:
.\.venv\Scripts\python.exe -m pytest tests\test_activity.py tests\test_activity_routes.py -q-> 8 passed, 1 existing Starlette/httpx warning..\.venv\Scripts\python.exe -m ruff check app\activity.py tests\test_activity.py tests\test_activity_routes.py-> passed..\.venv\Scripts\python.exe -m ruff format --check app\activity.py tests\test_activity.py tests\test_activity_routes.py-> 3 files already formatted..\.venv\Scripts\python.exe -m mypy app\activity.py-> success..\.venv\Scripts\python.exe scripts\docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.
Current blocker: mergeability has changed. GitHub now reports mergeStateStatus=DIRTY / conflicting, and git merge-tree --write-tree origin/main HEAD exits non-zero with content conflicts in app/activity.py and tests/test_activity.py. This needs a current-main rebase/conflict resolution before merge.
No private data, credentials, wallet material, production mutation, payout execution, treasury execution, ledger mutation, exchange, bridge, cash-out, price behavior, or fabricated payout claims were used.
Summary:
qfilter at 500 characters for both/api/v1/activityand/activity;Bounty #799
Source report: #798 (comment)
Production evidence before fix:
GET https://api.mrwk.online/api/v1/activity?q=<10000 a characters>-> HTTP 200, response size 10188 bytes.Duplicate/current check:
gh pr list --repo ramimbo/mergework --state open --search '"activity" "q" "500" in:title,body'returned no open PRs for this scope.Scope:
Validation:
uv run --extra dev pytest tests/test_activity.py -q-> 7 passed, 1 warning.uv run --extra dev pytest tests/test_activity.py tests/test_activity_routes.py -q-> 8 passed, 1 warning.uv run --extra dev ruff check app/activity.py tests/test_activity.py tests/test_activity_routes.py-> passed.uv run --extra dev ruff format --check app/activity.py tests/test_activity.py tests/test_activity_routes.py-> 3 files already formatted.uv run --extra dev mypy app/activity.py-> success.uv run --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 treee6fc1d0efb5d75ca010137dca3d2ae3817ad3382.Summary by CodeRabbit
Bug Fixes
Tests