Bounty #427: Add bounty detail contributor links#537
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)
📝 WalkthroughWalkthroughThe PR adds a new "Contributor links" acceptance card to the bounty detail page, providing direct links to API inspection endpoints and the source GitHub issue. The template renders links to the bounty and attempts endpoints with appropriate query parameters, conditionally including the issue link when available. Test assertions confirm the UI elements and link targets are rendered. ChangesBounty detail contributor links
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
INDICUMA
left a comment
There was a problem hiding this comment.
Approved current head fc12d97.
I inspected the two changed files, app/templates/bounty_detail.html and tests/test_bounty_pages.py. The new contributor-links section reuses the already-sanitized issue_url value, keeps the source issue fallback behavior intact, and points to existing GET endpoints for bounty detail plus active/all attempts JSON without changing route behavior or exposing private material.
Local verification on this head:
- PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv312/bin/python -m pytest tests/test_bounty_pages.py::test_bounty_detail_highlights_action_fields tests/test_bounty_pages.py::test_bounty_detail_shows_accepted_award_history tests/test_bounty_attempts.py::test_bounty_attempts_register_list_duplicate_and_release -q -> 3 passed
- PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv312/bin/python -m pytest tests/test_bounty_pages.py tests/test_bounty_attempts.py -q -> 14 passed
- .venv312/bin/python -m ruff check tests/test_bounty_pages.py -> passed
- PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv312/bin/python scripts/docs_smoke.py -> docs smoke ok
- git diff --check origin/main...HEAD -> clean
The hosted Quality/readiness/docs/image check is successful. CodeRabbit was still pending when I reviewed, but I did not find a blocking issue in the current diff.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/test_bounty_pages.py (1)
271-303:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd negative coverage for missing
issue_urlon the bounty detail page
ruff format --checkandruff checkpass fortests/test_bounty_pages.py.test_bounty_detail_highlights_action_fieldsonly covers theissue_urlpresent path; add a negative test forissue_urlbeingNone/empty so the conditional “Source issue” link doesn’t regress.Suggested test addition
def test_bounty_detail_without_issue_url(sqlite_url: str) -> None: create_schema(sqlite_url) with session_scope(sqlite_url) as session: ensure_genesis(session) bounty = create_bounty( session, repo="ramimbo/mergework", issue_number=5, issue_url="", # or None if that’s what the app accepts title="Bounty without external issue", reward_mrwk="50", acceptance="This bounty has no external issue link.", ) client = TestClient(create_app(database_url=sqlite_url, webhook_secret="secret")) response = client.get(f"/bounties/{bounty.id}") assert response.status_code == 200 assert "Inspect this bounty" in response.text assert "Source issue" not in response.text
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0dc91887-de5e-4a6f-9c20-d2101c93cda3
📒 Files selected for processing (2)
app/templates/bounty_detail.htmltests/test_bounty_pages.py
|
Review evidence for PR #537 at head I checked the changed surface in
Validation run locally:
No blocking issue found. The change looks like a focused contributor workflow improvement for inspecting bounty state from the public detail page. |
Juanpablo24-06
left a comment
There was a problem hiding this comment.
Current-head review for PR #537 at fc12d97d312fc2b6155ac391f4d85e9af234435b, focused on the bounty detail contributor-link workflow for issue/API/attempt inspection.
Evidence: inspected app/templates/bounty_detail.html, tests/test_bounty_pages.py, app/public_routes.py, app/bounty_api.py, and app/bounty_attempts.py; verified the page reuses the existing safe_public_url guard for the external source issue, links the internal bounty JSON endpoint, and exposes active vs all attempt JSON through the existing include_expired query contract.
Validation:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_bounty_pages.py::test_bounty_detail_highlights_action_fields tests/test_bounty_attempts.py -q->8 passeduv run --extra dev ruff check app/templates tests/test_bounty_pages.py-> passeduv run --extra dev ruff format --check tests/test_bounty_pages.py-> passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python scripts/docs_smoke.py->docs smoke okgit diff --check origin/main...HEAD-> clean
Verdict: approved for this reviewed slice. I did not find a current-head blocker in the contributor-link path, and no wallet material, private keys, tokens, signatures, private data, payout guarantees, liquidity/exchange/off-ramp claims, or private security details were used.
|
Addressed the missing-issue-url coverage note in commit 1577172. Validation:
|
INDICUMA
left a comment
There was a problem hiding this comment.
Current-head follow-up review for PR #537 at 1577172efa18e8435a0b2c086880ce2576dd263c.
I rechecked the updated head after the missing-issue-url coverage follow-up. The added regression constructs a bounty with an empty issue_url and verifies the contributor-links card still exposes the public bounty/attempt JSON links while omitting the Source issue link. That matches the template behavior: safe_public_url(bounty.issue_url) gates only the external issue link, while the local JSON inspection links remain available.
Validation run locally:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv312/bin/python -m pytest tests/test_bounty_pages.py::test_bounty_detail_highlights_action_fields tests/test_bounty_pages.py::test_bounty_detail_omits_source_issue_when_url_is_missing tests/test_bounty_pages.py::test_bounty_detail_shows_accepted_award_history -q-> 3 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv312/bin/python -m pytest tests/test_bounty_pages.py tests/test_bounty_attempts.py -q-> 15 passed.venv312/bin/python -m ruff check tests/test_bounty_pages.py-> passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv312/bin/python scripts/docs_smoke.py-> docs smoke okgit diff --check origin/main...HEAD-> clean
GitHub Quality/readiness/docs/image checks are passing on this head. CodeRabbit was still pending at review time, so I did not rely on it for this approval.
|
Addressed CodeRabbit's latest coverage note in commit 8d75b41 by asserting the Validation:
|
weilixiong
left a comment
There was a problem hiding this comment.
APPROVED — Clean feature addition adding contributor links to bounty detail page. +48/-0, adds API/issue links section with conditional source issue link. New test covers both present and missing issue_url cases.
tolga-tom-nook
left a comment
There was a problem hiding this comment.
Reviewed current head 8d75b41c4ed5637d4e6026fbe451eec6932017a1 for bounty #447. No blockers found.
Evidence checked:
- Diff is limited to
app/templates/bounty_detail.htmlandtests/test_bounty_pages.py. - The new contributor-links section points to the existing public bounty JSON and attempts endpoints for the same
bounty.id, and keeps the source issue link behind the existingsafe_public_url(bounty.issue_url)guard. - Regression coverage now verifies the links render on a normal bounty detail page and verifies the source-issue row is omitted when
issue_urlis empty.
Validation run locally:
python3 -m pytest tests/test_bounty_pages.py -q-> 8 passedpython3 -m ruff check tests/test_bounty_pages.py-> passedpython3 -m ruff format --check tests/test_bounty_pages.py-> passedpython3 scripts/docs_smoke.py-> passedpython3 -m mypy app-> passedgit diff --check origin/main...HEAD-> passed
I also intentionally did not run Ruff on the Jinja template as a Python source file; that produces expected syntax noise, while the template path is covered through the FastAPI/Jinja rendering tests above.
Summary
Bounty #427 focused public workflow improvement: the bounty detail page now includes a contributor-links section with direct machine-readable routes for the same bounty.
/bounties/{id}to/api/v1/bounties/{id}.tests/test_bounty_pages.py.This is distinct from the existing ledger-entry navigation work and the attempts API limit work: it is a page-level bounty-detail navigation improvement that helps contributors verify bounty data and collision state before starting work.
Validation
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_bounty_pages.py::test_bounty_detail_highlights_action_fields tests/test_bounty_pages.py::test_bounty_detail_shows_accepted_award_history -q-> 2 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_bounty_pages.py tests/test_bounty_attempts.py -q-> 14 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest -q-> 414 passeduv run --extra dev ruff check tests/test_bounty_pages.py-> passeduv run --extra dev ruff format --check tests/test_bounty_pages.py-> passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python scripts/docs_smoke.py-> docs smoke okgit diff --check-> cleanNo wallet material, private keys, tokens, signatures, payout/off-ramp claims, private data, or private security details are included.
Summary by CodeRabbit
New Features
Tests