Refs #406: Accept hash-prefixed issue searches#484
Conversation
📝 WalkthroughWalkthroughThe PR extends issue number search queries to accept ChangesHash-prefixed issue number search
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 |
GHX5T-SOL
left a comment
There was a problem hiding this comment.
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.
jtc268
left a comment
There was a problem hiding this comment.
Reviewed current head a2f4631e00d862808980151fac67822880662326.
The change is narrow and correct: issue_number_search_value() now accepts a leading # only when the remaining text is a bounded numeric issue id, while preserving the existing rejection of whitespace-prefixed, empty, nonnumeric, and overflow queries. The bounty page/API regression covers both /api/v1/bounties?q=%2365 and /bounties?q=%2365, including the visible search text and filtered row set.
Validation:
MERGEWORK_DATABASE_URL=sqlite:////tmp/mergework-pr484-focused.sqlite3 ../mergework/.venv/bin/python -m pytest tests/test_path_params.py::test_issue_number_search_value_accepts_bounded_numeric_query tests/test_path_params.py::test_issue_number_search_value_rejects_non_numeric_or_overflow_query tests/test_bounty_pages.py::test_bounties_page_and_api_search_by_text_and_issue_number -q-> 3 passed../mergework/.venv/bin/python -m pytest tests/test_path_params.py tests/test_bounty_pages.py -q-> 12 passed../mergework/.venv/bin/python -m ruff check app/path_params.py tests/test_bounty_pages.py tests/test_path_params.py-> passed../mergework/.venv/bin/python -m ruff format --check app/path_params.py tests/test_bounty_pages.py tests/test_path_params.py-> 3 files already formatted../mergework/.venv/bin/python -m mypy app/path_params.py-> success../mergework/.venv/bin/python scripts/docs_smoke.py-> docs smoke okgit diff --check-> clean
The earlier SQLite lock I hit was from overlapping local pytest jobs on the same default DB; the isolated focused rerun above passed. Approving.
Summary
#123bounty search queries as issue-number searches, matching the common GitHub issue-reference form./api/v1/bounties?q=%2365and/bounties?q=%2365.Evidence
#65, but the bounty search only accepted plain numeric issue queries before this change./api/v1/bounties, and the public/bountiespage search form/results.#for issue-number search values.#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 passedPYTEST_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 passedPYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uv run --extra dev ruff check app/path_params.py tests/test_path_params.py tests/test_bounty_pages.py-> passedPYTEST_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 formattedSummary by CodeRabbit
New Features
#prefix notation (e.g.,#65), making searches more user-friendly and consistent with common issue tracking conventionsTests
#prefix notation#-prefixed issue numbers are correctly normalized and invalid formats are properly rejected