[codex] Add activity JSON shortcut#591
Conversation
📝 WalkthroughWalkthroughThe activity template adds a "View JSON activity" link to ChangesActivity page JSON link
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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/test_activity.py (1)
246-253:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd an assertion for encoded-query JSON link in the
#12filtered state.You validate the
#12filter content, but not that the new JSON shortcut preserves that query in encoded form. Add a regression assertion for the rendered link.Proposed test addition
assert issue_ref.status_code == 200 assert 'value="`#12`"' in issue_ref.text assert "Showing accepted work matching “#12”." in issue_ref.text + assert 'href="/api/v1/activity?q=%2312">View JSON activity</a>' in issue_ref.text assert "github:bob" in issue_ref.textAs per coding guidelines, "tests/**/*.py: Do not request docstrings. Focus on whether tests prove the changed behavior and include negative, replay, boundary, or regression cases where relevant."
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 6c46ecf4-ab27-4f35-9925-eafc956bf58e
📒 Files selected for processing (2)
app/templates/activity.htmltests/test_activity.py
eliasx45
left a comment
There was a problem hiding this comment.
Reviewed current head 3a15cd92069e6364480de5e106eedacab24a4229.
No blocker found. The PR adds a focused activity-page shortcut from /activity to /api/v1/activity, preserving the active q search value via Jinja urlencode. This improves the maintainer/contributor workflow by making the exact JSON feed reachable from the matching rendered activity view without changing ledger, wallet, payout, auth, or mutation behavior.
Evidence:
- Inspected
app/templates/activity.htmlandtests/test_activity.py. - Confirmed the unfiltered link renders as
/api/v1/activityand filtered searches render the preserved query, e.g./api/v1/activity?q=bob. - CodeRabbit's suggested extra assertion for
q=%2312is a useful hardening follow-up, but I do not consider it blocking because the implementation uses the samequery | urlencodepath and existing activity tests already cover hash issue-ref filtering in the API/page flow. PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m pytest tests\test_activity.py -q-> 3 passed..\.venv\Scripts\python.exe -m ruff check tests\test_activity.py-> passed..\.venv\Scripts\python.exe -m ruff format --check tests\test_activity.py-> 1 file already formatted.PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m mypy app\activity.py-> success.PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe scripts\docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean merge tree.- Hosted quality check and CodeRabbit status are green.
Note: I intentionally did not count an accidental Ruff run against the Jinja template as validation, since Ruff parses Python and is not the right tool for .html templates.
|
Actionable comments posted: 0 |
eliasx45
left a comment
There was a problem hiding this comment.
Re-reviewed current head 003878d419e20087d512cef3909b2af441b17041 after the test follow-up.
No blocker found. The new commit adds the encoded #12 activity search assertion that CodeRabbit suggested, so the tests now cover unfiltered, plain filtered, and encoded issue-ref filtered JSON shortcut links.
Validation on current head:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m pytest tests\test_activity.py -q-> 3 passed..\.venv\Scripts\python.exe -m ruff check tests\test_activity.py-> passed..\.venv\Scripts\python.exe -m ruff format --check tests\test_activity.py-> 1 file already formatted.PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe -m mypy app\activity.py-> success.PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .\.venv\Scripts\python.exe scripts\docs_smoke.py-> docs smoke ok.git diff --check origin/main...HEAD-> clean.git merge-tree --write-tree origin/main HEAD-> clean merge tree.
Approval stands for the current head.
Summary
/api/v1/activityJSON feed.Refs #580.
Evidence
Confusion/bug addressed
The public
/activitypage and/api/v1/activityfeed show the same accepted-work activity surface, but contributors had to manually rewrite the URL to inspect the exact machine-readable result set for the current page.Bounty capacity checked
Bounty #580 remains open as the active site UX and functional-improvements round, and the maintainer's latest update leaves 2 slots remaining after the paid #596 update.
Intended files/surfaces
app/templates/activity.html: add the activity-page JSON inspection link.tests/test_activity.py: cover unfiltered, filtered, and encoded#12search-link behavior.Expected PR size
Small focused UI/template behavior plus regression tests only.
Out of scope
No wallet material, private keys, cookies, OAuth state, access tokens, signatures, private data, payout actions, deployment changes, price/liquidity/exchange/off-ramp claims, bridge promises, or fabricated payout claims.
Validation
.venv/bin/python -m pytest tests/test_activity.py -q-> 3 passed.venv/bin/python -m ruff check tests/test_activity.py-> passed.venv/bin/python -m ruff format --check tests/test_activity.py-> 1 file already formatted.venv/bin/python -m mypy app/activity.py-> success.venv/bin/python scripts/docs_smoke.py-> docs smoke okgit diff --check origin/main...HEAD-> cleangit merge-tree --write-tree origin/main HEAD-> clean merge tree