Skip to content

Bounty #427: Add bounty detail contributor links#537

Open
adliebe wants to merge 3 commits into
ramimbo:mainfrom
adliebe:codex/bounty-427-distinct-ux
Open

Bounty #427: Add bounty detail contributor links#537
adliebe wants to merge 3 commits into
ramimbo:mainfrom
adliebe:codex/bounty-427-distinct-ux

Conversation

@adliebe
Copy link
Copy Markdown

@adliebe adliebe commented May 27, 2026

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.

  • Adds links from /bounties/{id} to /api/v1/bounties/{id}.
  • Adds links to active attempts JSON and all attempts JSON for the bounty.
  • Keeps the source GitHub issue link visible in the same inspection cluster.
  • Covers the rendered page output in 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 passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_bounty_pages.py tests/test_bounty_attempts.py -q -> 14 passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest -q -> 414 passed
  • uv run --extra dev ruff check tests/test_bounty_pages.py -> passed
  • uv run --extra dev ruff format --check tests/test_bounty_pages.py -> passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python scripts/docs_smoke.py -> docs smoke ok
  • git diff --check -> clean

No wallet material, private keys, tokens, signatures, payout/off-ramp claims, private data, or private security details are included.

Summary by CodeRabbit

  • New Features

    • Added a "Contributor links" card on the bounty detail page with links to inspect the bounty and view attempts in JSON; conditionally shows a "Source issue" link when an external issue URL exists.
  • Tests

    • Added tests confirming the inspect/attempts links appear and that the "Source issue" link is omitted when the external issue URL is missing.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 79f9c93a-ac12-4839-bac6-afae59f976d0

📥 Commits

Reviewing files that changed from the base of the PR and between 1577172 and 8d75b41.

📒 Files selected for processing (1)
  • tests/test_bounty_pages.py

📝 Walkthrough

Walkthrough

The 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.

Changes

Bounty detail contributor links

Layer / File(s) Summary
Contributor links UI and verification
app/templates/bounty_detail.html, tests/test_bounty_pages.py
New "Contributor links" acceptance card displays links to bounty and attempts API endpoints plus a conditional GitHub issue link. Test assertions verify the presence of "Inspect this bounty" and all expected href values including the attempts endpoint with include_expired=true parameter.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the bounty and describes the main change: adding contributor links to the bounty detail page.
Description check ✅ Passed The description covers the summary, implementation details, validation evidence including test runs and linting, and confirms no sensitive material is included.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Mergework Public Artifact Hygiene ✅ Passed PR changes only add bounty detail links to JSON API endpoints and test coverage. No investment, price, cash-out, payout, or security claims found in template, tests, or public artifacts.
Bounty Pr Focus ✅ Passed PR diff matches stated changes to bounty_detail.html and test_bounty_pages.py with proper test coverage for new contributor links feature and conditional rendering of source issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@INDICUMA INDICUMA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Add negative coverage for missing issue_url on the bounty detail page

  • ruff format --check and ruff check pass for tests/test_bounty_pages.py.
  • test_bounty_detail_highlights_action_fields only covers the issue_url present path; add a negative test for issue_url being None/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

📥 Commits

Reviewing files that changed from the base of the PR and between d8532d4 and fc12d97.

📒 Files selected for processing (2)
  • app/templates/bounty_detail.html
  • tests/test_bounty_pages.py

@tinyopsstudio
Copy link
Copy Markdown

Review evidence for PR #537 at head fc12d97.

I checked the changed surface in app/templates/bounty_detail.html and tests/test_bounty_pages.py. The new contributor-links card is scoped to the bounty detail page, uses the existing safe_public_url()-filtered issue_url, and points at existing API routes:

  • /api/v1/bounties/{bounty_id}
  • /api/v1/bounties/{bounty_id}/attempts
  • /api/v1/bounties/{bounty_id}/attempts?include_expired=true

Validation run locally:

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/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 -q -> 2 passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m pytest tests/test_bounty_pages.py tests/test_bounty_attempts.py -q -> 14 passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv/bin/python -m pytest -q -> 414 passed
  • .venv/bin/python -m ruff check tests/test_bounty_pages.py -> passed
  • .venv/bin/python -m ruff format --check tests/test_bounty_pages.py -> passed
  • .venv/bin/python scripts/docs_smoke.py -> docs smoke ok
  • git diff --check origin/main...HEAD -> clean
  • GitHub checks for PR Bounty #427: Add bounty detail contributor links #537 -> 2 passed, 0 failed

No blocking issue found. The change looks like a focused contributor workflow improvement for inspecting bounty state from the public detail page.

Copy link
Copy Markdown

@Juanpablo24-06 Juanpablo24-06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 passed
  • uv run --extra dev ruff check app/templates tests/test_bounty_pages.py -> passed
  • uv run --extra dev ruff format --check tests/test_bounty_pages.py -> passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python scripts/docs_smoke.py -> docs smoke ok
  • git 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.

@adliebe
Copy link
Copy Markdown
Author

adliebe commented May 27, 2026

Addressed the missing-issue-url coverage note in commit 1577172.

Validation:

  • uv run --extra dev ruff check tests/test_bounty_pages.py
  • uv run --extra dev ruff format --check tests/test_bounty_pages.py
  • 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_omits_source_issue_when_url_is_missing tests/test_bounty_pages.py::test_bounty_detail_shows_accepted_award_history -q
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_bounty_pages.py tests/test_bounty_attempts.py -q
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest -q
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python scripts/docs_smoke.py
  • git diff --check

Copy link
Copy Markdown

@INDICUMA INDICUMA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 passed
  • PYTEST_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 -> passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 .venv312/bin/python scripts/docs_smoke.py -> docs smoke ok
  • git 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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ba391ee8-a70c-4172-ba9c-073a99ed9b5a

📥 Commits

Reviewing files that changed from the base of the PR and between fc12d97 and 1577172.

📒 Files selected for processing (1)
  • tests/test_bounty_pages.py

Comment thread tests/test_bounty_pages.py
@adliebe
Copy link
Copy Markdown
Author

adliebe commented May 27, 2026

Addressed CodeRabbit's latest coverage note in commit 8d75b41 by asserting the include_expired=true attempts link in the missing-issue-url regression too.

Validation:

  • uv run --extra dev ruff check tests/test_bounty_pages.py
  • uv run --extra dev ruff format --check tests/test_bounty_pages.py
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_bounty_pages.py::test_bounty_detail_omits_source_issue_when_url_is_missing tests/test_bounty_pages.py::test_bounty_detail_highlights_action_fields -q
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_bounty_pages.py tests/test_bounty_attempts.py -q
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest -q
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python scripts/docs_smoke.py
  • git diff --check

Copy link
Copy Markdown

@weilixiong weilixiong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@tolga-tom-nook tolga-tom-nook left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head 8d75b41c4ed5637d4e6026fbe451eec6932017a1 for bounty #447. No blockers found.

Evidence checked:

  • Diff is limited to app/templates/bounty_detail.html and tests/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 existing safe_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_url is empty.

Validation run locally:

  • python3 -m pytest tests/test_bounty_pages.py -q -> 8 passed
  • python3 -m ruff check tests/test_bounty_pages.py -> passed
  • python3 -m ruff format --check tests/test_bounty_pages.py -> passed
  • python3 scripts/docs_smoke.py -> passed
  • python3 -m mypy app -> passed
  • git 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants