Skip to content

Refs #406: Accept hash-prefixed issue searches#484

Open
er1c-cartman wants to merge 1 commit into
ramimbo:mainfrom
er1c-cartman:fix-406-hash-issue-search
Open

Refs #406: Accept hash-prefixed issue searches#484
er1c-cartman wants to merge 1 commit into
ramimbo:mainfrom
er1c-cartman:fix-406-hash-issue-search

Conversation

@er1c-cartman
Copy link
Copy Markdown

@er1c-cartman er1c-cartman commented May 27, 2026

Summary

  • Treat #123 bounty search queries as issue-number searches, matching the common GitHub issue-reference form.
  • Keep non-numeric and whitespace-prefixed values rejected by the shared parser.
  • Add REST/page coverage for /api/v1/bounties?q=%2365 and /bounties?q=%2365.

Evidence

  • User-facing confusion addressed: GitHub issue references are commonly copied as #65, but the bounty search only accepted plain numeric issue queries before this change.
  • Intended surfaces: shared issue-number parsing, /api/v1/bounties, and the public /bounties page search form/results.
  • Scope control: this does not change route path parameters, bounty storage, or broad text search semantics; it only normalizes a leading # for issue-number search values.
  • Live bounty capacity at submission: issue MRWK bounty: useful bug reports and small fixes, round 5 #406 was open with 15 awards remaining via the public bounty API.
  • Regression coverage: accepts #340, rejects bare #, rejects non-numeric/whitespace-prefixed values through the existing parser boundaries, and verifies API/page search results for #65.

Validation

  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_bounty_api.py tests/test_path_params.py tests/test_bounty_pages.py::test_bounties_page_and_api_search_by_text_and_issue_number -q -> 19 passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_path_params.py tests/test_bounty_pages.py::test_bounties_page_and_api_search_by_text_and_issue_number -q -> 6 passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev ruff check app/path_params.py tests/test_path_params.py tests/test_bounty_pages.py -> passed
  • PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev ruff format --check app/path_params.py tests/test_path_params.py tests/test_bounty_pages.py -> 3 files already formatted

Summary by CodeRabbit

  • New Features

    • Issue number search now accepts queries with # prefix notation (e.g., #65), making searches more user-friendly and consistent with common issue tracking conventions
  • Tests

    • Expanded test coverage for issue number search with # prefix notation
    • Updated validation tests to ensure #-prefixed issue numbers are correctly normalized and invalid formats are properly rejected

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

📝 Walkthrough

Walkthrough

The PR extends issue number search queries to accept #-prefixed numbers by normalizing them in the path parameter validator. The implementation strips the leading # before numeric validation, and integration tests confirm the feature works across both the JSON API and HTML bounty search endpoints.

Changes

Hash-prefixed issue number search

Layer / File(s) Summary
Issue number parsing with hash prefix support
app/path_params.py, tests/test_path_params.py
issue_number_search_value() removes a leading # before validating that the remainder is all digits and within bounds. Unit tests verify #340 is accepted and normalized, and bare # is rejected.
Bounty search integration with hash-prefixed queries
tests/test_bounty_pages.py
The /api/v1/bounties search API and /bounties HTML page are tested with #65 queries to confirm they return matching issue 65 and the same bounty set (including "Internal admin cleanup", excluding "Improve public bounty discovery") as plain numeric queries.

Possibly related PRs

  • ramimbo/mergework#375: Introduced the issue_number_search_value() validator that this PR extends to accept #-prefixed issue numbers.
🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title directly names the changed surface (hash-prefixed issue search handling) and aligns with the main change across all modified files.
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 No prohibited claims found. README correctly describes MRWK as native project coin supporting future snapshots, bridges, onchain claims; no investment, price, or cash-out claims.
Bounty Pr Focus ✅ Passed PR changes match stated scope: 3 files modified, all related to accepting hash-prefixed issue searches. Unit and integration tests confirm proper behavior. No unrelated changes.
Description check ✅ Passed The PR description is comprehensive and complete, covering the change rationale, evidence, intended surfaces, scope boundaries, and validation results.

✏️ 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
Contributor

@GHX5T-SOL GHX5T-SOL left a comment

Choose a reason for hiding this comment

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

Reviewed PR #484 at current head a2f4631e00d862808980151fac67822880662326.

I do not see a blocker. The change is small and uses the shared issue_number_search_value() helper, so #65 now follows the same issue-number path as 65 across the REST/page search surfaces that already consume that helper. I also checked the broad-search behavior: #65 still participates in the existing text-search OR semantics, which is consistent with the current numeric query behavior rather than a regression from this patch.

Validation I ran:

PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_bounty_api.py tests/test_path_params.py tests/test_bounty_pages.py::test_bounties_page_and_api_search_by_text_and_issue_number -q -> 19 passed
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest -q -> 414 passed
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python -m pytest tests/test_bounty_api.py tests/test_path_params.py tests/test_bounty_pages.py::test_bounties_page_and_api_search_by_text_and_issue_number -q -> 19 passed
uv run --extra dev ruff check app/path_params.py tests/test_path_params.py tests/test_bounty_pages.py -> passed
uv run --extra dev ruff format --check app/path_params.py tests/test_path_params.py tests/test_bounty_pages.py -> 3 files already formatted
uv run --extra dev python -m mypy app -> success
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev python scripts/docs_smoke.py -> docs smoke ok
git diff --check origin/main...HEAD -> clean
gitleaks detect --no-banner --redact --source . --log-opts origin/main..HEAD --exit-code 1 -> no leaks found

GitHub CI is successful and CodeRabbit reports no actionable comments.

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.

2 participants